Skip to main content

KernelHandle

Trait KernelHandle 

Source
pub trait KernelHandle {
    type RawHandle: Copy;

    // Required methods
    unsafe fn raw_name(
        raw: Self::RawHandle,
        name: *mut *const i8,
        device_id: i32,
    ) -> CUresult;
    unsafe fn raw_attribute(
        value: *mut i32,
        attribute: CUfunction_attribute,
        raw: Self::RawHandle,
        device_id: i32,
    ) -> CUresult;
    unsafe fn set_attribute(
        raw: Self::RawHandle,
        attribute: CUfunction_attribute,
        value: i32,
        device_id: i32,
    ) -> CUresult;
}
Expand description

Raw CUDA kernel handle adapter.

Implementors define how to query names, attributes, and mutable attributes for a specific CUDA kernel handle type.

Required Associated Types§

Source

type RawHandle: Copy

Raw CUDA handle type accepted by the corresponding driver calls.

Required Methods§

Source

unsafe fn raw_name( raw: Self::RawHandle, name: *mut *const i8, device_id: i32, ) -> CUresult

Calls the CUDA API that returns the kernel name for raw.

§Safety

raw must be a valid kernel handle for device_id, and name must be valid for CUDA to write a pointer-sized result.

Source

unsafe fn raw_attribute( value: *mut i32, attribute: CUfunction_attribute, raw: Self::RawHandle, device_id: i32, ) -> CUresult

Calls the CUDA API that returns a kernel attribute for raw.

§Safety

raw must be a valid kernel handle for device_id, and value must be valid for CUDA to write an i32 result.

Source

unsafe fn set_attribute( raw: Self::RawHandle, attribute: CUfunction_attribute, value: i32, device_id: i32, ) -> CUresult

Calls the CUDA API that sets a kernel attribute for raw.

§Safety

raw must be a valid kernel handle for device_id, and the selected attribute/value pair must be accepted by CUDA for that handle.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§