Stan Math Library
4.9.0
Automatic Differentiation
|
The opencl_context_base
class represents an OpenCL context in the standard Meyers singleton design pattern.
See the OpenCL specification glossary for a list of terms: https://www.khronos.org/registry/OpenCL/specs/opencl-1.2.pdf. The context includes the set of devices available on the host, command queues, manages kernels.
This is designed so there's only one instance running on the host.
Some design decisions that may need to be addressed later:
Definition at line 54 of file opencl_context.hpp.
#include <opencl_context.hpp>
Classes | |
struct | tuning_struct |
Protected Types | |
using | map_base_opts = std::unordered_map< std::string, int > |
Static Protected Member Functions | |
static opencl_context_base & | getInstance () noexcept |
static void | select_device (int platform_id, int device_id) |
Protected Attributes | |
cl::Context | context_ |
cl::CommandQueue | command_queue_ |
std::vector< cl::Platform > | platforms_ |
std::vector< cl::Platform > | platform_ |
std::string | platform_name_ |
std::vector< cl::Device > | device_ |
std::vector< cl::Device > | devices_ |
std::string | device_name_ |
size_t | max_thread_block_size_ |
bool | in_order_ |
map_base_opts | base_opts_ |
struct stan::math::opencl_context_base::tuning_struct | tuning_opts_ |
Private Member Functions | |
opencl_context_base (int platform_id=1, int device_id=1) | |
Construct the opencl_context by initializing the OpenCL context, devices, command queues, and kernel groups. | |
Friends | |
class | opencl_context |