ATLAS Offline Software
|
Service used for executing AthCUDA::IKernelTask
tasks.
More...
#include <KernelRunnerSvc.h>
Public Member Functions | |
void | setTaskFinished () |
Interface inherited from @c IService | |
virtual StatusCode | initialize () override |
Initialise the service. More... | |
virtual StatusCode | finalize () override |
Finalise the service. More... | |
Interface inherited from @c AthCUDA::IKernelRunnerSvc | |
virtual StatusCode | execute (std::unique_ptr< IKernelTask > task) override |
Execute a user specified kernel task. More... | |
Private Attributes | |
std::atomic_int | m_kernelsInFlight |
The current number of kernels being executed. More... | |
std::atomic_uint | m_totalTasks |
The number of tasks executed during the job in total. More... | |
std::atomic_uint | m_gpuTasks |
The number of tasks sent to the GPU during the job. More... | |
std::unique_ptr< KernelRunnerSvcImpl > | m_impl |
Implementation helper object. More... | |
Service properties | |
Gaudi::Property< int > | m_nKernels |
The number of streams to use. More... | |
ServiceHandle< IStreamPoolSvc > | m_streamPoolSvc |
Service managing CUDA the streams. More... | |
Service used for executing AthCUDA::IKernelTask
tasks.
It allows the user to execute a configured number of tasks in parallel on a GPU, while "overflow" tasks are executed on the CPU instead.
Definition at line 33 of file KernelRunnerSvc.h.
|
overridevirtual |
Execute a user specified kernel task.
If a GPU is available at runtime, and it is not doing other things at the moment, this function offloads the calculation to the GPU, and returns right away. The user is expected to return control in the calling thread to the framework, as the kernel task will notify the framework when the task gets finished.
If a GPU is not available for any reason, the function just executes the task on the CPU in the caller thread, and returns only once the task is finished.
task | The task to be executed on the CPU or GPU |
Definition at line 72 of file KernelRunnerSvc.cxx.
|
overridevirtual |
|
overridevirtual |
void AthCUDA::KernelRunnerSvc::setTaskFinished | ( | ) |
Definition at line 115 of file KernelRunnerSvc.cxx.
|
private |
The number of tasks sent to the GPU during the job.
Definition at line 97 of file KernelRunnerSvc.h.
|
private |
Implementation helper object.
Definition at line 100 of file KernelRunnerSvc.h.
|
private |
The current number of kernels being executed.
Definition at line 92 of file KernelRunnerSvc.h.
|
private |
The number of streams to use.
Definition at line 81 of file KernelRunnerSvc.h.
|
private |
Service managing CUDA the streams.
Definition at line 85 of file KernelRunnerSvc.h.
|
private |
The number of tasks executed during the job in total.
Definition at line 95 of file KernelRunnerSvc.h.