简体   繁体   English

OpenCL 分析 kernel 中的 function

[英]OpenCL profiling function in kernel

As far as I know, the kernel can be profiled by opencl profiling API.据我所知,kernel 可以通过 opencl 分析 API 进行分析。 So I just get the kernel-level performance.所以我只是得到内核级的性能。 But if the kernel call other function, how i get profiling of this callee.但是如果 kernel 调用其他 function,我如何得到这个被调用者的分析。

static B { static B {

} }

kernel A { kernel A {

B();乙();

} }

Profile the kernel with the function call and with the function call commented out.使用 function 调用和注释掉 function 调用来分析 kernel。 Subtract the execution time.减去执行时间。 However be careful that the compiler doesn't empty the kernel (disable compiler optimization) in case no result is written to global memory.但是请注意,如果没有结果写入全局 memory,编译器不会清空 kernel(禁用编译器优化)。 Also be aware of time measurement error and uncertainty, if the function call takes way less time than the rest of the kernel execution;还要注意时间测量误差和不确定性,如果 function 调用的时间比 kernel 执行的 rest 的时间短; repeat and averagt the time measurements to get more accurate results.重复并平均时间测量以获得更准确的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM