Struct opencl3::device::Device

source ·
pub struct Device { /* private fields */ }
Expand description

An OpenCL device id and methods to query it.
The query methods calls clGetDeviceInfo with the relevant param_name, see: Device Queries.

Implementations§

source§

impl Device

source

pub fn new(id: cl_device_id) -> Device

source

pub fn id(&self) -> cl_device_id

Accessor for the underlying device id.

source

pub fn create_sub_devices( &self, properties: &[cl_device_partition_property] ) -> Result<Vec<SubDevice>>

Create sub-devices by partitioning an OpenCL device.

returns a Result containing a vector of available SubDevices or the error code from the OpenCL C API function.

source

pub fn dev_type(&self) -> Result<cl_device_type>

The OpenCL device type, see Device Types.

source

pub fn vendor_id(&self) -> Result<cl_uint>

A unique device vendor identifier: a PCI vendor ID or a Khronos vendor ID if the vendor does not have a PCI vendor ID.

source

pub fn max_compute_units(&self) -> Result<cl_uint>

The number of parallel compute units on the device, minimum 1.

source

pub fn max_work_item_dimensions(&self) -> Result<cl_uint>

Maximum dimensions for global and local work-item IDs, minimum 3 if device is not CL_DEVICE_TYPE_CUSTOM.

source

pub fn max_work_group_size(&self) -> Result<size_t>

Maximum number of work-items for each dimension of a work-group, minimum [1, 1, 1] if device is not CL_DEVICE_TYPE_CUSTOM.

source

pub fn max_work_item_sizes(&self) -> Result<Vec<size_t>>

source

pub fn max_preferred_vector_width_char(&self) -> Result<cl_uint>

source

pub fn max_preferred_vector_width_short(&self) -> Result<cl_uint>

source

pub fn max_preferred_vector_width_int(&self) -> Result<cl_uint>

source

pub fn max_preferred_vector_width_long(&self) -> Result<cl_uint>

source

pub fn max_preferred_vector_width_float(&self) -> Result<cl_uint>

source

pub fn max_preferred_vector_width_double(&self) -> Result<cl_uint>

source

pub fn max_clock_frequency(&self) -> Result<cl_uint>

source

pub fn address_bits(&self) -> Result<cl_uint>

source

pub fn max_read_image_args(&self) -> Result<cl_uint>

source

pub fn max_write_image_args(&self) -> Result<cl_uint>

source

pub fn max_mem_alloc_size(&self) -> Result<cl_ulong>

source

pub fn image2d_max_width(&self) -> Result<size_t>

source

pub fn image2d_max_height(&self) -> Result<size_t>

source

pub fn image3d_max_width(&self) -> Result<size_t>

source

pub fn image3d_max_height(&self) -> Result<size_t>

source

pub fn image3d_max_depth(&self) -> Result<size_t>

source

pub fn image_support(&self) -> Result<bool>

source

pub fn max_parameter_size(&self) -> Result<size_t>

source

pub fn max_device_samples(&self) -> Result<cl_uint>

source

pub fn mem_base_addr_align(&self) -> Result<cl_uint>

source

pub fn min_data_type_align_size(&self) -> Result<cl_uint>

source

pub fn single_fp_config(&self) -> Result<cl_ulong>

source

pub fn global_mem_cache_type(&self) -> Result<cl_uint>

source

pub fn global_mem_cacheline_size(&self) -> Result<cl_uint>

source

pub fn global_mem_cache_size(&self) -> Result<cl_ulong>

source

pub fn global_mem_size(&self) -> Result<cl_ulong>

source

pub fn max_constant_buffer_size(&self) -> Result<cl_ulong>

source

pub fn max_constant_args(&self) -> Result<cl_uint>

source

pub fn local_mem_type(&self) -> Result<cl_uint>

source

pub fn local_mem_size(&self) -> Result<cl_ulong>

source

pub fn error_correction_support(&self) -> Result<bool>

source

pub fn profiling_timer_resolution(&self) -> Result<size_t>

source

pub fn endian_little(&self) -> Result<bool>

source

pub fn available(&self) -> Result<bool>

source

pub fn compiler_available(&self) -> Result<bool>

source

pub fn execution_capabilities(&self) -> Result<cl_ulong>

source

pub fn queue_on_host_properties(&self) -> Result<cl_ulong>

source

pub fn name(&self) -> Result<String>

source

pub fn vendor(&self) -> Result<String>

source

pub fn driver_version(&self) -> Result<String>

source

pub fn profile(&self) -> Result<String>

source

pub fn version(&self) -> Result<String>

source

pub fn extensions(&self) -> Result<String>

source

pub fn platform(&self) -> Result<cl_platform_id>

source

pub fn double_fp_config(&self) -> Result<cl_ulong>

CL_VERSION_1_2

source

pub fn half_fp_config(&self) -> Result<cl_ulong>

source

pub fn preferred_vector_width_half(&self) -> Result<cl_uint>

source

pub fn host_unified_memory(&self) -> Result<bool>

source

pub fn native_vector_width_char(&self) -> Result<cl_uint>

source

pub fn native_vector_width_short(&self) -> Result<cl_uint>

source

pub fn native_vector_width_int(&self) -> Result<cl_uint>

source

pub fn native_vector_width_long(&self) -> Result<cl_uint>

source

pub fn native_vector_width_float(&self) -> Result<cl_uint>

source

pub fn native_vector_width_double(&self) -> Result<cl_uint>

source

pub fn native_vector_width_half(&self) -> Result<cl_uint>

source

pub fn opencl_c_version(&self) -> Result<String>

source

pub fn linker_available(&self) -> Result<bool>

CL_VERSION_1_2

source

pub fn built_in_kernels(&self) -> Result<String>

CL_VERSION_1_2

source

pub fn image_max_buffer_size(&self) -> Result<size_t>

CL_VERSION_1_2

source

pub fn image_max_array_size(&self) -> Result<size_t>

CL_VERSION_1_2

source

pub fn parent_device(&self) -> Result<cl_device_id>

CL_VERSION_1_2

source

pub fn partition_max_sub_devices(&self) -> Result<cl_uint>

CL_VERSION_1_2

source

pub fn partition_properties(&self) -> Result<Vec<intptr_t>>

CL_VERSION_1_2

source

pub fn partition_affinity_domain(&self) -> Result<Vec<cl_ulong>>

CL_VERSION_1_2

source

pub fn partition_type(&self) -> Result<Vec<intptr_t>>

CL_VERSION_1_2

source

pub fn reference_count(&self) -> Result<cl_uint>

CL_VERSION_1_2

source

pub fn preferred_interop_user_sync(&self) -> Result<bool>

CL_VERSION_1_2

source

pub fn printf_buffer_size(&self) -> Result<size_t>

CL_VERSION_1_2

source

pub fn image_pitch_alignment(&self) -> Result<cl_uint>

CL_VERSION_2_0

source

pub fn image_base_address_alignment(&self) -> Result<cl_uint>

CL_VERSION_2_0

source

pub fn max_read_write_image_args(&self) -> Result<cl_uint>

CL_VERSION_2_0

source

pub fn max_global_variable_size(&self) -> Result<size_t>

CL_VERSION_2_0

source

pub fn queue_on_device_properties(&self) -> Result<Vec<intptr_t>>

CL_VERSION_2_0

source

pub fn queue_on_device_preferred_size(&self) -> Result<size_t>

CL_VERSION_2_0

source

pub fn queue_on_device_max_size(&self) -> Result<size_t>

CL_VERSION_2_0

source

pub fn max_on_device_queues(&self) -> Result<cl_uint>

CL_VERSION_2_0

source

pub fn max_on_device_events(&self) -> Result<cl_uint>

CL_VERSION_2_0

source

pub fn svm_capabilities(&self) -> Result<cl_device_svm_capabilities>

CL_VERSION_2_0

source

pub fn global_variable_preferred_total_size(&self) -> Result<size_t>

CL_VERSION_2_0

source

pub fn max_pipe_args(&self) -> Result<cl_uint>

CL_VERSION_2_0

source

pub fn pipe_max_active_reservations(&self) -> Result<cl_uint>

CL_VERSION_2_0

source

pub fn pipe_max_packet_size(&self) -> Result<cl_uint>

CL_VERSION_2_0

source

pub fn preferred_platform_atomic_alignment(&self) -> Result<cl_uint>

CL_VERSION_2_0

source

pub fn preferred_global_atomic_alignment(&self) -> Result<cl_uint>

CL_VERSION_2_0

source

pub fn preferred_local_atomic_alignment(&self) -> Result<cl_uint>

CL_VERSION_2_0

source

pub fn il_version(&self) -> Result<String>

CL_VERSION_2_1

source

pub fn max_num_sub_groups(&self) -> Result<cl_uint>

CL_VERSION_2_1

source

pub fn sub_group_independent_forward_progress(&self) -> Result<bool>

CL_VERSION_2_1

source

pub fn numeric_version(&self) -> Result<cl_uint>

CL_VERSION_3_0

source

pub fn extensions_with_version(&self) -> Result<Vec<cl_name_version>>

CL_VERSION_3_0

source

pub fn ils_with_version(&self) -> Result<Vec<cl_name_version>>

CL_VERSION_3_0

source

pub fn built_in_kernels_with_version(&self) -> Result<Vec<cl_name_version>>

CL_VERSION_3_0

source

pub fn atomic_memory_capabilities(&self) -> Result<cl_ulong>

CL_VERSION_3_0

source

pub fn atomic_fence_capabilities(&self) -> Result<cl_ulong>

CL_VERSION_3_0

source

pub fn non_uniform_work_group_support(&self) -> Result<bool>

CL_VERSION_3_0

source

pub fn opencl_c_all_versions(&self) -> Result<Vec<cl_name_version>>

CL_VERSION_3_0

source

pub fn preferred_work_group_size_multiple(&self) -> Result<size_t>

CL_VERSION_3_0

source

pub fn work_group_collective_functions_support(&self) -> Result<bool>

CL_VERSION_3_0

source

pub fn generic_address_space_support(&self) -> Result<bool>

CL_VERSION_3_0

source

pub fn uuid_khr(&self) -> Result<[u8; 16]>

CL_VERSION_3_0

source

pub fn driver_uuid_khr(&self) -> Result<[u8; 16]>

CL_VERSION_3_0

source

pub fn luid_valid_khr(&self) -> Result<bool>

CL_VERSION_3_0

source

pub fn luid_khr(&self) -> Result<[u8; 8]>

CL_VERSION_3_0

source

pub fn node_mask_khr(&self) -> Result<cl_uint>

CL_VERSION_3_0

source

pub fn opencl_c_features(&self) -> Result<Vec<cl_name_version>>

CL_VERSION_3_0

source

pub fn device_enqueue_capabilities(&self) -> Result<cl_ulong>

CL_VERSION_3_0

source

pub fn pipe_support(&self) -> Result<bool>

CL_VERSION_3_0

source

pub fn latest_conformance_version_passed(&self) -> Result<String>

CL_VERSION_3_0

source

pub fn integer_dot_product_capabilities_khr(&self) -> Result<cl_ulong>

source

pub fn integer_dot_product_acceleration_properties_8bit_khr( &self ) -> Result<cl_device_integer_dot_product_acceleration_properties_khr>

source

pub fn integer_dot_product_acceleration_properties_4x8bit_packed_khr( &self ) -> Result<cl_device_integer_dot_product_acceleration_properties_khr>

source

pub fn compute_capability_major_nv(&self) -> Result<cl_uint>

source

pub fn compute_capability_minor_nv(&self) -> Result<cl_uint>

source

pub fn registers_per_block_nv(&self) -> Result<cl_uint>

source

pub fn wrap_size_nv(&self) -> Result<cl_uint>

source

pub fn gpu_overlap_nv(&self) -> Result<cl_uint>

source

pub fn compute_kernel_exec_timeout_nv(&self) -> Result<cl_uint>

source

pub fn integrated_memory_nv(&self) -> Result<cl_uint>

source

pub fn pci_bus_id_nv(&self) -> Result<cl_uint>

source

pub fn pci_slot_id_nv(&self) -> Result<cl_uint>

source

pub fn profiling_timer_offset_amd(&self) -> Result<size_t>

source

pub fn topology_amd(&self) -> Result<cl_amd_device_topology>

source

pub fn pci_bus_id_amd(&self) -> Result<cl_uint>

