pub struct Library { /* private fields */ }Implementations§
Source§impl Library
impl Library
pub unsafe fn from_raw(handle: CUlibrary, ctx: Arc<Context>) -> Result<Self>
Sourcepub fn kernel(&self, name: &str) -> Result<LibraryKernel<'_>>
pub fn kernel(&self, name: &str) -> Result<LibraryKernel<'_>>
Returns the handle of the kernel with the given name located in this library.
If kernel handle is not found, the call returns crate::error::Status::NotFound.
§Errors
Returns an error if name contains an interior NUL byte, if the CUDA
context cannot be bound, if CUDA Driver cannot find the kernel, or if it
returns a null handle.
Sourcepub fn kernel_count(&self) -> Result<usize>
pub fn kernel_count(&self) -> Result<usize>
Returns the number of kernels in this library.
§Errors
Returns an error if the CUDA context cannot be bound or if CUDA Driver cannot report the kernel count.
Sourcepub fn module(&self) -> Result<Module>
pub fn module(&self) -> Result<Module>
Returns the module handle associated with the current context located in this library.
If module handle is not found, the call returns crate::error::Status::NotFound.
§Errors
Returns an error if the CUDA context cannot be bound, if CUDA Driver cannot find the module, or if it returns a null handle.
Sourcepub fn global(&self, name: &str) -> Result<LibraryGlobal<'_>>
pub fn global(&self, name: &str) -> Result<LibraryGlobal<'_>>
Returns the base pointer and size of the global with the given name for the requested library and the current context.
If no global for the requested name exists, the call returns crate::error::Status::NotFound.
§Errors
Returns an error if name contains an interior NUL byte, if the CUDA
context cannot be bound, or if CUDA Driver cannot find the global.
Sourcepub fn managed(&self, name: &str) -> Result<LibraryGlobal<'_>>
pub fn managed(&self, name: &str) -> Result<LibraryGlobal<'_>>
Returns the base pointer and size of the managed memory with the given name for the requested library.
If no managed memory with the requested name exists, the call returns crate::error::Status::NotFound.
Managed memory for the library is shared across devices and is registered when the library is loaded into at least one context.
§Errors
Returns an error if name contains an interior NUL byte, if the CUDA
context cannot be bound, or if CUDA Driver cannot find the managed
allocation.
Sourcepub fn unified_function(&self, symbol: &str) -> Result<*mut ()>
pub fn unified_function(&self, symbol: &str) -> Result<*mut ()>
Returns the pointer to the unified function named by symbol.
If no unified function with that name exists, the call returns crate::error::Status::NotFound.
If no device in the system supports unified function pointers, the call may return crate::error::Status::NotFound.
§Errors
Returns an error if symbol contains an interior NUL byte, if the CUDA
context cannot be bound, or if CUDA Driver cannot find the unified
function.