Have an implementation for vprintf

This commit is contained in:
Andrzej Janik 2021-09-18 20:22:47 +00:00
parent ccf3c02ac1
commit 04a411fe22
4 changed files with 13 additions and 4 deletions

View file

@ -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

Binary file not shown.

View file

@ -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;
}

View file

@ -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)?;