summaryrefslogtreecommitdiff
path: root/src/codegen/codegen_utils.c
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-18 19:54:32 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-18 19:54:32 +0000
commit8401c970ece366592dcbfaa0affe1a1a1bc18ac8 (patch)
treea83b2864e51782ae9a186b27fa6124eae8422357 /src/codegen/codegen_utils.c
parentfc4abb77ecab8fe3c497e13d7f7d6d8f832514b2 (diff)
CUDA Interop, baby.
Diffstat (limited to 'src/codegen/codegen_utils.c')
-rw-r--r--src/codegen/codegen_utils.c17
1 files changed, 17 insertions, 0 deletions
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)