boost::compute::platform — A compute platform.
// In header: <boost/compute/platform.hpp> class platform { public: // construct/copy/destruct explicit platform(cl_platform_id); platform(const platform &); platform & operator=(const platform &); ~platform(); // public member functions cl_platform_id id() const; std::string name() const; std::string vendor() const; std::string profile() const; std::string version() const; std::vector< std::string > extensions() const; bool supports_extension(const std::string &) const; std::vector< device > devices(cl_device_type = CL_DEVICE_TYPE_ALL) const; size_t device_count(cl_device_type = CL_DEVICE_TYPE_ALL) const; template<typename T> T get_info(cl_platform_info) const; template<int Enum> unspecified get_info() const; void * get_extension_function_address(const char *) const; void unload_compiler(); bool operator==(const platform &) const; bool operator!=(const platform &) const; };
The platform class provides an interface to an OpenCL platform.
To obtain a list of all platforms on the system use the system::platforms() method.
See Also:
platform
public member functionscl_platform_id id() const;Returns the ID of the platform.
std::string name() const;Returns the name of the platform.
std::string vendor() const;Returns the name of the vendor for the platform.
std::string profile() const;Returns the profile string for the platform.
std::string version() const;Returns the version string for the platform.
std::vector< std::string > extensions() const;Returns a list of extensions supported by the platform.
bool supports_extension(const std::string & name) const;
Returns true
if the platform supports the extension with name
.
std::vector< device > devices(cl_device_type type = CL_DEVICE_TYPE_ALL) const;Returns a list of devices on the platform.
size_t device_count(cl_device_type type = CL_DEVICE_TYPE_ALL) const;Returns the number of devices on the platform.
template<typename T> T get_info(cl_platform_info info) const;
Returns information about the platform.
See the documentation for clGetPlatformInfo() for more information.
template<int Enum> unspecified get_info() const;
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void * get_extension_function_address(const char * function_name) const;
Returns the address of the function_name
extension function. Returns 0
if function_name
is invalid.
void unload_compiler();Requests that the platform unload any compiler resources.
bool operator==(const platform & other) const;Returns
true
if the platform is the same at other
. bool operator!=(const platform & other) const;Returns
true
if the platform is different from other
.