diff options
author | Andrzej Janik <[email protected]> | 2020-09-24 01:54:16 +0200 |
---|---|---|
committer | Andrzej Janik <[email protected]> | 2020-09-24 01:54:16 +0200 |
commit | 3f41f21acb51f7a1d305630dc2a4e5c5df5e4a83 (patch) | |
tree | d6d2fb03034b00b8b711bed08802bf0e2dbb275e /notcuda/src/impl/mod.rs | |
parent | 03005140dde6c45a47d1fe03a183d76af38b7a12 (diff) | |
download | ZLUDA-3f41f21acb51f7a1d305630dc2a4e5c5df5e4a83.tar.gz ZLUDA-3f41f21acb51f7a1d305630dc2a4e5c5df5e4a83.zip |
Implement more host code, moving execution further
Diffstat (limited to 'notcuda/src/impl/mod.rs')
-rw-r--r-- | notcuda/src/impl/mod.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/notcuda/src/impl/mod.rs b/notcuda/src/impl/mod.rs index 7813532..c37b85d 100644 --- a/notcuda/src/impl/mod.rs +++ b/notcuda/src/impl/mod.rs @@ -1,5 +1,5 @@ -use crate::cuda::{CUctx_st, CUdevice, CUdeviceptr, CUresult, CUmodule}; -use std::{ffi::c_void, mem::ManuallyDrop, os::raw::c_int, sync::Mutex}; +use crate::cuda::{CUctx_st, CUdevice, CUdeviceptr, CUfunction, CUmod_st, CUmodule, CUresult}; +use std::{ffi::c_void, mem::{self, ManuallyDrop}, os::raw::c_int, sync::Mutex}; #[cfg(test)] #[macro_use] @@ -206,6 +206,10 @@ pub fn init() -> l0::Result<()> { Ok(()) } +unsafe fn transmute_lifetime<'a, 'b, T: ?Sized>(t: &'a T) -> &'b T { + mem::transmute(t) +} + pub fn driver_get_version() -> c_int { i32::max_value() } @@ -234,7 +238,10 @@ impl Decuda<*mut c_void> for CUdeviceptr { } } -impl<'a> CudaRepr for CUmodule { - type Impl = *mut module::Module; +impl<'a> CudaRepr for CUmod_st { + type Impl = module::Module; } +impl<'a> CudaRepr for CUfunction { + type Impl = *mut module::Function; +} |