Clover Git
OpenCL 1.1 software implementation
|
CPU-specific information about a kernel event. More...
#include <kernel.h>
Public Member Functions | |
CPUKernelEvent (CPUDevice *device, KernelEvent *event) | |
Constructor. | |
~CPUKernelEvent () | |
bool | reserve () |
The next Work Group that will execute will be the last. Locks the event. | |
bool | finished () |
All the work groups have finished. | |
CPUKernelWorkGroup * | takeInstance () |
Must be called exactly one time after reserve(). Unlocks the event. | |
void * | kernelArgs () const |
Return the cached kernel arguments. | |
void | cacheKernelArgs (void *args) |
Cache pre-built kernel arguments. | |
void | workGroupFinished () |
A work-group has just finished. | |
Private Attributes | |
CPUDevice * | p_device |
KernelEvent * | p_event |
size_t | p_current_work_group [MAX_WORK_DIMS] |
size_t | p_max_work_groups [MAX_WORK_DIMS] |
size_t | p_current_wg |
size_t | p_finished_wg |
size_t | p_num_wg |
pthread_mutex_t | p_mutex |
void * | p_kernel_args |
CPU-specific information about a kernel event.
This class put in a Coal::KernelEvent
device-data field (see Coal::Event::setDeviceData()
) is responsible for dispatching the Coal::CPUKernelWorkGroup
objects between the CPU worker threads.
Definition at line 292 of file cpu/kernel.h.
CPUKernelEvent::CPUKernelEvent | ( | CPUDevice * | device, |
KernelEvent * | event | ||
) |
Constructor.
device | device running the kernel |
event | Coal::KernelEvent holding device-agnostic data about the event |
Definition at line 297 of file cpu/kernel.cpp.
References p_current_work_group, p_max_work_groups, p_mutex, p_num_wg, and Coal::KernelEvent::work_dim().
CPUKernelEvent::~CPUKernelEvent | ( | ) |
Definition at line 319 of file cpu/kernel.cpp.
References p_kernel_args, and p_mutex.
void CPUKernelEvent::cacheKernelArgs | ( | void * | args | ) |
Cache pre-built kernel arguments.
Definition at line 380 of file cpu/kernel.cpp.
References p_kernel_args.
Referenced by Coal::CPUKernelWorkGroup::callArgs().
bool CPUKernelEvent::finished | ( | ) |
All the work groups have finished.
Definition at line 336 of file cpu/kernel.cpp.
References p_finished_wg, p_mutex, and p_num_wg.
Referenced by worker().
void * CPUKernelEvent::kernelArgs | ( | ) | const |
Return the cached kernel arguments.
Definition at line 375 of file cpu/kernel.cpp.
References p_kernel_args.
Referenced by Coal::CPUKernelWorkGroup::callArgs().
bool CPUKernelEvent::reserve | ( | ) |
The next Work Group that will execute will be the last. Locks the event.
Definition at line 327 of file cpu/kernel.cpp.
References p_current_wg, p_mutex, and p_num_wg.
Referenced by Coal::CPUDevice::getEvent().
CPUKernelWorkGroup * CPUKernelEvent::takeInstance | ( | ) |
Must be called exactly one time after reserve(). Unlocks the event.
Definition at line 358 of file cpu/kernel.cpp.
References Coal::KernelEvent::deviceKernel(), incVec(), p_current_wg, p_current_work_group, p_event, p_max_work_groups, p_mutex, and Coal::KernelEvent::work_dim().
Referenced by worker().
void CPUKernelEvent::workGroupFinished | ( | ) |
A work-group has just finished.
Definition at line 349 of file cpu/kernel.cpp.
References p_finished_wg, and p_mutex.
Referenced by Coal::CPUKernelWorkGroup::~CPUKernelWorkGroup().
size_t Coal::CPUKernelEvent::p_current_wg [private] |
Definition at line 318 of file cpu/kernel.h.
Referenced by reserve(), and takeInstance().
size_t Coal::CPUKernelEvent::p_current_work_group[MAX_WORK_DIMS] [private] |
Definition at line 316 of file cpu/kernel.h.
Referenced by CPUKernelEvent(), and takeInstance().
CPUDevice* Coal::CPUKernelEvent::p_device [private] |
Definition at line 314 of file cpu/kernel.h.
KernelEvent* Coal::CPUKernelEvent::p_event [private] |
Definition at line 315 of file cpu/kernel.h.
Referenced by takeInstance().
size_t Coal::CPUKernelEvent::p_finished_wg [private] |
Definition at line 318 of file cpu/kernel.h.
Referenced by finished(), and workGroupFinished().
void* Coal::CPUKernelEvent::p_kernel_args [private] |
Definition at line 320 of file cpu/kernel.h.
Referenced by cacheKernelArgs(), kernelArgs(), and ~CPUKernelEvent().
size_t Coal::CPUKernelEvent::p_max_work_groups[MAX_WORK_DIMS] [private] |
Definition at line 316 of file cpu/kernel.h.
Referenced by CPUKernelEvent(), and takeInstance().
pthread_mutex_t Coal::CPUKernelEvent::p_mutex [private] |
Definition at line 319 of file cpu/kernel.h.
Referenced by CPUKernelEvent(), finished(), reserve(), takeInstance(), workGroupFinished(), and ~CPUKernelEvent().
size_t Coal::CPUKernelEvent::p_num_wg [private] |
Definition at line 318 of file cpu/kernel.h.
Referenced by CPUKernelEvent(), finished(), and reserve().