English 中文(简体)
clock() in opencl
原标题:clock() in opencl

我知道,在《世界人权宣言》中存在着职能锁定,你可以在那里制定方言,并询问万国邮联的时间。 但是,我想知道,在《公开宣言》中是否存在这样的事情? 是否有办法询问万国邮联在开放式世界时段? (使用NVIDIA工具袋的Im)。

最佳回答
问题回答

没有任何开放的办法来直接盘问锁周期。 然而,开放 消费物价指数确实有一个特征分析机制,它暴露了对化装置的增量反射。 通过比较定购事件之间的差别,可以衡量过去的时间。 See clGetEventProfilingInfo.

还有一些人前来帮助: A. 简短介绍与开放式文化论坛一起运行的剖面图

采用可图谱方式:

cmdQueue = clCreateCommandQueue(context, *devices, CL_QUEUE_PROFILING_ENABLE, &err);

Profiling kernel:

cl_event prof_event; 
clEnqueueNDRangeKernel(cmdQueue, kernel, 1 , 0, globalWorkSize, NULL, 0, NULL, &prof_event);

阅读剖面数据:

cl_ulong ev_start_time=(cl_ulong)0;     
cl_ulong ev_end_time=(cl_ulong)0;   

clFinish(cmdQueue);
err = clWaitForEvents(1, &prof_event);
err |= clGetEventProfilingInfo(prof_event, CL_PROFILING_COMMAND_START, sizeof(cl_ulong), &ev_start_time, NULL);
err |= clGetEventProfilingInfo(prof_event, CL_PROFILING_COMMAND_END, sizeof(cl_ulong), &ev_end_time, NULL);

计算执行时间:

float run_time_gpu = (float)(ev_end_time - ev_start_time)/1000; // in usec

Profiling of individual work-items / work-goups is NOT possible yet. You can set globalWorkSize = localWorkSize for profiling. Then you have only one workgroup.

Btw:对单一工作项目(一些工作项目)的总结非常有益。 由于只有一些工作项目,你才得以隐藏晚期的记忆和导致无法进行有意义的测量的间接费用。

(当然与NVidia OpenCL合作)

uint clock_time()
{
    uint clock_time;
    asm("mov.u32 %0, %%clock;" : "=r"(clock_time));
    return clock_time;
}




相关问题
Why won t OpenCV compile in NVCC?

I am trying to integrate CUDA and openCV in a project. Problem is openCV won t compile when NVCC is used, while a normal c++ project compiles just fine. This seems odd to me, as I thought NVCC ...

error in CUDA compilation

I m getting this error while trying to run sample codes in CUDA SDK. I have CUDA 2.3 and Visual studio 2008 LINK : fatal error LNK1181: cannot open input file cutil32D.lib Any pointers how to ...

CUDA Memory Allocation accessible for both host and device

I m trying to figure out a way to allocate a block of memory that is accessible by both the host (CPU) and device (GPU). Other than using cudaHostAlloc() function to allocate page-locked memory that ...

热门标签