Skip to content

Commit

Permalink
update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
zhczhong committed Oct 18, 2024
1 parent 41507e5 commit 3536d6f
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions lib/gc/ExecutionEngine/GPURuntime/ocl/GpuOclRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ void DisableProfiling();

class GPUKernelTracer {
public:
static std::unique_ptr<GPUKernelTracer> getInstance() {
std::unique_ptr<GPUKernelTracer> instance =
std::make_unique<GPUKernelTracer>();
return instance;
}

GPUKernelTracer() {
gcLogD("Enable Profiling.");
EnableProfiling();
Expand All @@ -45,12 +39,16 @@ class GPUKernelTracer {
};

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

#endif

Expand Down

0 comments on commit 3536d6f

Please sign in to comment.