pub struct Platform { /* private fields */ }Expand description
An OpenCL platform id and methods to query it.
The query methods calls clGetPlatformInfo with the relevant param_name, see: Platform Queries.
Implementations§
Source§impl Platform
impl Platform
pub fn new(id: *mut c_void) -> Platform
Sourcepub fn get_devices(&self, device_type: u64) -> Result<Vec<*mut c_void>, ClError>
pub fn get_devices(&self, device_type: u64) -> Result<Vec<*mut c_void>, ClError>
Get the ids of available devices of the given type on the Platform.
§Examples
use opencl3::platform::get_platforms;
use cl3::device::CL_DEVICE_TYPE_GPU;
let platforms = get_platforms().unwrap();
assert!(0 < platforms.len());
// Choose a the first platform
let platform = &platforms[0];
let device_ids = platform.get_devices(CL_DEVICE_TYPE_GPU).unwrap();
println!("CL_DEVICE_TYPE_GPU count: {}", device_ids.len());
assert!(0 < device_ids.len());pub unsafe fn get_device_ids_from_dx9_intel( &self, dx9_device_source: u32, dx9_object: *mut c_void, dx9_device_set: u32, ) -> Result<Vec<*mut c_void>, ClError>
Sourcepub fn profile(&self) -> Result<String, ClError>
pub fn profile(&self) -> Result<String, ClError>
The OpenCL profile supported by the Platform, it can be FULL_PROFILE or EMBEDDED_PROFILE.
Sourcepub fn version(&self) -> Result<String, ClError>
pub fn version(&self) -> Result<String, ClError>
The OpenCL profile version supported by the Platform, e.g. OpenCL 1.2, OpenCL 2.0, OpenCL 2.1, etc.
Sourcepub fn extensions(&self) -> Result<String, ClError>
pub fn extensions(&self) -> Result<String, ClError>
A space separated list of extension names supported by the Platform.
Sourcepub fn host_timer_resolution(&self) -> Result<u64, ClError>
pub fn host_timer_resolution(&self) -> Result<u64, ClError>
The resolution of the host timer in nanoseconds as used by
clGetDeviceAndHostTimer.
CL_VERSION_2_1
Sourcepub fn numeric_version(&self) -> Result<u32, ClError>
pub fn numeric_version(&self) -> Result<u32, ClError>
The detailed (major, minor, patch) version supported by the platform.
CL_VERSION_3_0
Sourcepub fn extensions_with_version(&self) -> Result<Vec<cl_name_version>, ClError>
pub fn extensions_with_version(&self) -> Result<Vec<cl_name_version>, ClError>
An array of description (name and version) structures that lists all the
extensions supported by the platform.
CL_VERSION_3_0
Sourcepub fn platform_external_memory_import_handle_types_khr(
&self,
) -> Result<Vec<cl_name_version>, ClError>
pub fn platform_external_memory_import_handle_types_khr( &self, ) -> Result<Vec<cl_name_version>, ClError>
cl_khr_external_memory
Sourcepub fn platform_semaphore_import_handle_types_khr(
&self,
) -> Result<Vec<cl_name_version>, ClError>
pub fn platform_semaphore_import_handle_types_khr( &self, ) -> Result<Vec<cl_name_version>, ClError>
cl_khr_external_semaphore
Sourcepub fn platform_semaphore_export_handle_types_khr(
&self,
) -> Result<Vec<cl_name_version>, ClError>
pub fn platform_semaphore_export_handle_types_khr( &self, ) -> Result<Vec<cl_name_version>, ClError>
cl_khr_external_semaphore
Sourcepub fn platform_semaphore_types_khr(
&self,
) -> Result<Vec<cl_name_version>, ClError>
pub fn platform_semaphore_types_khr( &self, ) -> Result<Vec<cl_name_version>, ClError>
cl_khr_semaphore