vSMC
vSMC: Scalable Monte Carlo
Classes | Namespaces | Macros | Functions
backend_cl.hpp File Reference
#include <vsmc/internal/common.hpp>
#include <vsmc/opencl/cl_buffer.hpp>
#include <vsmc/opencl/cl_configure.hpp>
#include <vsmc/opencl/cl_error.hpp>
#include <vsmc/opencl/cl_manager.hpp>
#include <vsmc/opencl/cl_manip.hpp>
#include <vsmc/opencl/internal/cl_copy.hpp>
#include <vsmc/opencl/internal/cl_wrapper.hpp>
#include <vsmc/rng/seed.hpp>
#include <vsmc/utility/array.hpp>

Go to the source code of this file.

Classes

class  vsmc::InitializeCL< T, PlaceHolder >
 Sampler<T>::init_type subtype using OpenCL. More...
 
struct  vsmc::internal::IsDerivedFromStateCL< D >
 
struct  vsmc::internal::IsDerivedFromStateCLImpl< D >
 
class  vsmc::MonitorEvalCL< T, PlaceHolder >
 Monitor<T>::eval_type subtype using OpenCL. More...
 
class  vsmc::MoveCL< T, PlaceHolder >
 Sampler<T>::move_type subtype using OpenCL. More...
 
class  vsmc::PathEvalCL< T, PlaceHolder >
 Path<T>::eval_type subtype using OpenCL. More...
 
class  vsmc::StateCL< StateSize, FPType, ID >
 Particle::value_type subtype using OpenCL. More...
 

Namespaces

 vsmc
 
 vsmc::internal
 

Macros

#define VSMC_DEFINE_OPENCL_CONFIGURE_KERNEL
 
#define VSMC_DEFINE_OPENCL_COPY(Name)
 
#define VSMC_DEFINE_OPENCL_MEMBER_DATA
 
#define VSMC_DEFINE_OPENCL_MOVE(Name)
 
#define VSMC_DEFINE_OPENCL_SET_KERNEL
 
#define VSMC_RUNTIME_ASSERT_OPENCL_BACKEND_CL_BUILD(func)
 
#define VSMC_RUNTIME_ASSERT_OPENCL_BACKEND_CL_COPY_SIZE_MISMATCH
 
#define VSMC_RUNTIME_ASSERT_OPENCL_BACKEND_CL_STATE_SIZE(state_size)   VSMC_RUNTIME_ASSERT((state_size >= 1), ("STATE SIZE IS LESS THAN 1"))
 
#define VSMC_RUNTIME_ASSERT_OPENCL_BACKEND_CL_UNPACK_SIZE(psize, dim)
 
#define VSMC_STATIC_ASSERT_OPENCL_BACKEND_CL_DYNAMIC_STATE_SIZE_RESIZE(Dim)
 
#define VSMC_STATIC_ASSERT_OPENCL_BACKEND_CL_STATE_CL_FP_TYPE(type)
 
#define VSMC_STATIC_ASSERT_OPENCL_BACKEND_CL_STATE_CL_TYPE(derived, user)
 

Functions

template<typename FPType >
std::string vsmc::internal::cl_source_macros (std::size_t size, std::size_t state_size, std::size_t seed)
 
template<typename >
void vsmc::internal::set_cl_fp_type (std::stringstream &)
 
template<>
void vsmc::internal::set_cl_fp_type< cl_double > (std::stringstream &ss)
 
template<>
void vsmc::internal::set_cl_fp_type< cl_float > (std::stringstream &ss)
 

Macro Definition Documentation

#define VSMC_DEFINE_OPENCL_CONFIGURE_KERNEL
Value:
CLConfigure &configure () {return configure_;} \
const CLConfigure &configure () const {return configure_;} \
::cl::Kernel &kernel () {return kernel_;} \
const ::cl::Kernel &kernel () const {return kernel_;} \
const std::string &kernel_name () const {return kernel_name_;}

Definition at line 136 of file backend_cl.hpp.

#define VSMC_DEFINE_OPENCL_COPY (   Name)
Value:
Name () : build_id_(-1) {} \
Name (const Name<T, PlaceHolder> &) = default; \
Name<T, PlaceHolder> &operator= (const Name<T, PlaceHolder> &) = default; \
virtual ~Name () {}

