mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-08-08 09:09:49 +00:00
Explicitly mark input to AMD as bitcode
This commit is contained in:
parent
4b4ba90219
commit
5969e59aae
1 changed files with 4 additions and 0 deletions
|
@ -196,6 +196,8 @@ impl SpirvModule {
|
||||||
.arg(Self::AMDGPU_TARGET)
|
.arg(Self::AMDGPU_TARGET)
|
||||||
.arg("-o")
|
.arg("-o")
|
||||||
.arg(compiled_binary.path())
|
.arg(compiled_binary.path())
|
||||||
|
.arg("-x")
|
||||||
|
.arg("ir")
|
||||||
.arg(linked_binary.path());
|
.arg(linked_binary.path());
|
||||||
if let Some((_, bitcode)) = ptx_lib {
|
if let Some((_, bitcode)) = ptx_lib {
|
||||||
ptx_lib_bitcode.write_all(bitcode)?;
|
ptx_lib_bitcode.write_all(bitcode)?;
|
||||||
|
@ -211,6 +213,7 @@ impl SpirvModule {
|
||||||
let mut compiled_binary = File::open(compiled_bin_path)?;
|
let mut compiled_binary = File::open(compiled_bin_path)?;
|
||||||
compiled_binary.read_to_end(&mut result)?;
|
compiled_binary.read_to_end(&mut result)?;
|
||||||
let mut persistent = PathBuf::from("/tmp/zluda");
|
let mut persistent = PathBuf::from("/tmp/zluda");
|
||||||
|
std::fs::create_dir_all(&persistent)?;
|
||||||
persistent.push(compiled_bin_path.file_name().unwrap());
|
persistent.push(compiled_bin_path.file_name().unwrap());
|
||||||
std::fs::copy(compiled_bin_path, persistent)?;
|
std::fs::copy(compiled_bin_path, persistent)?;
|
||||||
Ok(result)
|
Ok(result)
|
||||||
|
@ -300,6 +303,7 @@ impl SpirvModule {
|
||||||
assert_eq!(errcode_ret, 0, "clCreateProgramWithBinary");
|
assert_eq!(errcode_ret, 0, "clCreateProgramWithBinary");
|
||||||
unsafe { ocl_core::Program::from_raw_create_ptr(program) }
|
unsafe { ocl_core::Program::from_raw_create_ptr(program) }
|
||||||
} else {
|
} else {
|
||||||
|
Self::compile_amd("gfx1011:xnack-", byte_il, self.should_link_ptx_impl).unwrap();
|
||||||
Self::compile_intel(
|
Self::compile_intel(
|
||||||
ctx,
|
ctx,
|
||||||
dev,
|
dev,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue