[][src]Struct opencl3::platform::Platform

pub struct Platform { /* fields omitted */ }

An OpenCL platform id and methods to query it.
The query methods calls clGetPlatformInfo with the relevant param_name, see: Platform Queries.

Implementations

impl Platform[src]

pub fn new(id: cl_platform_id) -> Platform[src]

pub fn id(&self) -> cl_platform_id[src]

Accessor for the underlying platform id.

pub fn get_devices(
    &self,
    device_type: cl_device_type
) -> Result<Vec<cl_device_id>, cl_int>
[src]

Get the list of available devices of the given type on the Platform.

Examples

use opencl3::platform::get_platforms;
use opencl3::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 fn profile(&self) -> Result<CString, cl_int>[src]

The OpenCL profile supported by the Platform, it can be FULL_PROFILE or EMBEDDED_PROFILE.

pub fn version(&self) -> Result<CString, cl_int>[src]

The OpenCL profile version supported by the Platform, e.g. OpenCL 1.2, OpenCL 2.0, OpenCL 2.1, etc.

pub fn name(&self) -> Result<CString, cl_int>[src]

The OpenCL Platform name string.

pub fn vendor(&self) -> Result<CString, cl_int>[src]

The OpenCL Platform vendor string.

pub fn extensions(&self) -> Result<CString, cl_int>[src]

A space separated list of extension names supported by the Platform.

pub fn host_timer_resolution(&self) -> Result<cl_ulong, cl_int>[src]

The resolution of the host timer in nanoseconds as used by clGetDeviceAndHostTimer.

pub fn numeric_version(&self) -> Result<cl_version, cl_int>[src]

The detailed (major, minor, patch) version supported by the platform.

pub fn extensions_with_version(&self) -> Result<Vec<cl_name_version>, cl_int>[src]

An array of description (name and version) structures that lists all the extensions supported by the platform.

pub fn unload_compiler(&self) -> Result<(), cl_int>[src]

Unload an OpenCL compiler for a platform.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.