Implement cuModuleGetLoadingMode (#381)

This commit is contained in:
Violet 2025-06-11 15:54:48 -07:00 committed by GitHub
commit 1715830d82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 1 deletions

View file

@ -1,6 +1,10 @@
use cuda_types::cuda::*; use cuda_types::cuda::*;
use hip_runtime_sys::*; use hip_runtime_sys::*;
use std::{ffi::CStr, mem::{self, ManuallyDrop, MaybeUninit}, ptr}; use std::{
ffi::CStr,
mem::{self, ManuallyDrop, MaybeUninit},
ptr,
};
pub(super) mod context; pub(super) mod context;
pub(super) mod device; pub(super) mod device;
@ -131,6 +135,7 @@ from_cuda_nop!(
cuda_types::cuda::CUdevprop, cuda_types::cuda::CUdevprop,
CUdevice_attribute, CUdevice_attribute,
CUdriverProcAddressQueryResult, CUdriverProcAddressQueryResult,
CUmoduleLoadingMode,
CUuuid CUuuid
); );
from_cuda_transmute!( from_cuda_transmute!(

View file

@ -53,3 +53,8 @@ pub(crate) fn get_function(
) -> hipError_t { ) -> hipError_t {
unsafe { hipModuleGetFunction(hfunc, hmod.base, name) } unsafe { hipModuleGetFunction(hfunc, hmod.base, name) }
} }
pub(crate) fn get_loading_mode(mode: &mut cuda_types::cuda::CUmoduleLoadingMode) -> CUresult {
*mode = cuda_types::cuda::CUmoduleLoadingMode::CU_MODULE_EAGER_LOADING;
Ok(())
}

View file

@ -75,6 +75,7 @@ cuda_base::cuda_function_declarations!(
cuMemsetD32_v2, cuMemsetD32_v2,
cuMemsetD8_v2, cuMemsetD8_v2,
cuModuleGetFunction, cuModuleGetFunction,
cuModuleGetLoadingMode,
cuModuleLoadData, cuModuleLoadData,
cuModuleUnload, cuModuleUnload,
cuPointerGetAttribute, cuPointerGetAttribute,