mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-10-01 21:59:38 +00:00
No-op implementation of vprintf (#527)
This commit is contained in:
parent
5d03261457
commit
93eebdf298
4 changed files with 10 additions and 1 deletions
Binary file not shown.
|
@ -855,4 +855,12 @@ 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2869,6 +2869,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