Function opencl3::platform::platform::get_platform_info[][src]

pub fn get_platform_info(
    platform: *mut c_void,
    param_name: u32
) -> Result<InfoType, i32>
Expand description

Get specific information about an OpenCL platform. Calls clGetPlatformInfo to get the desired information about the platform.

Examples

use cl3::platform::{get_platform_ids, get_platform_info, CL_PLATFORM_NAME, CL_PLATFORM_VERSION};

let platform_ids = get_platform_ids().unwrap();
assert!(0 < platform_ids.len());

// Choose a the first platform
let platform_id = platform_ids[0];

let value = get_platform_info(platform_id, CL_PLATFORM_NAME).unwrap();
let value: String = value.into();
println!("CL_PLATFORM_NAME: {}", value);
assert!(!value.is_empty());

let value = get_platform_info(platform_id, CL_PLATFORM_VERSION).unwrap();
let value = String::from(value);
println!("CL_PLATFORM_VERSION: {}", value);
assert!(!value.is_empty());
  • platform - the cl_platform_id of the OpenCL platform.
  • param_name - the type of platform information being queried, see Platform Queries.

returns a Result containing the desired information in an InfoType enum or the error code from the OpenCL C API function.