aboutsummaryrefslogtreecommitdiffhomepage
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
parentccf3c02ac16d4cace2a3b6a26529c995f6798305 (diff)
downloadZLUDA-04a411fe2272a21c687766d7ff94431b93bb090b.tar.gz
ZLUDA-04a411fe2272a21c687766d7ff94431b93bb090b.zip
Have an implementation for vprintf
-rw-r--r--README.md4
-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
4 files changed, 13 insertions, 4 deletions
diff --git a/README.md b/README.md
index 953c7c7..42d0b92 100644
--- a/README.md
+++ b/README.md
@@ -76,8 +76,8 @@ You should install most recent run-time an developer driver packages as outlined
If you are building on Linux you must also symlink (or rename) the ZLUDA output binaries after ZLUDA build finishes:
```
ln -s libnvcuda.so target/release/libcuda.so
-ln -s libcuda.so target/release/libcuda.so.1
-ln -s libnvidia-ml.so target/release/libnvml.so
+ln -s libnvcuda.so target/release/libcuda.so.1
+ln -s libnvml.so target/release/libnvidia-ml.so
```
## Contributing
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)?;