vSMC
vSMC: Scalable Monte Carlo
Static Public Member Functions | List of all members
vsmc::CLQuery Class Reference

Query OpenCL information. More...

#include <vsmc/opencl/cl_query.hpp>

Static Public Member Functions

template<::cl_device_type DevType>
static bool has_device (const ::cl::Platform &plat)
 Check if a device type exists in a platform. More...
 
template<::cl_device_type DevType>
static bool has_device ()
 Check if a device type exists in any platform. More...
 
template<OpenCLDeviceFeature feat>
static bool has_feature (const ::cl::Device &dev)
 Check if a device feature exists. More...
 
template<typename CharT , typename Traits >
static std::basic_ostream< CharT, Traits > & info (std::basic_ostream< CharT, Traits > &os)
 Query all information. More...
 
template<typename CharT , typename Traits >
static std::basic_ostream< CharT, Traits > & info (std::basic_ostream< CharT, Traits > &os, const ::cl::Platform &plat)
 Query platform information. More...
 
template<typename CharT , typename Traits >
static std::basic_ostream< CharT, Traits > & info (std::basic_ostream< CharT, Traits > &os, const ::cl::Device &dev)
 Query device information. More...
 
template<typename CharT , typename Traits >
static std::basic_ostream< CharT, Traits > & info (std::basic_ostream< CharT, Traits > &os, const ::cl::Context &ctx)
 Query context information. More...
 
template<typename CharT , typename Traits >
static std::basic_ostream< CharT, Traits > & info (std::basic_ostream< CharT, Traits > &os, const ::cl::Program &prog)
 Query program informaiton. More...
 
template<typename CharT , typename Traits >
static std::basic_ostream< CharT, Traits > & info (std::basic_ostream< CharT, Traits > &os, const ::cl::Kernel &kern)
 Query kernel information. More...
 
template<typename CharT , typename Traits >
static std::basic_ostream< CharT, Traits > & info (std::basic_ostream< CharT, Traits > &os, const ::cl::Program &prog, const std::string &kname)
 Query kernel information given a program the name of kernel and a program. More...
 
static int opencl_c_version (const ::cl::Device &dev)
 Return the OpenCL C version of a device. More...
 
static int opencl_version (const ::cl::Device &dev)
 Return the OpenCL version of a device. More...
 
static std::vector< std::string > program_binary (const ::cl::Program &program)
 Program binary vector. More...
 
static std::vector< std::pair< ::cl_build_status, std::string > > program_build_log (const ::cl::Program &program)
 Program build log and status. More...
 
template<typename CharT , typename Traits >
static std::vector< std::pair< ::cl_build_status, std::string > > program_build_log (const ::cl::Program &program, std::basic_ostream< CharT, Traits > &os)
 Print program build log and status. More...
 
static std::vector< ::cl::Device > program_device (const ::cl::Program program)
 Program device vector. More...
 
static std::string program_source (const ::cl::Program &program)
 Program source. More...
 

Detailed Description

Query OpenCL information.

Definition at line 50 of file cl_query.hpp.

Member Function Documentation

template<::cl_device_type DevType>
static bool vsmc::CLQuery::has_device ( const ::cl::Platform &  plat)
inlinestatic

Check if a device type exists in a platform.

Definition at line 95 of file cl_query.hpp.

template<::cl_device_type DevType>
static bool vsmc::CLQuery::has_device ( )
inlinestatic

Check if a device type exists in any platform.

Definition at line 111 of file cl_query.hpp.

template<OpenCLDeviceFeature feat>
static bool vsmc::CLQuery::has_feature ( const ::cl::Device &  dev)
inlinestatic

Check if a device feature exists.

Definition at line 87 of file cl_query.hpp.

template<typename CharT , typename Traits >
static std::basic_ostream<CharT, Traits>& vsmc::CLQuery::info ( std::basic_ostream< CharT, Traits > &  os)
inlinestatic

Query all information.

Definition at line 213 of file cl_query.hpp.

template<typename CharT , typename Traits >
static std::basic_ostream<CharT, Traits>& vsmc::CLQuery::info ( std::basic_ostream< CharT, Traits > &  os,
const ::cl::Platform &  plat 
)
inlinestatic

Query platform information.

Definition at line 230 of file cl_query.hpp.

template<typename CharT , typename Traits >
static std::basic_ostream<CharT, Traits>& vsmc::CLQuery::info ( std::basic_ostream< CharT, Traits > &  os,
const ::cl::Device &  dev 
)
inlinestatic

Query device information.

Definition at line 258 of file cl_query.hpp.

template<typename CharT , typename Traits >
static std::basic_ostream<CharT, Traits>& vsmc::CLQuery::info ( std::basic_ostream< CharT, Traits > &  os,
const ::cl::Context &  ctx 
)
inlinestatic

Query context information.

Definition at line 294 of file cl_query.hpp.

template<typename CharT , typename Traits >
static std::basic_ostream<CharT, Traits>& vsmc::CLQuery::info ( std::basic_ostream< CharT, Traits > &  os,
const ::cl::Program &  prog 
)
inlinestatic

Query program informaiton.

Definition at line 310 of file cl_query.hpp.

template<typename CharT , typename Traits >
static std::basic_ostream<CharT, Traits>& vsmc::CLQuery::info ( std::basic_ostream< CharT, Traits > &  os,
const ::cl::Kernel &  kern 
)
inlinestatic

Query kernel information.

Definition at line 326 of file cl_query.hpp.

template<typename CharT , typename Traits >
static std::basic_ostream<CharT, Traits>& vsmc::CLQuery::info ( std::basic_ostream< CharT, Traits > &  os,
const ::cl::Program &  prog,
const std::string &  kname 
)
inlinestatic

Query kernel information given a program the name of kernel and a program.

Definition at line 366 of file cl_query.hpp.

static int vsmc::CLQuery::opencl_c_version ( const ::cl::Device &  dev)
inlinestatic

Return the OpenCL C version of a device.

See also
opencl_version

Definition at line 77 of file cl_query.hpp.

static int vsmc::CLQuery::opencl_version ( const ::cl::Device &  dev)
inlinestatic

Return the OpenCL version of a device.

Returns
The integer values and the OpenCL versions are mapped as the following,
  • OpenCL 1.0: 100
  • OpenCL 1.1: 110
  • OpenCL 1.2: 120
  • OpenCL 2.0: 200
Note
If the version information returned by CL_DEVICE_VERSION does not follow the specification, then this function will return 100 (OpenCL 1.0) to play safe..

Definition at line 66 of file cl_query.hpp.

static std::vector<std::string> vsmc::CLQuery::program_binary ( const ::cl::Program &  program)
inlinestatic

Program binary vector.

Definition at line 123 of file cl_query.hpp.

static std::vector<std::pair< ::cl_build_status, std::string> > vsmc::CLQuery::program_build_log ( const ::cl::Program &  program)
inlinestatic

Program build log and status.

Definition at line 171 of file cl_query.hpp.

template<typename CharT , typename Traits >
static std::vector<std::pair< ::cl_build_status, std::string> > vsmc::CLQuery::program_build_log ( const ::cl::Program &  program,
std::basic_ostream< CharT, Traits > &  os 
)
inlinestatic

Print program build log and status.

Definition at line 189 of file cl_query.hpp.

static std::vector< ::cl::Device> vsmc::CLQuery::program_device ( const ::cl::Program  program)
inlinestatic

Program device vector.

Definition at line 148 of file cl_query.hpp.

static std::string vsmc::CLQuery::program_source ( const ::cl::Program &  program)
inlinestatic

Program source.

Definition at line 161 of file cl_query.hpp.