Skip to content

Commit 3536d6f

Browse files
committed
update comment
1 parent 41507e5 commit 3536d6f

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

lib/gc/ExecutionEngine/GPURuntime/ocl/GpuOclRuntime.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ void DisableProfiling();
2727

2828
class GPUKernelTracer {
2929
public:
30-
static std::unique_ptr<GPUKernelTracer> getInstance() {
31-
std::unique_ptr<GPUKernelTracer> instance =
32-
std::make_unique<GPUKernelTracer>();
33-
return instance;
34-
}
35-
3630
GPUKernelTracer() {
3731
gcLogD("Enable Profiling.");
3832
EnableProfiling();
@@ -45,12 +39,16 @@ class GPUKernelTracer {
4539
};
4640

4741
/*
48-
Create a tracer with a static life cycle to trace all device kernel execution
49-
during the program. The unique pointer is used to manage class creation and
50-
recycling. When the pointer is destroyed, the tracer's destructor will be called
51-
and print the profile result.
42+
Create an RAII tracer with a static life cycle to trace all device kernel
43+
execution during the program. When the tracer's constructor is called, the
44+
EnableProfiling will also be called, registering some metric collection
45+
call-back function into the opencl function call. When the tracer is destroyed,
46+
the DisableProfiling is also called which will statistic the collected metric
47+
during the tracer lifetime and print the result. The concrete implementation of
48+
EnableProfiling and DisableProfiling could refer to
49+
https://github.com/intel/pti-gpu/blob/master/tools/onetrace/tool.cc.
5250
*/
53-
static std::unique_ptr<GPUKernelTracer> tracer = GPUKernelTracer::getInstance();
51+
static GPUKernelTracer tracer;
5452

5553
#endif
5654

0 commit comments

Comments
 (0)