an example of parallel calculation of metrics

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Oct 1 00:03:40 PDT 2015


On 09/30/2015 09:15 PM, Jay Norwood wrote:

 > alias TO = Tuple!(TR,"L1_MISS", TR, "L1_HIT", TR,"DATA_ACC", 
TR,"ALL_ACC");

Looks like a bug. Workaround: Get rid of member names there:

alias TO = Tuple!(TR, TR, TR, TR);

 > 
//taskPool.amap!(Metrics)(std.algorithm.map!getTerm(samples),results);

For some reason, having member names prevents 'results' passing one of 
amap's requirements. The following check in std.parallelism thinks that 
'results' does not have random assignable elements if it is a Tuple with 
member names.

     else static if(randAssignable!(Args[$ - 1]) && Args.length > 1)
     {
         static assert(0, "Wrong buffer type.");
     }

Ali



More information about the Digitalmars-d-learn mailing list