diff options
author | Andrzej Janik <[email protected]> | 2021-08-07 16:16:59 +0200 |
---|---|---|
committer | Andrzej Janik <[email protected]> | 2021-08-07 16:16:59 +0200 |
commit | 407664600ae443a2fc60da7e0c20dd819c58c8ca (patch) | |
tree | fe130d86ab3fa8925c0107d1d7e32108ca7645f5 /zluda | |
parent | 3ce6aee65d488e7b05ac504e2b0795c72cf52b12 (diff) | |
download | ZLUDA-407664600ae443a2fc60da7e0c20dd819c58c8ca.tar.gz ZLUDA-407664600ae443a2fc60da7e0c20dd819c58c8ca.zip |
Hack to read clang output
Diffstat (limited to 'zluda')
-rw-r--r-- | zluda/src/impl/module.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/zluda/src/impl/module.rs b/zluda/src/impl/module.rs index 6ae4235..0c77446 100644 --- a/zluda/src/impl/module.rs +++ b/zluda/src/impl/module.rs @@ -5,6 +5,7 @@ use std::{ ffi::c_void, ffi::CStr, ffi::CString, + fs::File, io::{self, Read, Seek, SeekFrom, Write}, mem, os::raw::{c_char, c_int, c_uint}, @@ -134,7 +135,7 @@ impl SpirvModule { } #[cfg(not(target_os = "linux"))] - fn compile_amd( + fn compile_amd1( device_name: &str, spirv_il: &[u8], ptx_lib: Option<(&'static [u8], &'static [u8])>, @@ -206,7 +207,7 @@ impl SpirvModule { let status = compiler_cmd.status()?; assert!(status.success()); let mut result = Vec::new(); - compiled_binary.seek(SeekFrom::Start(0))?; + let mut compiled_binary = File::open(compiled_binary.path())?; compiled_binary.read_to_end(&mut result)?; Ok(result) } |