I’m wrapping a C++ AMP invocation with this timer, with the code shown below. Unfortunately, according to the timer, my C++ AMP call takes about 2 seconds – a lot more than it realistically does. Can someone help me figure out what’s wrong?
double sum = 0.0;
for (int t = 0; t < 20; ++t)
{
Timer gpuTimer;
gpuTimer.Start();
auto gh = gpu_histogram(target, size);
gpuTimer.Stop();
sum += gpuTimer.Elapsed();
}
Turns out this was a simple misunderstanding – I assumed that
Timermeasures time in seconds whereas it’s actually using milliseconds. 🙂 Data makes sense now and… C++ AMP is awesome!