aboutsummaryrefslogtreecommitdiffhomepage
path: root/ptx
diff options
context:
space:
mode:
authorAndrzej Janik <[email protected]>2021-09-18 20:22:47 +0000
committerAndrzej Janik <[email protected]>2021-09-18 20:22:47 +0000
commit04a411fe2272a21c687766d7ff94431b93bb090b (patch)
treef7fa6bd31b56edc45f2798a1a79a628c1ee56764 /ptx
parentccf3c02ac16d4cace2a3b6a26529c995f6798305 (diff)
downloadZLUDA-04a411fe2272a21c687766d7ff94431b93bb090b.tar.gz
ZLUDA-04a411fe2272a21c687766d7ff94431b93bb090b.zip
Have an implementation for vprintf
Diffstat (limited to 'ptx')
-rw-r--r--ptx/lib/zluda_ptx_impl.bcbin33884 -> 34052 bytes
-rw-r--r--ptx/lib/zluda_ptx_impl.cl7
-rw-r--r--ptx/src/translate.rs6
3 files changed, 11 insertions, 2 deletions
diff --git a/ptx/lib/zluda_ptx_impl.bc b/ptx/lib/zluda_ptx_impl.bc
index e2f956d..2d194c4 100644
--- a/ptx/lib/zluda_ptx_impl.bc
+++ b/ptx/lib/zluda_ptx_impl.bc
Binary files differ
diff --git a/ptx/lib/zluda_ptx_impl.cl b/ptx/lib/zluda_ptx_impl.cl
index 0870fb5..86bb593 100644
--- a/ptx/lib/zluda_ptx_impl.cl
+++ b/ptx/lib/zluda_ptx_impl.cl
@@ -335,3 +335,10 @@ void FUNC(__assertfail)(
__attribute__((unused)) __private ulong* charSize
) {
}
+
+uint FUNC(vprintf)(
+ __attribute__((unused)) __generic void* format,
+ __attribute__((unused)) __generic void* valist
+) {
+ return 0;
+}
diff --git a/ptx/src/translate.rs b/ptx/src/translate.rs
index 66fae15..297588a 100644
--- a/ptx/src/translate.rs
+++ b/ptx/src/translate.rs
@@ -1163,9 +1163,11 @@ fn translate_function<'input, 'a>(
) -> Result<Option<Function<'input>>, TranslateError> {
let import_as = match &f.func_directive {
ast::MethodDeclaration {
- name: ast::MethodName::Func("__assertfail"),
+ name: ast::MethodName::Func(func_name),
..
- } => Some("__zluda_ptx_impl____assertfail".to_owned()),
+ } if *func_name == "__assertfail" || *func_name == "vprintf" => {
+ Some([ZLUDA_PTX_PREFIX, func_name].concat())
+ }
_ => None,
};
let (str_resolver, fn_resolver, fn_decl) = id_defs.start_fn(&f.func_directive)?;