Definition at line 77 of file backend_cl.hpp.

#define VSMC_DEFINE_OPENCL_MEMBER_DATA
Value:
CLConfigure configure_; \
int build_id_; \
::cl::Kernel kernel_; \
std::string kernel_name_

Definition at line 156 of file backend_cl.hpp.

#define VSMC_DEFINE_OPENCL_MOVE (   Name)
Value:
Name (Name<T, PlaceHolder> &&) = default; \
Name<T, PlaceHolder> &operator= (Name<T, PlaceHolder> &&) = default;

Definition at line 84 of file backend_cl.hpp.

#define VSMC_DEFINE_OPENCL_SET_KERNEL
Value:
if (kname.empty()) { \
kernel_name_.clear(); \
return; \
} \
if (build_id_ != particle.value().build_id() || kernel_name_ != kname) { \
build_id_ = particle.value().build_id(); \
kernel_name_ = kname; \
kernel_ = particle.value().create_kernel(kernel_name_); \
configure_.local_size(particle.size(), \
kernel_, particle.value().manager().device()); \
} \

Definition at line 143 of file backend_cl.hpp.

#define VSMC_RUNTIME_ASSERT_OPENCL_BACKEND_CL_BUILD (   func)
Value:
VSMC_RUNTIME_ASSERT((build()), \
("**StateCL::"#func"** CAN ONLY BE CALLED AFTER true " \
"**StateCL::build**"));
#define VSMC_RUNTIME_ASSERT(cond, msg)
Definition: assert.hpp:64

Definition at line 59 of file backend_cl.hpp.

#define VSMC_RUNTIME_ASSERT_OPENCL_BACKEND_CL_COPY_SIZE_MISMATCH
Value:
VSMC_RUNTIME_ASSERT((N == copy_.size()), \
("**StateCL::copy** SIZE MISMATCH"))
#define VSMC_RUNTIME_ASSERT(cond, msg)
Definition: assert.hpp:64

Definition at line 67 of file backend_cl.hpp.

#define VSMC_RUNTIME_ASSERT_OPENCL_BACKEND_CL_STATE_SIZE (   state_size)    VSMC_RUNTIME_ASSERT((state_size >= 1), ("STATE SIZE IS LESS THAN 1"))

Definition at line 64 of file backend_cl.hpp.

#define VSMC_RUNTIME_ASSERT_OPENCL_BACKEND_CL_UNPACK_SIZE (   psize,
  dim 
)
Value:
VSMC_RUNTIME_ASSERT((psize >= dim), \
("**StateCL::state_unpack** INPUT PACK SIZE TOO SMALL"))
#define VSMC_RUNTIME_ASSERT(cond, msg)
Definition: assert.hpp:64

Definition at line 71 of file backend_cl.hpp.

#define VSMC_STATIC_ASSERT_OPENCL_BACKEND_CL_DYNAMIC_STATE_SIZE_RESIZE (   Dim)
Value:
USE_METHOD_resize_state_WITH_A_FIXED_SIZE_StateCL_OBJECT)
Used to specify a dimension template parameter is dynamic.
Definition: defines.hpp:97
#define VSMC_STATIC_ASSERT(cond, msg)
Definition: assert.hpp:46

Definition at line 46 of file backend_cl.hpp.

#define VSMC_STATIC_ASSERT_OPENCL_BACKEND_CL_STATE_CL_FP_TYPE (   type)
Value:
VSMC_STATIC_ASSERT((cxx11::is_same<type, ::cl_float>::value \
|| cxx11::is_same<type, ::cl_double>::value), \
USE_StateCL_WITH_A_FP_TYPE_OTHER_THAN_cl_float_AND_cl_double)
#define VSMC_STATIC_ASSERT(cond, msg)
Definition: assert.hpp:46

Definition at line 54 of file backend_cl.hpp.

#define VSMC_STATIC_ASSERT_OPENCL_BACKEND_CL_STATE_CL_TYPE (   derived,
  user 
)
Value:
VSMC_STATIC_ASSERT((internal::IsDerivedFromStateCL<derived>::value), \
USE_##user##_WITH_A_STATE_TYPE_NOT_DERIVED_FROM_StateCL)
#define VSMC_STATIC_ASSERT(cond, msg)
Definition: assert.hpp:46

Definition at line 50 of file backend_cl.hpp.