From 889e7f2c5c538d723101d02647b98e17222a03f1 Mon Sep 17 00:00:00 2001 From: Timo Rothenpieler Date: Wed, 14 May 2025 22:08:33 +0200 Subject: [PATCH] compat/cuda: add device side printf function --- compat/cuda/cuda_runtime.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compat/cuda/cuda_runtime.h b/compat/cuda/cuda_runtime.h index 699c4b6c75..7614233eaf 100644 --- a/compat/cuda/cuda_runtime.h +++ b/compat/cuda/cuda_runtime.h @@ -189,4 +189,7 @@ static inline __device__ float __cosf(float a) { return __nvvm_cos_approx_f(a); static inline __device__ float __expf(float a) { return __nvvm_ex2_approx_f(a * (float)__builtin_log2(__builtin_exp(1))); } static inline __device__ float __powf(float a, float b) { return __nvvm_ex2_approx_f(__nvvm_lg2_approx_f(a) * b); } +// Misc helper functions +extern "C" __device__ int printf(const char*, ...); + #endif /* COMPAT_CUDA_CUDA_RUNTIME_H */