mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-08-02 14:19:57 +00:00
Fix bugs related to replay on Linux
This commit is contained in:
parent
e89b0c5d9c
commit
55fbe1abb5
5 changed files with 16 additions and 7 deletions
|
@ -443,7 +443,7 @@ FnInput: ast::Variable<&'input str> = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) FunctionBody: Option<Vec<ast::Statement<ast::ParsedArgParams<'input>>>> = {
|
FunctionBody: Option<Vec<ast::Statement<ast::ParsedArgParams<'input>>>> = {
|
||||||
"{" <s:Statement*> "}" => { Some(without_none(s)) },
|
"{" <s:Statement*> "}" => { Some(without_none(s)) },
|
||||||
";" => { None }
|
";" => { None }
|
||||||
};
|
};
|
||||||
|
|
|
@ -2693,6 +2693,15 @@ pub extern "system" fn cuIpcOpenMemHandle(
|
||||||
r#impl::unimplemented()
|
r#impl::unimplemented()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(not(test), no_mangle)]
|
||||||
|
pub extern "system" fn cuIpcOpenMemHandle_v2(
|
||||||
|
pdptr: *mut CUdeviceptr,
|
||||||
|
handle: CUipcMemHandle,
|
||||||
|
Flags: ::std::os::raw::c_uint,
|
||||||
|
) -> CUresult {
|
||||||
|
r#impl::unimplemented()
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg_attr(not(test), no_mangle)]
|
#[cfg_attr(not(test), no_mangle)]
|
||||||
pub extern "system" fn cuIpcCloseMemHandle(dptr: CUdeviceptr) -> CUresult {
|
pub extern "system" fn cuIpcCloseMemHandle(dptr: CUdeviceptr) -> CUresult {
|
||||||
r#impl::unimplemented()
|
r#impl::unimplemented()
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
use std::ffi::c_void;
|
use std::ffi::c_void;
|
||||||
use std::ptr;
|
|
||||||
|
|
||||||
pub unsafe fn heap_create() -> *mut c_void {
|
pub unsafe fn heap_create() -> *mut c_void {
|
||||||
usize::MAX as *mut _
|
usize::MAX as *mut _
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn heap_alloc(heap: *mut c_void, bytes: usize) -> *mut c_void {
|
pub unsafe fn heap_alloc(_heap: *mut c_void, _bytes: usize) -> *mut c_void {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn heap_free(heap: *mut c_void, alloc: *mut c_void) {
|
pub unsafe fn heap_free(_heap: *mut c_void, _alloc: *mut c_void) {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
|
use crate::cuda::CUuuid;
|
||||||
use std::ffi::{c_void, CStr};
|
use std::ffi::{c_void, CStr};
|
||||||
|
|
||||||
const NVCUDA_DEFAULT_PATH: &'static [u8] = b"/usr/lib/x86_64-linux-gnu/libcuda.so.1\0";
|
const NVCUDA_DEFAULT_PATH: &'static [u8] = b"/usr/lib/x86_64-linux-gnu/libcuda.so.1\0";
|
||||||
|
|
||||||
pub fn init() {}
|
|
||||||
|
|
||||||
pub unsafe fn load_cuda_library() -> *mut c_void {
|
pub unsafe fn load_cuda_library() -> *mut c_void {
|
||||||
libc::dlopen(
|
libc::dlopen(
|
||||||
NVCUDA_DEFAULT_PATH.as_ptr() as *const _,
|
NVCUDA_DEFAULT_PATH.as_ptr() as *const _,
|
||||||
|
@ -37,6 +36,8 @@ pub fn get_thunk(
|
||||||
guid: *const CUuuid,
|
guid: *const CUuuid,
|
||||||
idx: usize,
|
idx: usize,
|
||||||
) -> *const c_void {
|
) -> *const c_void {
|
||||||
|
use std::mem;
|
||||||
|
|
||||||
use dynasmrt::{dynasm, DynasmApi};
|
use dynasmrt::{dynasm, DynasmApi};
|
||||||
let mut ops = dynasmrt::x86::Assembler::new().unwrap();
|
let mut ops = dynasmrt::x86::Assembler::new().unwrap();
|
||||||
let start = ops.offset();
|
let start = ops.offset();
|
||||||
|
|
|
@ -60,7 +60,7 @@ def append_debug_buffer(args):
|
||||||
|
|
||||||
def verify_single_dump(input_path, max_block_threads):
|
def verify_single_dump(input_path, max_block_threads):
|
||||||
print(input_path)
|
print(input_path)
|
||||||
kernel_name = path.basename(input_path).split("_", 1)[1]
|
kernel_name = path.basename(os.path.normpath(input_path)).split("_", 1)[1]
|
||||||
with open(path.join(input_path, "launch.txt"), "r") as launch_f:
|
with open(path.join(input_path, "launch.txt"), "r") as launch_f:
|
||||||
launch_lines = list(map(int, launch_f.readlines()))
|
launch_lines = list(map(int, launch_f.readlines()))
|
||||||
block = tuple(launch_lines[3:6])
|
block = tuple(launch_lines[3:6])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue