mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-04-19 16:04:44 +00:00
zoc: Refactoring
This commit is contained in:
parent
8c72eae6ba
commit
c6f240e78d
1 changed files with 2 additions and 6 deletions
|
@ -52,7 +52,7 @@ fn ptx_to_llvm(ptx: &str) -> Result<LLVMArtifacts, Box<dyn Error>> {
|
|||
Ok(LLVMArtifacts { bitcode, linked_bitcode, llvm_ir })
|
||||
}
|
||||
|
||||
fn llvm_to_elf(module: &LLVMArtifacts) -> Result<Vec<u8>, ElfError> {
|
||||
fn llvm_to_elf(llvm: &LLVMArtifacts) -> Result<Vec<u8>, ElfError> {
|
||||
use hip_runtime_sys::*;
|
||||
unsafe { hipInit(0) }?;
|
||||
let mut dev_props: MaybeUninit<hipDeviceProp_tR0600> = MaybeUninit::uninit();
|
||||
|
@ -60,11 +60,7 @@ fn llvm_to_elf(module: &LLVMArtifacts) -> Result<Vec<u8>, ElfError> {
|
|||
let dev_props = unsafe { dev_props.assume_init() };
|
||||
let gcn_arch = unsafe { CStr::from_ptr(dev_props.gcnArchName.as_ptr()) };
|
||||
|
||||
comgr::compile_bitcode(
|
||||
gcn_arch,
|
||||
&module.bitcode,
|
||||
&module.linked_bitcode,
|
||||
).map_err(ElfError::from)
|
||||
comgr::compile_bitcode(gcn_arch, &llvm.bitcode, &llvm.linked_bitcode).map_err(ElfError::from)
|
||||
}
|
||||
|
||||
fn write_to_file(content: &[u8], path: &Path) -> io::Result<()> {
|
||||
|
|
Loading…
Add table
Reference in a new issue