ATLAS Offline Software
|
Abstract interface for setting up / running a CUDA task. More...
#include <IKernelTask.h>
Public Types | |
enum | KernelExecMode { Synchronous = 0, Asynchronous = 1 } |
Possible modes in which the kernel was executed. More... | |
Public Member Functions | |
virtual | ~IKernelTask ()=default |
Virtual destructor, to make vtable happy. More... | |
virtual int | execute (StreamHolder &stream)=0 |
Execute the kernel using a specific stream. More... | |
virtual int | finished (int code, KernelExecMode mode)=0 |
Function called when an asynchronous execution finishes. More... | |
Abstract interface for setting up / running a CUDA task.
The expectation is that the implementation of such a task would either schedule itself to CUDA for execution, or if no GPU is available (at the time), would execute its calculation on the CPU instead.
Definition at line 22 of file IKernelTask.h.
Possible modes in which the kernel was executed.
Enumerator | |
---|---|
Synchronous | The kernel was executed synchronously on the CPU. |
Asynchronous | The kernel was executed asynchronously on a CUDA device. |
Definition at line 29 of file IKernelTask.h.
|
virtualdefault |
Virtual destructor, to make vtable happy.
|
pure virtual |
Execute the kernel using a specific stream.
If the stream is "invalid", the task needs to be executed in the current thread on the CPU instead.
stream | The stream to use in the task execution |
0
if the call succeeded, something else otherwise
|
pure virtual |
Function called when an asynchronous execution finishes.
This function is set up to be called automatically when the task's execution is offloaded to a GPU, and that execution has finished. It can be used to notify some listener about the finish of the task.
code | A code representing the "successfulness" of the asynchronous task |
mode | The mode in which the kernel was executed |
0
if the call succeeded, something else otherwise