From 8401c970ece366592dcbfaa0affe1a1a1bc18ac8 Mon Sep 17 00:00:00 2001 From: Zuhaitz Méndez Fernández de Aránguiz Date: Sun, 18 Jan 2026 19:54:32 +0000 Subject: CUDA Interop, baby. --- src/codegen/codegen_utils.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/codegen/codegen_utils.c') diff --git a/src/codegen/codegen_utils.c b/src/codegen/codegen_utils.c index b1fcf4c..af1c862 100644 --- a/src/codegen/codegen_utils.c +++ b/src/codegen/codegen_utils.c @@ -535,6 +535,23 @@ void emit_func_signature(FILE *out, ASTNode *func, const char *name_override) return; } + // Emit CUDA qualifiers (for both forward declarations and definitions) + if (g_config.use_cuda) + { + if (func->func.cuda_global) + { + fprintf(out, "__global__ "); + } + if (func->func.cuda_device) + { + fprintf(out, "__device__ "); + } + if (func->func.cuda_host) + { + fprintf(out, "__host__ "); + } + } + // Return type char *ret_str; if (func->func.ret_type_info) -- cgit v1.2.3