QMCPACK
ScopedProfiler Class Reference
+ Collaboration diagram for ScopedProfiler:

Public Member Functions

 ScopedProfiler (bool active)
 
 ~ScopedProfiler ()
 
bool isActive () const
 

Private Attributes

const bool active_
 

Detailed Description

Definition at line 17 of file ScopedProfiler.h.

Constructor & Destructor Documentation

◆ ScopedProfiler()

ScopedProfiler ( bool  active)
inline

Definition at line 20 of file ScopedProfiler.h.

References ScopedProfiler::active_, and qmcplusplus::cudaErrorCheck().

20  : active_(active)
21  {
22  if (active_)
23  {
24 #if defined(ENABLE_CUDA) && !defined(QMC_CUDA2HIP)
25  cudaErrorCheck(cudaProfilerStart(), "cudaProfilerStart failed!");
26 #endif
27 #ifdef USE_VTUNE_API
28  __itt_resume();
29 #endif
30  }
31  }
cudaErrorCheck(cudaMemcpyAsync(dev_lu.data(), lu.data(), sizeof(decltype(lu)::value_type) *lu.size(), cudaMemcpyHostToDevice, hstream), "cudaMemcpyAsync failed copying log_values to device")

◆ ~ScopedProfiler()

~ScopedProfiler ( )
inline

Definition at line 33 of file ScopedProfiler.h.

References ScopedProfiler::active_, and qmcplusplus::cudaErrorCheck().

34  {
35  if (active_)
36  {
37 #if defined(ENABLE_CUDA) && !defined(QMC_CUDA2HIP)
38  cudaErrorCheck(cudaProfilerStop(), "cudaProfilerStop failed!");
39 #endif
40 #ifdef USE_VTUNE_API
41  __itt_pause();
42 #endif
43  }
44  }
cudaErrorCheck(cudaMemcpyAsync(dev_lu.data(), lu.data(), sizeof(decltype(lu)::value_type) *lu.size(), cudaMemcpyHostToDevice, hstream), "cudaMemcpyAsync failed copying log_values to device")

Member Function Documentation

◆ isActive()

bool isActive ( ) const
inline

Definition at line 46 of file ScopedProfiler.h.

References ScopedProfiler::active_.

46 { return active_; }

Member Data Documentation

◆ active_

const bool active_
private

The documentation for this class was generated from the following file: