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
impl Device
pub fn new(id: cl_device_id) -> Device
sourcepub fn id(&self) -> cl_device_id
pub fn id(&self) -> cl_device_id
Accessor for the underlying device id.
sourcepub fn create_sub_devices(
&self,
properties: &[cl_device_partition_property]
) -> Result<Vec<SubDevice>>
pub fn create_sub_devices( &self, properties: &[cl_device_partition_property] ) -> Result<Vec<SubDevice>>
Create sub-devices by partitioning an OpenCL device.
properties
- the slice of cl_device_partition_property, see Subdevice Partition.
returns a Result containing a vector of available SubDevices or the error code from the OpenCL C API function.
sourcepub fn dev_type(&self) -> Result<cl_device_type>
pub fn dev_type(&self) -> Result<cl_device_type>
The OpenCL device type, see Device Types.
sourcepub fn vendor_id(&self) -> Result<cl_uint>
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.
sourcepub fn max_compute_units(&self) -> Result<cl_uint>
pub fn max_compute_units(&self) -> Result<cl_uint>
The number of parallel compute units on the device, minimum 1.
sourcepub fn max_work_item_dimensions(&self) -> Result<cl_uint>
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.
sourcepub fn max_work_group_size(&self) -> Result<size_t>
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.
pub fn max_work_item_sizes(&self) -> Result<Vec<size_t>>
pub fn max_preferred_vector_width_char(&self) -> Result<cl_uint>
pub fn max_preferred_vector_width_short(&self) -> Result<cl_uint>
pub fn max_preferred_vector_width_int(&self) -> Result<cl_uint>
pub fn max_preferred_vector_width_long(&self) -> Result<cl_uint>
pub fn max_preferred_vector_width_float(&self) -> Result<cl_uint>
pub fn max_preferred_vector_width_double(&self) -> Result<cl_uint>
pub fn max_clock_frequency(&self) -> Result<cl_uint>
pub fn address_bits(&self) -> Result<cl_uint>
pub fn max_read_image_args(&self) -> Result<cl_uint>
pub fn max_write_image_args(&self) -> Result<cl_uint>
pub fn max_mem_alloc_size(&self) -> Result<cl_ulong>
pub fn image2d_max_width(&self) -> Result<size_t>
pub fn image2d_max_height(&self) -> Result<size_t>
pub fn image3d_max_width(&self) -> Result<size_t>
pub fn image3d_max_height(&self) -> Result<size_t>
pub fn image3d_max_depth(&self) -> Result<size_t>
pub fn image_support(&self) -> Result<bool>
pub fn max_parameter_size(&self) -> Result<size_t>
pub fn max_device_samples(&self) -> Result<cl_uint>
pub fn mem_base_addr_align(&self) -> Result<cl_uint>
pub fn min_data_type_align_size(&self) -> Result<cl_uint>
pub fn single_fp_config(&self) -> Result<cl_ulong>
pub fn global_mem_cache_type(&self) -> Result<cl_uint>
pub fn global_mem_cacheline_size(&self) -> Result<cl_uint>
pub fn global_mem_cache_size(&self) -> Result<cl_ulong>
pub fn global_mem_size(&self) -> Result<cl_ulong>
pub fn max_constant_buffer_size(&self) -> Result<cl_ulong>
pub fn max_constant_args(&self) -> Result<cl_uint>
pub fn local_mem_type(&self) -> Result<cl_uint>
pub fn local_mem_size(&self) -> Result<cl_ulong>
pub fn error_correction_support(&self) -> Result<bool>
pub fn profiling_timer_resolution(&self) -> Result<size_t>
pub fn endian_little(&self) -> Result<bool>
pub fn available(&self) -> Result<bool>
pub fn compiler_available(&self) -> Result<bool>
pub fn execution_capabilities(&self) -> Result<cl_ulong>
pub fn queue_on_host_properties(&self) -> Result<cl_ulong>
pub fn name(&self) -> Result<String>
pub fn vendor(&self) -> Result<String>
pub fn driver_version(&self) -> Result<String>
pub fn profile(&self) -> Result<String>
pub fn version(&self) -> Result<String>
pub fn extensions(&self) -> Result<String>
pub fn platform(&self) -> Result<cl_platform_id>
sourcepub fn double_fp_config(&self) -> Result<cl_ulong>
pub fn double_fp_config(&self) -> Result<cl_ulong>
CL_VERSION_1_2
pub fn half_fp_config(&self) -> Result<cl_ulong>
pub fn preferred_vector_width_half(&self) -> Result<cl_uint>
pub fn host_unified_memory(&self) -> Result<bool>
pub fn native_vector_width_char(&self) -> Result<cl_uint>
pub fn native_vector_width_short(&self) -> Result<cl_uint>
pub fn native_vector_width_int(&self) -> Result<cl_uint>
pub fn native_vector_width_long(&self) -> Result<cl_uint>
pub fn native_vector_width_float(&self) -> Result<cl_uint>
pub fn native_vector_width_double(&self) -> Result<cl_uint>
pub fn native_vector_width_half(&self) -> Result<cl_uint>
pub fn opencl_c_version(&self) -> Result<String>
sourcepub fn linker_available(&self) -> Result<bool>
pub fn linker_available(&self) -> Result<bool>
CL_VERSION_1_2
sourcepub fn built_in_kernels(&self) -> Result<String>
pub fn built_in_kernels(&self) -> Result<String>
CL_VERSION_1_2
sourcepub fn image_max_buffer_size(&self) -> Result<size_t>
pub fn image_max_buffer_size(&self) -> Result<size_t>
CL_VERSION_1_2
sourcepub fn image_max_array_size(&self) -> Result<size_t>
pub fn image_max_array_size(&self) -> Result<size_t>
CL_VERSION_1_2
sourcepub fn parent_device(&self) -> Result<cl_device_id>
pub fn parent_device(&self) -> Result<cl_device_id>
CL_VERSION_1_2
sourcepub fn partition_max_sub_devices(&self) -> Result<cl_uint>
pub fn partition_max_sub_devices(&self) -> Result<cl_uint>
CL_VERSION_1_2
sourcepub fn partition_properties(&self) -> Result<Vec<intptr_t>>
pub fn partition_properties(&self) -> Result<Vec<intptr_t>>
CL_VERSION_1_2
sourcepub fn partition_affinity_domain(&self) -> Result<Vec<cl_ulong>>
pub fn partition_affinity_domain(&self) -> Result<Vec<cl_ulong>>
CL_VERSION_1_2
sourcepub fn partition_type(&self) -> Result<Vec<intptr_t>>
pub fn partition_type(&self) -> Result<Vec<intptr_t>>
CL_VERSION_1_2
sourcepub fn reference_count(&self) -> Result<cl_uint>
pub fn reference_count(&self) -> Result<cl_uint>
CL_VERSION_1_2
sourcepub fn preferred_interop_user_sync(&self) -> Result<bool>
pub fn preferred_interop_user_sync(&self) -> Result<bool>
CL_VERSION_1_2
sourcepub fn printf_buffer_size(&self) -> Result<size_t>
pub fn printf_buffer_size(&self) -> Result<size_t>
CL_VERSION_1_2
sourcepub fn image_pitch_alignment(&self) -> Result<cl_uint>
pub fn image_pitch_alignment(&self) -> Result<cl_uint>
CL_VERSION_2_0
sourcepub fn image_base_address_alignment(&self) -> Result<cl_uint>
pub fn image_base_address_alignment(&self) -> Result<cl_uint>
CL_VERSION_2_0
sourcepub fn max_read_write_image_args(&self) -> Result<cl_uint>
pub fn max_read_write_image_args(&self) -> Result<cl_uint>
CL_VERSION_2_0
sourcepub fn max_global_variable_size(&self) -> Result<size_t>
pub fn max_global_variable_size(&self) -> Result<size_t>
CL_VERSION_2_0
sourcepub fn queue_on_device_properties(&self) -> Result<Vec<intptr_t>>
pub fn queue_on_device_properties(&self) -> Result<Vec<intptr_t>>
CL_VERSION_2_0
sourcepub fn queue_on_device_preferred_size(&self) -> Result<size_t>
pub fn queue_on_device_preferred_size(&self) -> Result<size_t>
CL_VERSION_2_0
sourcepub fn queue_on_device_max_size(&self) -> Result<size_t>
pub fn queue_on_device_max_size(&self) -> Result<size_t>
CL_VERSION_2_0
sourcepub fn max_on_device_queues(&self) -> Result<cl_uint>
pub fn max_on_device_queues(&self) -> Result<cl_uint>
CL_VERSION_2_0
sourcepub fn max_on_device_events(&self) -> Result<cl_uint>
pub fn max_on_device_events(&self) -> Result<cl_uint>
CL_VERSION_2_0
sourcepub fn svm_capabilities(&self) -> Result<cl_device_svm_capabilities>
pub fn svm_capabilities(&self) -> Result<cl_device_svm_capabilities>
CL_VERSION_2_0
sourcepub fn global_variable_preferred_total_size(&self) -> Result<size_t>
pub fn global_variable_preferred_total_size(&self) -> Result<size_t>
CL_VERSION_2_0
sourcepub fn max_pipe_args(&self) -> Result<cl_uint>
pub fn max_pipe_args(&self) -> Result<cl_uint>
CL_VERSION_2_0
sourcepub fn pipe_max_active_reservations(&self) -> Result<cl_uint>
pub fn pipe_max_active_reservations(&self) -> Result<cl_uint>
CL_VERSION_2_0
sourcepub fn pipe_max_packet_size(&self) -> Result<cl_uint>
pub fn pipe_max_packet_size(&self) -> Result<cl_uint>
CL_VERSION_2_0
sourcepub fn preferred_platform_atomic_alignment(&self) -> Result<cl_uint>
pub fn preferred_platform_atomic_alignment(&self) -> Result<cl_uint>
CL_VERSION_2_0
sourcepub fn preferred_global_atomic_alignment(&self) -> Result<cl_uint>
pub fn preferred_global_atomic_alignment(&self) -> Result<cl_uint>
CL_VERSION_2_0
sourcepub fn preferred_local_atomic_alignment(&self) -> Result<cl_uint>
pub fn preferred_local_atomic_alignment(&self) -> Result<cl_uint>
CL_VERSION_2_0
sourcepub fn il_version(&self) -> Result<String>
pub fn il_version(&self) -> Result<String>
CL_VERSION_2_1
sourcepub fn max_num_sub_groups(&self) -> Result<cl_uint>
pub fn max_num_sub_groups(&self) -> Result<cl_uint>
CL_VERSION_2_1
sourcepub fn sub_group_independent_forward_progress(&self) -> Result<bool>
pub fn sub_group_independent_forward_progress(&self) -> Result<bool>
CL_VERSION_2_1
sourcepub fn numeric_version(&self) -> Result<cl_uint>
pub fn numeric_version(&self) -> Result<cl_uint>
CL_VERSION_3_0
sourcepub fn extensions_with_version(&self) -> Result<Vec<cl_name_version>>
pub fn extensions_with_version(&self) -> Result<Vec<cl_name_version>>
CL_VERSION_3_0
sourcepub fn ils_with_version(&self) -> Result<Vec<cl_name_version>>
pub fn ils_with_version(&self) -> Result<Vec<cl_name_version>>
CL_VERSION_3_0
sourcepub fn built_in_kernels_with_version(&self) -> Result<Vec<cl_name_version>>
pub fn built_in_kernels_with_version(&self) -> Result<Vec<cl_name_version>>
CL_VERSION_3_0
sourcepub fn atomic_memory_capabilities(&self) -> Result<cl_ulong>
pub fn atomic_memory_capabilities(&self) -> Result<cl_ulong>
CL_VERSION_3_0
sourcepub fn atomic_fence_capabilities(&self) -> Result<cl_ulong>
pub fn atomic_fence_capabilities(&self) -> Result<cl_ulong>
CL_VERSION_3_0
sourcepub fn non_uniform_work_group_support(&self) -> Result<bool>
pub fn non_uniform_work_group_support(&self) -> Result<bool>
CL_VERSION_3_0
sourcepub fn opencl_c_all_versions(&self) -> Result<Vec<cl_name_version>>
pub fn opencl_c_all_versions(&self) -> Result<Vec<cl_name_version>>
CL_VERSION_3_0
sourcepub fn preferred_work_group_size_multiple(&self) -> Result<size_t>
pub fn preferred_work_group_size_multiple(&self) -> Result<size_t>
CL_VERSION_3_0
sourcepub fn work_group_collective_functions_support(&self) -> Result<bool>
pub fn work_group_collective_functions_support(&self) -> Result<bool>
CL_VERSION_3_0
sourcepub fn generic_address_space_support(&self) -> Result<bool>
pub fn generic_address_space_support(&self) -> Result<bool>
CL_VERSION_3_0
sourcepub fn driver_uuid_khr(&self) -> Result<[u8; 16]>
pub fn driver_uuid_khr(&self) -> Result<[u8; 16]>
CL_VERSION_3_0
sourcepub fn luid_valid_khr(&self) -> Result<bool>
pub fn luid_valid_khr(&self) -> Result<bool>
CL_VERSION_3_0
sourcepub fn node_mask_khr(&self) -> Result<cl_uint>
pub fn node_mask_khr(&self) -> Result<cl_uint>
CL_VERSION_3_0
sourcepub fn opencl_c_features(&self) -> Result<Vec<cl_name_version>>
pub fn opencl_c_features(&self) -> Result<Vec<cl_name_version>>
CL_VERSION_3_0
sourcepub fn device_enqueue_capabilities(&self) -> Result<cl_ulong>
pub fn device_enqueue_capabilities(&self) -> Result<cl_ulong>
CL_VERSION_3_0
sourcepub fn pipe_support(&self) -> Result<bool>
pub fn pipe_support(&self) -> Result<bool>
CL_VERSION_3_0
sourcepub fn latest_conformance_version_passed(&self) -> Result<String>
pub fn latest_conformance_version_passed(&self) -> Result<String>
CL_VERSION_3_0
pub fn integer_dot_product_capabilities_khr(&self) -> Result<cl_ulong>
pub fn integer_dot_product_acceleration_properties_8bit_khr( &self ) -> Result<cl_device_integer_dot_product_acceleration_properties_khr>
pub fn integer_dot_product_acceleration_properties_4x8bit_packed_khr( &self ) -> Result<cl_device_integer_dot_product_acceleration_properties_khr>
pub fn compute_capability_major_nv(&self) -> Result<cl_uint>
pub fn compute_capability_minor_nv(&self) -> Result<cl_uint>
pub fn registers_per_block_nv(&self) -> Result<cl_uint>
pub fn wrap_size_nv(&self) -> Result<cl_uint>
pub fn gpu_overlap_nv(&self) -> Result<cl_uint>
pub fn compute_kernel_exec_timeout_nv(&self) -> Result<cl_uint>
pub fn integrated_memory_nv(&self) -> Result<cl_uint>
pub fn pci_bus_id_nv(&self) -> Result<cl_uint>
pub fn pci_slot_id_nv(&self) -> Result<cl_uint>
pub fn profiling_timer_offset_amd(&self) -> Result<size_t>
pub fn topology_amd(&self) -> Result<cl_amd_device_topology>
pub fn pci_bus_id_amd(&self) -> Result<cl_uint>
pub fn pcibusinfokhr_intel(&self) -> Result<cl_device_pci_bus_info_khr>
pub fn pci_bus_id_intel(&self) -> Result<cl_uint>
pub fn board_name_amd(&self) -> Result<String>
pub fn global_free_memory_amd(&self) -> Result<size_t>
pub fn simd_per_compute_unit_amd(&self) -> Result<cl_uint>
pub fn simd_width_amd(&self) -> Result<cl_uint>
pub fn simd_instruction_width_amd(&self) -> Result<cl_uint>
pub fn wavefront_width_amd(&self) -> Result<cl_uint>
pub fn global_mem_channels_amd(&self) -> Result<cl_uint>
pub fn global_mem_channel_banks_amd(&self) -> Result<cl_uint>
pub fn global_mem_channel_bank_width_amd(&self) -> Result<cl_uint>
pub fn local_mem_size_per_compute_unit_amd(&self) -> Result<cl_uint>
pub fn local_mem_banks_amd(&self) -> Result<cl_uint>
pub fn thread_trace_supported_amd(&self) -> Result<cl_uint>
pub fn gfxip_major_amd(&self) -> Result<cl_uint>
pub fn gfxip_minor_amd(&self) -> Result<cl_uint>
pub fn available_async_queues_amd(&self) -> Result<cl_uint>
pub fn preferred_work_group_size_amd(&self) -> Result<size_t>
pub fn max_work_group_size_amd(&self) -> Result<size_t>
pub fn preferred_constant_buffer_size_amd(&self) -> Result<size_t>
pub fn pcie_id_amd(&self) -> Result<cl_uint>
pub fn device_ip_version_intel(&self) -> Result<cl_uint>
pub fn device_id_intel(&self) -> Result<cl_uint>
pub fn device_num_slices_intel(&self) -> Result<cl_uint>
pub fn device_num_sub_slices_per_slice_intel(&self) -> Result<cl_uint>
pub fn device_num_eus_per_sub_slice_intel(&self) -> Result<cl_uint>
pub fn device_num_threads_per_eu_intel(&self) -> Result<cl_uint>
pub fn device_feature_capabilities_intel( &self ) -> Result<cl_device_feature_capabilities_intel>
pub fn device_external_memory_import_handle_types_khr(&self) -> Result<Vec<u32>>
pub fn device_semaphore_import_handle_types_khr(&self) -> Result<Vec<u32>>
pub fn device_semaphore_export_handle_types_khr(&self) -> Result<Vec<u32>>
pub fn device_semaphore_types_khr(&self) -> Result<Vec<u32>>
pub fn device_command_buffer_capabilities_khr(&self) -> Result<cl_ulong>
pub fn device_command_buffer_required_queue_properties_khr( &self ) -> Result<cl_ulong>
sourcepub fn get_data(&self, param_name: cl_device_info) -> Result<Vec<u8>>
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.
sourcepub fn supports_half(&self, min_fp_capability: cl_device_fp_config) -> bool
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.
sourcepub fn supports_double(&self, min_fp_capability: cl_device_fp_config) -> bool
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
sourcepub fn svm_mem_capability(&self) -> cl_device_svm_capabilities
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