mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-09-27 11:49:04 +00:00
No-op implementation of vprintf
This should be replaced later, possibly with an SSA pass.
This commit is contained in:
parent
93820e3159
commit
09e42ce4ed
4 changed files with 13 additions and 1 deletions
Binary file not shown.
|
@ -842,4 +842,14 @@ typedef uint32_t ShflSyncResult __attribute__((ext_vector_type(2)));
|
|||
|
||||
return output.u32;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int FUNC(vprintf)(const char *format __attribute__((unused)), void *vlist __attribute__((unused)))
|
||||
{
|
||||
// TODO: replace calls to vprintf with a raising pass to printf when we have a mechanism
|
||||
// to write SSA passes
|
||||
// Use https://github.com/ROCm/llvm-project/blob/99a81d16b9d811cadd420190bed16981a0a57bc6/llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp#L426
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,6 +72,7 @@ pub(crate) fn run<'input>(
|
|||
}
|
||||
}
|
||||
if let Err(err) = module.verify() {
|
||||
eprintln!("{}", module.print_module_to_string().to_str());
|
||||
panic!("{:?}", err);
|
||||
}
|
||||
Ok(module)
|
||||
|
@ -2853,6 +2854,7 @@ impl<'a> MethodEmitContext<'a> {
|
|||
|
||||
fn emit_trap(&mut self) -> Result<(), TranslateError> {
|
||||
self.emit_intrinsic(c"llvm.trap", None, None, vec![])?;
|
||||
unsafe { LLVMBuildUnreachable(self.builder) };
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ fn replace_with_ptx_impl<'input>(
|
|||
resolver: &mut GlobalStringIdentResolver2<'input>,
|
||||
fn_name: SpirvWord,
|
||||
) {
|
||||
let known_names = ["__assertfail"];
|
||||
let known_names = ["__assertfail", "vprintf"];
|
||||
if let Some(super::IdentEntry {
|
||||
name: Some(name), ..
|
||||
}) = resolver.ident_map.get_mut(&fn_name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue