Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions chimpfella/execute.d
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public struct MetaExecution(ProcessBench)

/+++
Execution Engine:
Takes multiple functions to be executed, however, they should be considered as a group, use multiple engines
Takes multiple functions to be executed, however, they should be considered as a group, use multiple engines
for totally distinct functions.
+/
private template DefaultExecutionEngine(string fullName, FuncPack...)
Expand Down Expand Up @@ -93,7 +93,7 @@ private template DefaultExecutionEngine(string fullName, FuncPack...)

static assert(hasMember!(typeof(theData), "pack"),
"Since D does not have multiple return values this library requires that you return some\n
type containing
type containing
an AliasSeq of values named \"pack\" which the library will expand for you");
const res = theFunc(theData.pack);
}
Expand Down Expand Up @@ -175,8 +175,8 @@ template ExecuteBenchmarks(alias fromHere)

//pragma(msg, "\t", paramItem);
//Work out what we're doing, then instantiate theFunc with it.
//Is it a type
//Is it a type

//Parameter is fits the slot
static if (__traits(compiles, symbol!paramItem))
{
Expand Down Expand Up @@ -221,10 +221,10 @@ template ExecuteBenchmarks(alias fromHere)
//pragma(msg, isInputRange!specRangeT);
static assert(isInputRange!specRangeT
&& !isInfinite!(specRangeT), "not a valid parameter");
//It's a range
//It's a range
alias ElemT = ElementType!specRangeT;
//pragma(msg, ElemT);

static assert(__traits(compiles, symbol!(ElemT.init)),
" symbol = " ~ fullyQualifiedName!symbol);
import std.array : array;
Expand All @@ -238,7 +238,7 @@ template ExecuteBenchmarks(alias fromHere)
auto bench = theFunctionBench;
static if(isSomeString!(typeof(ctRangeItem)))
enum stringSummary = ctRangeItem;
else
else
enum stringSummary = ctRangeItem.stringof;
//Run the benchmark
alias engine = DefaultExecutionEngine!(
Expand Down Expand Up @@ -267,7 +267,7 @@ template ExecuteBenchmarks(alias fromHere)
engine.runEngine!(MetaT, genInd,
genFunc)(metaExecutionState, bench.measurementList);
}

}

}
Expand All @@ -276,7 +276,7 @@ template ExecuteBenchmarks(alias fromHere)
}
//A parameter can be a range, don't forget

//Can't introspect over the number of template parameters realistically.
//Can't introspect over the number of template parameters realistically.
}
else
{
Expand Down Expand Up @@ -371,10 +371,10 @@ unittest
{
return "cpuid;".repeat(n).join();
}

enum cpuidRange = iota(1, 10).map!(ctfeRepeater).array;
@TemplateBenchmark!(0, cpuidRange)
@FunctionBenchmark!("Measure", iota(1, 10), (_) => [1, 2, 3, 4])(meas)
@TemplateBenchmark!(0, cpuidRange)
@FunctionBenchmark!("Measure", iota(1, 10), (_) => [1, 2, 3, 4])(meas)
static int sum(string asmLine)(inout int[] input)
{
//This is quite fun because ldc will sometimes get rid of the entire function body and just loop over the asm's
Expand Down Expand Up @@ -408,7 +408,7 @@ unittest
writefln!"---------------%s---------------"(setName);
auto counterPut = counters.map!(x => x.getHeader);
//pragma(msg, ElementType!(typeof(counterPut)));
writeln("I;", counterPut.joiner!(typeof(counterPut)).joiner.joiner(";"));
() @trusted { writeln("I;", counterPut.joiner!(typeof(counterPut)).joiner.joiner(";")); }();
}

void put(scope size_t[] data)
Expand Down
4 changes: 3 additions & 1 deletion dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ configuration "library" {
importPaths "chimpfella/" "chimpfella/measurement/"
}


configuration "unittest" {
dflags "-preview=dip1000"
}