source

pub fn pcibusinfokhr_intel(&self) -> Result<cl_device_pci_bus_info_khr>

source

pub fn pci_bus_id_intel(&self) -> Result<cl_uint>

source

pub fn board_name_amd(&self) -> Result<String>

source

pub fn global_free_memory_amd(&self) -> Result<size_t>

source

pub fn simd_per_compute_unit_amd(&self) -> Result<cl_uint>

source

pub fn simd_width_amd(&self) -> Result<cl_uint>

source

pub fn simd_instruction_width_amd(&self) -> Result<cl_uint>

source

pub fn wavefront_width_amd(&self) -> Result<cl_uint>

source

pub fn global_mem_channels_amd(&self) -> Result<cl_uint>

source

pub fn global_mem_channel_banks_amd(&self) -> Result<cl_uint>

source

pub fn global_mem_channel_bank_width_amd(&self) -> Result<cl_uint>

source

pub fn local_mem_size_per_compute_unit_amd(&self) -> Result<cl_uint>

source

pub fn local_mem_banks_amd(&self) -> Result<cl_uint>

source

pub fn thread_trace_supported_amd(&self) -> Result<cl_uint>

source

pub fn gfxip_major_amd(&self) -> Result<cl_uint>

source

pub fn gfxip_minor_amd(&self) -> Result<cl_uint>

source

pub fn available_async_queues_amd(&self) -> Result<cl_uint>

source

pub fn preferred_work_group_size_amd(&self) -> Result<size_t>

source

pub fn max_work_group_size_amd(&self) -> Result<size_t>

source

pub fn preferred_constant_buffer_size_amd(&self) -> Result<size_t>

source

pub fn pcie_id_amd(&self) -> Result<cl_uint>

source

pub fn device_ip_version_intel(&self) -> Result<cl_uint>

source

pub fn device_id_intel(&self) -> Result<cl_uint>

source

pub fn device_num_slices_intel(&self) -> Result<cl_uint>

source

pub fn device_num_sub_slices_per_slice_intel(&self) -> Result<cl_uint>

source

pub fn device_num_eus_per_sub_slice_intel(&self) -> Result<cl_uint>

source

pub fn device_num_threads_per_eu_intel(&self) -> Result<cl_uint>

source

pub fn device_feature_capabilities_intel( &self ) -> Result<cl_device_feature_capabilities_intel>

source

pub fn device_external_memory_import_handle_types_khr(&self) -> Result<Vec<u32>>

source

pub fn device_semaphore_import_handle_types_khr(&self) -> Result<Vec<u32>>

source

pub fn device_semaphore_export_handle_types_khr(&self) -> Result<Vec<u32>>

source

pub fn device_semaphore_types_khr(&self) -> Result<Vec<u32>>

source

pub fn device_command_buffer_capabilities_khr(&self) -> Result<cl_ulong>

source

pub fn device_command_buffer_required_queue_properties_khr( &self ) -> Result<cl_ulong>

source

pub fn get_data(&self, param_name: cl_device_info) -> Result<Vec<u8>>

Get data about an OpenCL device. Calls clGetDeviceInfo to get the desired data about the device.

source

pub fn supports_half(&self, min_fp_capability: cl_device_fp_config) -> bool

Determine if the device supports the given half floating point capability.
Returns true if the device supports it, false otherwise.

source

pub fn supports_double(&self, min_fp_capability: cl_device_fp_config) -> bool

Determine if the device supports the given double floating point capability.
Returns true if the device supports it, false otherwise.

CL_VERSION_1_2

source

pub fn svm_mem_capability(&self) -> cl_device_svm_capabilities

Determine if the device supports SVM and, if so, what kind of SVM.
Returns zero if the device does not support SVM.

CL_VERSION_2_0

Trait Implementations§

source§

impl Clone for Device

source§

fn clone(&self) -> Device

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Device

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<*mut c_void> for Device

source§

fn from(value: cl_device_id) -> Self

Converts to this type from the input type.
source§

impl From<Device> for cl_device_id

source§

fn from(value: Device) -> Self

Converts to this type from the input type.
source§

impl Copy for Device

source§

impl Send for Device

source§

impl Sync for Device

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.