Fix bugs related to replay on Linux

This commit is contained in:
Andrzej Janik 2021-06-27 16:19:04 +02:00
parent e89b0c5d9c
commit 55fbe1abb5
5 changed files with 16 additions and 7 deletions

View file

@ -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)) },
";" => { None }
};

View file

@ -2693,6 +2693,15 @@ pub extern "system" fn cuIpcOpenMemHandle(
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)]
pub extern "system" fn cuIpcCloseMemHandle(dptr: CUdeviceptr) -> CUresult {
r#impl::unimplemented()

View file

@ -1,14 +1,13 @@
use std::ffi::c_void;
use std::ptr;
pub unsafe fn heap_create() -> *mut c_void {
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!()
}
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!()
}

View file

@ -1,9 +1,8 @@
use crate::cuda::CUuuid;
use std::ffi::{c_void, CStr};
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 {
libc::dlopen(
NVCUDA_DEFAULT_PATH.as_ptr() as *const _,
@ -37,6 +36,8 @@ pub fn get_thunk(
guid: *const CUuuid,
idx: usize,
) -> *const c_void {
use std::mem;
use dynasmrt::{dynasm, DynasmApi};
let mut ops = dynasmrt::x86::Assembler::new().unwrap();
let start = ops.offset();

View file

@ -60,7 +60,7 @@ def append_debug_buffer(args):
def verify_single_dump(input_path, max_block_threads):
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:
launch_lines = list(map(int, launch_f.readlines()))
block = tuple(launch_lines[3:6])