Stan Math Library  2.20.0
reverse mode automatic differentiation
Classes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
stan::math::opencl_context_base Class Reference

The opencl_context_base class represents an OpenCL context in the standard Meyers singleton design pattern. More...

#include <opencl_context.hpp>

Classes

struct  tuning_struct
 

Protected Types

typedef std::map< const char *, int > map_base_opts
 

Protected Member Functions

 opencl_context_base (opencl_context_base const &)=delete
 
void operator= (opencl_context_base const &)=delete
 

Static Protected Member Functions

static opencl_context_basegetInstance ()
 

Protected Attributes

cl::Context context_
 
cl::CommandQueue command_queue_
 
std::vector< cl::Platform > platforms_
 
cl::Platform platform_
 
std::string platform_name_
 
std::vector< cl::Device > devices_
 
cl::Device device_
 
std::string device_name_
 
size_t max_thread_block_size_
 
map_base_opts base_opts_
 
struct stan::math::opencl_context_base::tuning_struct tuning_opts_
 

Friends

class opencl_context
 

Detailed Description

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 81 of file opencl_context.hpp.

Member Typedef Documentation

◆ map_base_opts

typedef std::map<const char*, int> stan::math::opencl_context_base::map_base_opts
protected

Definition at line 176 of file opencl_context.hpp.

Constructor & Destructor Documentation

◆ opencl_context_base()

stan::math::opencl_context_base::opencl_context_base ( opencl_context_base const &  )
protecteddelete

Member Function Documentation

◆ getInstance()

static opencl_context_base& stan::math::opencl_context_base::getInstance ( )
inlinestaticprotected

Definition at line 203 of file opencl_context.hpp.

◆ operator=()

void stan::math::opencl_context_base::operator= ( opencl_context_base const &  )
protecteddelete

Friends And Related Function Documentation

◆ opencl_context

friend class opencl_context
friend

Definition at line 82 of file opencl_context.hpp.

Member Data Documentation

◆ base_opts_

map_base_opts stan::math::opencl_context_base::base_opts_
protected
Initial value:
= {{"LOWER", static_cast<int>(TriangularViewCL::Lower)},
{"UPPER", static_cast<int>(TriangularViewCL::Upper)},
{"ENTIRE", static_cast<int>(TriangularViewCL::Entire)},
{"UPPER_TO_LOWER", static_cast<int>(TriangularMapCL::UpperToLower)},
{"LOWER_TO_UPPER", static_cast<int>(TriangularMapCL::LowerToUpper)},
{"THREAD_BLOCK_SIZE", 32},
{"WORK_PER_THREAD", 8},
{"REDUCTION_STEP_SIZE", 4},
{"LOCAL_SIZE_", 64}}

Definition at line 178 of file opencl_context.hpp.

◆ command_queue_

cl::CommandQueue stan::math::opencl_context_base::command_queue_
protected

Definition at line 165 of file opencl_context.hpp.

◆ context_

cl::Context stan::math::opencl_context_base::context_
protected

Definition at line 164 of file opencl_context.hpp.

◆ device_

cl::Device stan::math::opencl_context_base::device_
protected

Definition at line 170 of file opencl_context.hpp.

◆ device_name_

std::string stan::math::opencl_context_base::device_name_
protected

Definition at line 171 of file opencl_context.hpp.

◆ devices_

std::vector<cl::Device> stan::math::opencl_context_base::devices_
protected

Definition at line 169 of file opencl_context.hpp.

◆ max_thread_block_size_

size_t stan::math::opencl_context_base::max_thread_block_size_
protected

Definition at line 172 of file opencl_context.hpp.

◆ platform_

cl::Platform stan::math::opencl_context_base::platform_
protected

Definition at line 167 of file opencl_context.hpp.

◆ platform_name_

std::string stan::math::opencl_context_base::platform_name_
protected

Definition at line 168 of file opencl_context.hpp.

◆ platforms_

std::vector<cl::Platform> stan::math::opencl_context_base::platforms_
protected

Definition at line 166 of file opencl_context.hpp.

◆ tuning_opts_

struct stan::math::opencl_context_base::tuning_struct stan::math::opencl_context_base::tuning_opts_
protected

The documentation for this class was generated from the following file:

     [ Stan Home Page ] © 2011–2018, Stan Development Team.