OpenCL C++ Bindings
|
Program interface that implements cl_program. More...
#include <opencl.hpp>
Public Types | |
typedef vector< vector< unsigned char > > | Binaries |
typedef vector< string > | Sources |
![]() | |
typedef cl_program | cl_type |
Public Member Functions | |
Program (const string &source, bool build=false, cl_int *err=nullptr) | |
Program (const Context &context, const string &source, bool build=false, cl_int *err=nullptr) | |
Program (const Sources &sources, cl_int *err=nullptr) | |
Program (const Context &context, const Sources &sources, cl_int *err=nullptr) | |
Program (const vector< char > &IL, bool build=false, cl_int *err=nullptr) | |
Program (const Context &context, const vector< char > &IL, bool build=false, cl_int *err=nullptr) | |
Program (const Context &context, const vector< Device > &devices, const Binaries &binaries, vector< cl_int > *binaryStatus=nullptr, cl_int *err=nullptr) | |
Program (const Context &context, const vector< Device > &devices, const string &kernelNames, cl_int *err=nullptr) | |
Program (const cl_program &program, bool retainObject=false) | |
Constructor from cl_program - takes ownership. | |
Program & | operator= (const cl_program &rhs) |
cl_int | build (const vector< Device > &devices, const string &options, void(CL_CALLBACK *notifyFptr)(cl_program, void *)=nullptr, void *data=nullptr) const |
cl_int | build (const vector< Device > &devices, const char *options=nullptr, void(CL_CALLBACK *notifyFptr)(cl_program, void *)=nullptr, void *data=nullptr) const |
cl_int | build (const Device &device, const string &options, void(CL_CALLBACK *notifyFptr)(cl_program, void *)=nullptr, void *data=nullptr) const |
cl_int | build (const Device &device, const char *options=nullptr, void(CL_CALLBACK *notifyFptr)(cl_program, void *)=nullptr, void *data=nullptr) const |
cl_int | build (const string &options, void(CL_CALLBACK *notifyFptr)(cl_program, void *)=nullptr, void *data=nullptr) const |
cl_int | build (const char *options=nullptr, void(CL_CALLBACK *notifyFptr)(cl_program, void *)=nullptr, void *data=nullptr) const |
cl_int | compile (const string &options, void(CL_CALLBACK *notifyFptr)(cl_program, void *)=nullptr, void *data=nullptr) const |
cl_int | compile (const char *options=nullptr, void(CL_CALLBACK *notifyFptr)(cl_program, void *)=nullptr, void *data=nullptr) const |
cl_int | compile (const string &options, const vector< Program > &inputHeaders, const vector< string > &headerIncludeNames, void(CL_CALLBACK *notifyFptr)(cl_program, void *)=nullptr, void *data=nullptr) const |
cl_int | compile (const char *options, const vector< Program > &inputHeaders, const vector< string > &headerIncludeNames, void(CL_CALLBACK *notifyFptr)(cl_program, void *)=nullptr, void *data=nullptr) const |
cl_int | compile (const string &options, const vector< Device > &deviceList, const vector< Program > &inputHeaders=vector< Program >(), const vector< string > &headerIncludeNames=vector< string >(), void(CL_CALLBACK *notifyFptr)(cl_program, void *)=nullptr, void *data=nullptr) const |
cl_int | compile (const char *options, const vector< Device > &deviceList, const vector< Program > &inputHeaders=vector< Program >(), const vector< string > &headerIncludeNames=vector< string >(), void(CL_CALLBACK *notifyFptr)(cl_program, void *)=nullptr, void *data=nullptr) const |
template<typename T > | |
cl_int | getInfo (cl_program_info name, T *param) const |
template<cl_program_info name> | |
detail::param_traits< detail::cl_program_info, name >::param_type | getInfo (cl_int *err=nullptr) const |
template<typename T > | |
cl_int | getBuildInfo (const Device &device, cl_program_build_info name, T *param) const |
template<cl_program_build_info name> | |
detail::param_traits< detail::cl_program_build_info, name >::param_type | getBuildInfo (const Device &device, cl_int *err=nullptr) const |
template<cl_program_build_info name> | |
vector< std::pair< cl::Device, typename detail::param_traits< detail::cl_program_build_info, name >::param_type > > | getBuildInfo (cl_int *err=nullptr) const |
cl_int | createKernels (vector< Kernel > *kernels) |
CL_API_PREFIX__VERSION_2_2_DEPRECATED cl_int | setReleaseCallback (void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data), void *user_data=nullptr) CL_API_SUFFIX__VERSION_2_2_DEPRECATED |
Registers a callback function to be called when destructors for program scope global variables are complete and before the program is released. | |
template<typename T > | |
std::enable_if<!std::is_pointer< T >::value, cl_int >::type | setSpecializationConstant (cl_uint index, const T &value) |
Sets a SPIR-V specialization constant. | |
cl_int | setSpecializationConstant (cl_uint index, size_type size, const void *value) |
Sets a SPIR-V specialization constant. | |
template<> | |
cl_int | getInfo (cl_program_info name, vector< vector< unsigned char > > *param) const |
template<> | |
vector< vector< unsigned char > > | getInfo (cl_int *err) const |
template<> | |
cl_int | setSpecializationConstant (cl_uint index, const bool &value) |
![]() | |
Wrapper (const cl_type &obj, bool retainObject) | |
Wrapper (const Wrapper< cl_type > &rhs) | |
Wrapper (Wrapper< cl_type > &&rhs) noexcept | |
Wrapper< cl_type > & | operator= (const Wrapper< cl_type > &rhs) |
Wrapper< cl_type > & | operator= (Wrapper< cl_type > &&rhs) |
Wrapper< cl_type > & | operator= (const cl_type &rhs) |
const cl_type & | operator() () const |
cl_type & | operator() () |
cl_type | get () const |
Additional Inherited Members | |
![]() | |
cl_int | retain () const |
cl_int | release () const |
![]() | |
cl_type | object_ |
Program interface that implements cl_program.
Definition at line 6565 of file opencl.hpp.
typedef vector<vector<unsigned char> > cl::Program::Binaries |
Definition at line 6569 of file opencl.hpp.
typedef vector<string> cl::Program::Sources |
Definition at line 6570 of file opencl.hpp.
|
inline |
Definition at line 6576 of file opencl.hpp.
|
inline |
Definition at line 6615 of file opencl.hpp.
|
inline |
Create a program from a vector of source strings and the default context. Does not compile or link the program.
Definition at line 6656 of file opencl.hpp.
|
inline |
Create a program from a vector of source strings and a provided context. Does not compile or link the program.
Definition at line 6691 of file opencl.hpp.
|
inline |
Program constructor to allow construction of program from SPIR-V or another IL.
Requires OpenCL 2.1 or newer or the cl_khr_il_program extension.
Definition at line 6728 of file opencl.hpp.
|
inline |
Program constructor to allow construction of program from SPIR-V or another IL for a specific context.
Requires OpenCL 2.1 or newer or the cl_khr_il_program extension.
Definition at line 6783 of file opencl.hpp.
|
inline |
Construct a program object from a list of devices and a per-device list of binaries.
context | A valid OpenCL context in which to construct the program. |
devices | A vector of OpenCL device objects for which the program will be created. |
binaries | A vector of pairs of a pointer to a binary object and its length. |
binaryStatus | An optional vector that on completion will be resized to match the size of binaries and filled with values to specify if each binary was successfully loaded. Set to CL_SUCCESS if the binary was successfully loaded. Set to CL_INVALID_VALUE if the length is 0 or the binary pointer is nullptr. Set to CL_INVALID_BINARY if the binary provided is not valid for the matching device. |
err | if non-nullptr will be set to CL_SUCCESS on successful operation or one of the following errors: CL_INVALID_CONTEXT if context is not a valid context. CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; or if any entry in binaries is nullptr or has length 0. CL_INVALID_DEVICE if OpenCL devices listed in devices are not in the list of devices associated with context. CL_INVALID_BINARY if an invalid program binary was encountered for any device. binaryStatus will return specific status for each device. CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host. |
Definition at line 6850 of file opencl.hpp.
|
inline |
Create program using builtin kernels.
kernelNames | Semi-colon separated list of builtin kernel names |
Definition at line 6913 of file opencl.hpp.
|
inline |
Definition at line 6942 of file opencl.hpp.
|
inlineexplicit |
Constructor from cl_program - takes ownership.
retainObject | will cause the constructor to retain its cl object. Defaults to false to maintain compatibility with earlier versions. |
Definition at line 6951 of file opencl.hpp.
|
inline |
Definition at line 7032 of file opencl.hpp.
|
inline |
Definition at line 7003 of file opencl.hpp.
|
inline |
Definition at line 6994 of file opencl.hpp.
|
inline |
Definition at line 7024 of file opencl.hpp.
|
inline |
Definition at line 6969 of file opencl.hpp.
|
inline |
Definition at line 6960 of file opencl.hpp.
|
inline |
Definition at line 7122 of file opencl.hpp.
|
inline |
Definition at line 7085 of file opencl.hpp.
|
inline |
Definition at line 7057 of file opencl.hpp.
|
inline |
Definition at line 7111 of file opencl.hpp.
|
inline |
Definition at line 7075 of file opencl.hpp.
|
inline |
Definition at line 7049 of file opencl.hpp.
|
inline |
Definition at line 7242 of file opencl.hpp.
|
inline |
Build info function that returns a vector of device/info pairs for the specified info type and for all devices in the program. On an error reading the info for any device, an empty vector of info will be returned.
Definition at line 7205 of file opencl.hpp.
|
inline |
Definition at line 7187 of file opencl.hpp.
|
inline |
Definition at line 7176 of file opencl.hpp.
|
inline |
Definition at line 7430 of file opencl.hpp.
|
inline |
Definition at line 7164 of file opencl.hpp.
|
inline |
Definition at line 7155 of file opencl.hpp.
|
inline |
Definition at line 7430 of file opencl.hpp.
|
inline |
Definition at line 6954 of file opencl.hpp.
|
inline |
Registers a callback function to be called when destructors for program scope global variables are complete and before the program is released.
Wraps clSetProgramReleaseCallback().
Each call to this function registers the specified user callback function on a callback stack associated with program. The registered user callback functions are called in the reverse order in which they were registered.
Definition at line 7284 of file opencl.hpp.
|
inline |
Definition at line 7471 of file opencl.hpp.
|
inline |
Sets a SPIR-V specialization constant.
Wraps clSetProgramSpecializationConstant().
Definition at line 7303 of file opencl.hpp.
|
inline |
Sets a SPIR-V specialization constant.
Wraps clSetProgramSpecializationConstant().
Definition at line 7318 of file opencl.hpp.