pub struct Device { /* private fields */ }
Implementations§
source§impl Device
impl Device
pub fn default() -> Device
pub unsafe fn new(d: *mut c_void) -> Result<Device>
pub fn copy(d: &impl DeviceTraitConst) -> Result<Device>
pub fn copy_mut(d: Device) -> Device
pub fn get_default() -> Result<Device>
sourcepub unsafe fn from_handle(d: *mut c_void) -> Result<Device>
pub unsafe fn from_handle(d: *mut c_void) -> Result<Device>
§Parameters
- d: OpenCL handle (cl_device_id). clRetainDevice() is called on success.
Note: Ownership of the passed device is passed to OpenCV on success.
The caller should additionally call clRetainDevice
on it if it intends
to continue using the device.
Trait Implementations§
source§impl Boxed for Device
impl Boxed for Device
source§unsafe fn from_raw(ptr: <Device as OpenCVFromExtern>::ExternReceive) -> Self
unsafe fn from_raw(ptr: <Device as OpenCVFromExtern>::ExternReceive) -> Self
Wrap the specified raw pointer Read more
source§fn into_raw(self) -> <Device as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw(self) -> <Device as OpenCVTypeExternContainer>::ExternSendMut
Return the underlying raw pointer while consuming this wrapper. Read more
source§fn as_raw(&self) -> <Device as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <Device as OpenCVTypeExternContainer>::ExternSend
Return the underlying raw pointer. Read more
source§fn as_raw_mut(&mut self) -> <Device as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut(&mut self) -> <Device as OpenCVTypeExternContainer>::ExternSendMut
Return the underlying mutable raw pointer Read more
source§impl DeviceTrait for Device
impl DeviceTrait for Device
source§impl DeviceTraitConst for Device
impl DeviceTraitConst for Device
fn as_raw_Device(&self) -> *const c_void
fn name(&self) -> Result<String>
fn extensions(&self) -> Result<String>
fn is_extension_supported(&self, extension_name: &str) -> Result<bool>
fn version(&self) -> Result<String>
fn vendor_name(&self) -> Result<String>
fn opencl_c_version(&self) -> Result<String>
fn opencl_version(&self) -> Result<String>
fn device_version_major(&self) -> Result<i32>
fn device_version_minor(&self) -> Result<i32>
fn driver_version(&self) -> Result<String>
fn ptr(&self) -> Result<*mut c_void>
fn typ(&self) -> Result<i32>
fn address_bits(&self) -> Result<i32>
fn available(&self) -> Result<bool>
fn compiler_available(&self) -> Result<bool>
fn linker_available(&self) -> Result<bool>
fn double_fp_config(&self) -> Result<i32>
fn single_fp_config(&self) -> Result<i32>
fn half_fp_config(&self) -> Result<i32>
fn endian_little(&self) -> Result<bool>
fn error_correction_support(&self) -> Result<bool>
fn execution_capabilities(&self) -> Result<i32>
fn global_mem_cache_size(&self) -> Result<size_t>
fn global_mem_cache_type(&self) -> Result<i32>
fn global_mem_cache_line_size(&self) -> Result<i32>
fn global_mem_size(&self) -> Result<size_t>
fn local_mem_size(&self) -> Result<size_t>
fn local_mem_type(&self) -> Result<i32>
fn host_unified_memory(&self) -> Result<bool>
fn image_support(&self) -> Result<bool>
fn image_from_buffer_support(&self) -> Result<bool>
fn image_pitch_alignment(&self) -> Result<u32>
fn image_base_address_alignment(&self) -> Result<u32>
source§fn intel_subgroups_support(&self) -> Result<bool>
fn intel_subgroups_support(&self) -> Result<bool>
deprecated, use isExtensionSupported() method (probably with “cl_khr_subgroups” value)
fn image_2d_max_width(&self) -> Result<size_t>
fn image_2d_max_height(&self) -> Result<size_t>
fn image_3d_max_width(&self) -> Result<size_t>
fn image_3d_max_height(&self) -> Result<size_t>
fn image_3d_max_depth(&self) -> Result<size_t>
fn image_max_buffer_size(&self) -> Result<size_t>
fn image_max_array_size(&self) -> Result<size_t>
fn vendor_id(&self) -> Result<i32>
fn is_amd(&self) -> Result<bool>
fn is_intel(&self) -> Result<bool>
fn is_n_vidia(&self) -> Result<bool>
fn max_clock_frequency(&self) -> Result<i32>
fn max_compute_units(&self) -> Result<i32>
fn max_constant_args(&self) -> Result<i32>
fn max_constant_buffer_size(&self) -> Result<size_t>
fn max_mem_alloc_size(&self) -> Result<size_t>
fn max_parameter_size(&self) -> Result<size_t>
fn max_read_image_args(&self) -> Result<i32>
fn max_write_image_args(&self) -> Result<i32>
fn max_samplers(&self) -> Result<i32>
fn max_work_group_size(&self) -> Result<size_t>
fn max_work_item_dims(&self) -> Result<i32>
fn max_work_item_sizes(&self, unnamed: &mut size_t) -> Result<()>
fn mem_base_addr_align(&self) -> Result<i32>
fn native_vector_width_char(&self) -> Result<i32>
fn native_vector_width_short(&self) -> Result<i32>
fn native_vector_width_int(&self) -> Result<i32>
fn native_vector_width_long(&self) -> Result<i32>
fn native_vector_width_float(&self) -> Result<i32>
fn native_vector_width_double(&self) -> Result<i32>
fn native_vector_width_half(&self) -> Result<i32>
fn preferred_vector_width_char(&self) -> Result<i32>
fn preferred_vector_width_short(&self) -> Result<i32>
fn preferred_vector_width_int(&self) -> Result<i32>
fn preferred_vector_width_long(&self) -> Result<i32>
fn preferred_vector_width_float(&self) -> Result<i32>
fn preferred_vector_width_double(&self) -> Result<i32>
fn preferred_vector_width_half(&self) -> Result<i32>
fn printf_buffer_size(&self) -> Result<size_t>
fn profiling_timer_resolution(&self) -> Result<size_t>
fn empty(&self) -> Result<bool>
impl Send for Device
Auto Trait Implementations§
impl Freeze for Device
impl RefUnwindSafe for Device
impl !Sync for Device
impl Unpin for Device
impl UnwindSafe for Device
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res ) -> Res
Helper function to call OpenCV functions that allow in-place modification of a
Mat
or another similar object. By passing
a mutable reference to the Mat
to this function your closure will get called with the read reference and a write references
to the same Mat
. This is of course unsafe as it breaks the Rust aliasing rules, but it might be useful for some performance
sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold
. Read more