mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-08-02 14:57:43 +03:00
Format files (#450)
This commit is contained in:
@ -4,7 +4,7 @@ use comgr::Comgr;
|
|||||||
use cuda_types::cuda::*;
|
use cuda_types::cuda::*;
|
||||||
use hip_runtime_sys::*;
|
use hip_runtime_sys::*;
|
||||||
use std::{
|
use std::{
|
||||||
ffi::{CStr, CString, c_void},
|
ffi::{c_void, CStr, CString},
|
||||||
mem, ptr, slice,
|
mem, ptr, slice,
|
||||||
sync::OnceLock,
|
sync::OnceLock,
|
||||||
usize,
|
usize,
|
||||||
@ -166,13 +166,7 @@ impl ::dark_api::cuda::CudaDarkApi for DarkApi {
|
|||||||
cu_ctx: CUcontext,
|
cu_ctx: CUcontext,
|
||||||
key: *mut c_void,
|
key: *mut c_void,
|
||||||
value: *mut c_void,
|
value: *mut c_void,
|
||||||
dtor_cb: Option<
|
dtor_cb: Option<extern "system" fn(CUcontext, *mut c_void, *mut c_void)>,
|
||||||
extern "system" fn(
|
|
||||||
CUcontext,
|
|
||||||
*mut c_void,
|
|
||||||
*mut c_void,
|
|
||||||
),
|
|
||||||
>,
|
|
||||||
) -> CUresult {
|
) -> CUresult {
|
||||||
let _ctx = if cu_ctx.0 != ptr::null_mut() {
|
let _ctx = if cu_ctx.0 != ptr::null_mut() {
|
||||||
cu_ctx
|
cu_ctx
|
||||||
@ -223,7 +217,7 @@ impl ::dark_api::cuda::CudaDarkApi for DarkApi {
|
|||||||
ctx_obj.with_state(|state: &context::ContextState| {
|
ctx_obj.with_state(|state: &context::ContextState| {
|
||||||
match state.storage.get(&(key as usize)) {
|
match state.storage.get(&(key as usize)) {
|
||||||
Some(data) => *value = data.value as *mut c_void,
|
Some(data) => *value = data.value as *mut c_void,
|
||||||
None => return CUresult::ERROR_INVALID_HANDLE
|
None => return CUresult::ERROR_INVALID_HANDLE,
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
})?;
|
})?;
|
||||||
|
Reference in New Issue
Block a user