Casting MapResult

jmh530 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jun 23 09:01:54 PDT 2015


On Tuesday, 23 June 2015 at 10:50:51 UTC, John Colvin wrote:

> If I remember correctly, core.simd should work with every 
> compiler on every supported OS. What did you try that didn't 
> work?

I figured out the issue! You have to compile using the -m64 flag 
to get it to work on Windows (this works on both dmd and rdmd). 
The 32bit specification does not support SIMD. I don't think I 
had ever noticed that it wasn't using a 64bit compilation.

I was a little disheartened getting an error running one of the 
first pieces of code on this page http://dlang.org/simd.html
the second line below, some casting issue.
int4 v = 7;
v = 3 * v;   // multiply each element in v by 3

Outside of that, I can see one issue. I was overloading a version 
of exp that takes a real and returns a real. I see no support for 
a real SIMD type, perhaps because the CPUs don't support it. So I 
pretty much could only overload the float or double versions.

On std.parallelism, I noticed that I could only loop through the 
static arrays with foreach with I appended them with []. I still 
get mixed up on that syntax. The good thing about static loops is 
that I could determine the length at compile time. I'm not 
positive, but I think I might be able to get it set up so that I 
could have different functions, one non-parallel below some 
length and one parallel above some length. This is good because 
the parallel one may not be able to use all the function 
attributes of the non-parallel ones.

I haven't been able to get anything like that to work for a 
dynamic array version as the length is not known at compile time, 
just one big function.


More information about the Digitalmars-d-learn mailing list