Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[src] use CL_PROFILING_COMMAND_END as latency time #67

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions src/kernel_latency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ int clPeak::runKernelLatency(cl::CommandQueue &queue, cl::Program &prog, device_
return 0;

cl::Context ctx = queue.getInfo<CL_QUEUE_CONTEXT>();
cl_uint numItems = (devInfo.maxWGSize) * (devInfo.numCUs) * FETCH_PER_WI;
cl::NDRange globalSize = (numItems / FETCH_PER_WI);
cl::NDRange localSize = devInfo.maxWGSize;
cl_uint numItems = FETCH_PER_WI;
cl::NDRange globalSize = 1;
cl::NDRange localSize = 1;
uint iters = devInfo.kernelLatencyIters;
float latency;

Expand Down Expand Up @@ -38,7 +38,7 @@ int clPeak::runKernelLatency(cl::CommandQueue &queue, cl::Program &prog, device_
queue.enqueueNDRangeKernel(kernel_v1, cl::NullRange, globalSize, localSize, NULL, &timeEvent);
queue.finish();
cl_ulong start = timeEvent.getProfilingInfo<CL_PROFILING_COMMAND_QUEUED>() / 1000;
cl_ulong end = timeEvent.getProfilingInfo<CL_PROFILING_COMMAND_START>() / 1000;
cl_ulong end = timeEvent.getProfilingInfo<CL_PROFILING_COMMAND_END>() / 1000;
latency += (float)((int)end - (int)start);
}
latency /= static_cast<float>(iters);
Expand Down