pub struct Kernel { /* private fields */ }Expand description
A kernel from a Library. Library kernels are per-library but not
per-context; use Kernel::function_for_current_context to materialize
a Function for the active context before launching.
Implementations§
Source§impl Kernel
impl Kernel
Sourcepub fn function_for_current_context(&self) -> Result<Function>
pub fn function_for_current_context(&self) -> Result<Function>
Materialize this library kernel into a Function suitable for
the caller’s currently-current CUDA context. The returned
Function keeps a clone of the parent library alive.
Sourcepub fn attribute(&self, attr: i32, device: &Device) -> Result<i32>
pub fn attribute(&self, attr: i32, device: &Device) -> Result<i32>
Query a CUfunction_attribute on this kernel for a specific device.
Sourcepub fn set_attribute(
&self,
attr: i32,
value: i32,
device: &Device,
) -> Result<()>
pub fn set_attribute( &self, attr: i32, value: i32, device: &Device, ) -> Result<()>
Set a (writable) CUfunction_attribute on this kernel for a
specific device. Common writables: MAX_DYNAMIC_SHARED_SIZE_BYTES,
PREFERRED_SHARED_MEMORY_CARVEOUT.
Sourcepub fn name(&self) -> Result<String>
pub fn name(&self) -> Result<String>
Return the kernel’s demangled name as reported by the driver.
Sourcepub fn set_cache_config(&self, config: u32, device: &Device) -> Result<()>
pub fn set_cache_config(&self, config: u32, device: &Device) -> Result<()>
Set the preferred L1 vs shared-memory cache config for this kernel
on device. Pass one of the
baracuda_cuda_sys::types::CUfunc_cache constants (PREFER_NONE,
PREFER_SHARED, PREFER_L1, PREFER_EQUAL).