![]() |
Fréchet View
1.6.0
A Tool for Exploring Fréchet Distance Algorithms
|
a singleton class managing concurrency settings for the application.
It controls the number of parallel threads (for use by TBB functions).
It sets up OpenCL contexts for use by a GPU device.
Also acts as a factory for poly::Algorithm
Definition at line 22 of file concurrency.h.
#include <concurrency.h>
Public Member Functions | |
ConcurrencyContext () | |
default constructor; does no initialisation More... | |
~ConcurrencyContext () | |
destructor; releases all OpenCL resources More... | |
void | setup (int max_threads) |
set up TBB thread count More... | |
bool | setupGpu (size2_t max_tile) |
set up OpenCL context More... | |
void | close () |
release all OpenCL resources. More... | |
Static Public Member Functions | |
static int | countThreads () |
static int | countCores () |
static tbb::tbb_thread::id | currentThread () |
static bool | hasGpuSupport () |
static std::string | gpuName () |
static cl_uint | countGpuUnits () |
static cl_context | clContext () |
static cl_command_queue | clQueue () |
static void | maxMaxtrixTile (size2_t &) |
set tile size for cubic matrix multiplication. Tiles adapt to local memory and/or compute units. This is the upper limit; usually {4, 4..8}. More... | |
static int | cacheSize (int level) |
size of CPU cache memory More... | |
Static Public Attributes | |
static ConcurrencyContext | instance |
singleton instance More... | |
Private Member Functions | |
void | findCacheSizes () |
retrieve CPU cache sizes More... | |
Static Private Member Functions | |
static void | cpuid (int leaf, unsigned int regs[4]) |
retrieve CPU factory info More... | |
static void | cpuid (int leaf, int level, unsigned int regs[4]) |
retrieve CPU factory info More... | |
static const char * | findKernelDirectory (const char *subdir) |
look up directory containing OpenCL source files ("kernels") More... | |
Private Attributes | |
tbb::task_scheduler_init * | tbb_context |
controls the number of parallel threads that are used by TBB functions. More... | |
int | num_cores |
number of physical cores (if known) More... | |
int | num_threads |
number of logical threads (always known) More... | |
cl_platform_id | platform = nullptr |
OpenCL platform identifier. More... | |
cl_context | ctx |
OpenCL platform identifier. More... | |
cl_device_id | device = nullptr |
OpenCL device. More... | |
cl_command_queue | queue = nullptr |
OpenCL command queue. More... | |
cl_event | event = nullptr |
last OpenCL event More... | |
cl_int | clerr |
last OpenCL return code More... | |
std::string | device_name |
name of OpenCL device More... | |
cl_uint | gpu_units |
number of GPU units (if known) More... | |
size2_t | max_tile |
maximum tile size for Boolean matrix multiplication More... | |
ConcurrencyContext::ConcurrencyContext | ( | ) |
default constructor; does no initialisation
Definition at line 25 of file concurrency.cpp.
ConcurrencyContext::~ConcurrencyContext | ( | ) |
destructor; releases all OpenCL resources
Definition at line 31 of file concurrency.cpp.
|
static |
size of CPU cache memory
level | cache level (L1,L2,L3) |
Definition at line 208 of file concurrency.cpp.
|
static |
Definition at line 71 of file concurrency.cpp.
void ConcurrencyContext::close | ( | ) |
release all OpenCL resources.
Definition at line 177 of file concurrency.cpp.
|
static |
Definition at line 76 of file concurrency.cpp.
|
static |
Definition at line 51 of file concurrency.cpp.
|
static |
Definition at line 67 of file concurrency.cpp.
|
static |
Definition at line 47 of file concurrency.cpp.
|
staticprivate |
retrieve CPU factory info
Definition at line 198 of file concurrency.cpp.
|
staticprivate |
retrieve CPU factory info
Definition at line 188 of file concurrency.cpp.
|
static |
Definition at line 55 of file concurrency.cpp.
|
private |
retrieve CPU cache sizes
|
staticprivate |
look up directory containing OpenCL source files ("kernels")
Definition at line 158 of file concurrency.cpp.
|
static |
Definition at line 63 of file concurrency.cpp.
|
static |
Definition at line 59 of file concurrency.cpp.
|
static |
set tile size for cubic matrix multiplication. Tiles adapt to local memory and/or compute units. This is the upper limit; usually {4, 4..8}.
Definition at line 81 of file concurrency.cpp.
void ConcurrencyContext::setup | ( | int | max_threads | ) |
set up TBB thread count
max_threads | maximum number of thread |
Definition at line 39 of file concurrency.cpp.
bool ConcurrencyContext::setupGpu | ( | size2_t | max_tile | ) |
set up OpenCL context
max_tile | maximum tile size for Boolean matrix multiplication |
Definition at line 87 of file concurrency.cpp.
|
private |
last OpenCL return code
Definition at line 46 of file concurrency.h.
|
private |
OpenCL platform identifier.
Definition at line 38 of file concurrency.h.
|
private |
OpenCL device.
Definition at line 40 of file concurrency.h.
|
private |
name of OpenCL device
Definition at line 49 of file concurrency.h.
|
private |
last OpenCL event
Definition at line 44 of file concurrency.h.
|
private |
number of GPU units (if known)
Definition at line 51 of file concurrency.h.
|
static |
singleton instance
Definition at line 61 of file concurrency.h.
|
private |
maximum tile size for Boolean matrix multiplication
Definition at line 53 of file concurrency.h.
|
private |
number of physical cores (if known)
Definition at line 31 of file concurrency.h.
|
private |
number of logical threads (always known)
Definition at line 33 of file concurrency.h.
|
private |
OpenCL platform identifier.
Definition at line 36 of file concurrency.h.
|
private |
OpenCL command queue.
Definition at line 42 of file concurrency.h.
|
private |
controls the number of parallel threads that are used by TBB functions.
Definition at line 29 of file concurrency.h.