Re: How to use math functions in dcompute?

2018-09-24 Thread Sobaya via Digitalmars-d-learn
On Thursday, 20 September 2018 at 12:48:14 UTC, Nicholas Wilson wrote: On Thursday, 20 September 2018 at 12:43:02 UTC, Nicholas Wilson wrote: Hmm, I can reproduce. Will look into it. pragma(LDC_intrinsic, "llvm.nvvm.cos.approx.f") float cos(float val); does work but is an approximation. It

Re: DlangUI and android

2018-09-24 Thread Joakim via Digitalmars-d-learn
On Monday, 10 September 2018 at 09:19:52 UTC, Josphe Brigmo wrote: Is there an emulator that can run the apks? Android emulator does not work, I suppose, because it isn't java. Complains about a missing classes.dex file. It isn't clear what you're trying to do: you're trying to run a D apk co

Re: Simple parallel foreach and summation/reduction

2018-09-24 Thread Russel Winder via Digitalmars-d-learn
Hi, Apologies for coming late to this thread. I started with: import std.random: uniform; import std.range: iota; import std.stdio: writeln; void main() { ulong sum; foreach(i; iota(1_000_000_000)) { if (uniform(0F,12F) > 6F) sum++; }

Re: Performance of GC.collect() for single block of `byte`s

2018-09-24 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/24/18 5:49 AM, Per Nordlöw wrote: The code import std.stdio; void main(string[] args) {     import std.datetime.stopwatch : benchmark;     import core.time : Duration;     import core.memory : GC;     immutable benchmarkCount = 1;     foreach (const i; 0 .. 10)     {     const

Re: transposed with enforceNotJagged not throwing?

2018-09-24 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/22/18 4:37 PM, berni wrote: On Saturday, 22 September 2018 at 12:52:45 UTC, Steven Schveighoffer wrote: It was suggested when transposed was fixed to include opIndex, but never implemented. Maybe I'm too naive, but isn't it easy to implement it just the same way, it is done with transver

Re: Running tests for a large library on Windows

2018-09-24 Thread kinke via Digitalmars-d-learn
On Monday, 24 September 2018 at 09:49:38 UTC, pineapple wrote: I've been setting up CI tests and OSX and Linux tests are good to go thanks to Travis. I'm having a little more difficulty with testing on Windows via AppVeyor, since DMD is too memory-hungry to `dub test` without a fatal error when

Re: Running tests for a large library on Windows

2018-09-24 Thread pineapple via Digitalmars-d-learn
Speaking of which, is there any AppVeyor config or script laying around somewhere for how to install 64-bit DMD? Since I would ideally like to automate testing with both 32-bit and 64-bit DMD

Running tests for a large library on Windows

2018-09-24 Thread pineapple via Digitalmars-d-learn
I do mach.d - https://github.com/pineapplemachine/mach.d I've been setting up CI tests and OSX and Linux tests are good to go thanks to Travis. I'm having a little more difficulty with testing on Windows via AppVeyor, since DMD is too memory-hungry to `dub test` without a fatal error when DMD

Performance of GC.collect() for single block of `byte`s

2018-09-24 Thread Per Nordlöw via Digitalmars-d-learn
The code import std.stdio; void main(string[] args) { import std.datetime.stopwatch : benchmark; import core.time : Duration; import core.memory : GC; immutable benchmarkCount = 1; foreach (const i; 0 .. 10) { const byteCount = i*100_000_000; const array

Re: Simple parallel foreach and summation/reduction

2018-09-24 Thread Chris Katko via Digitalmars-d-learn
On Monday, 24 September 2018 at 07:13:24 UTC, Chris Katko wrote: On Monday, 24 September 2018 at 05:59:20 UTC, Chris Katko wrote: [...] Actually, I just realized/remembered that the error occurs inside parallelism itself, and MANY times at that: [...] This JUST occurred to me. Wh

Re: Simple parallel foreach and summation/reduction

2018-09-24 Thread Chris Katko via Digitalmars-d-learn
On Monday, 24 September 2018 at 05:59:20 UTC, Chris Katko wrote: On Saturday, 22 September 2018 at 02:26:41 UTC, Chris Katko wrote: On Saturday, 22 September 2018 at 02:13:58 UTC, Chris Katko wrote: On Friday, 21 September 2018 at 12:15:59 UTC, Ali Çehreli wrote: On 09/21/2018 12:25 AM, Chris