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/ast/ast.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/ast') diff --git a/src/ast/ast.h b/src/ast/ast.h index 2288860..cef68c6 100644 --- a/src/ast/ast.h +++ b/src/ast/ast.h @@ -122,7 +122,8 @@ typedef enum NODE_TRY, NODE_REFLECTION, NODE_AWAIT, - NODE_REPL_PRINT + NODE_REPL_PRINT, + NODE_CUDA_LAUNCH } NodeType; // ** AST Node Structure ** @@ -176,6 +177,10 @@ struct ASTNode char *section; // @section("name") int is_async; // async function int is_comptime; // @comptime function + // CUDA qualifiers + int cuda_global; // @global -> __global__ + int cuda_device; // @device -> __device__ + int cuda_host; // @host -> __host__ } func; struct @@ -539,6 +544,15 @@ struct ASTNode { ASTNode *expr; } repl_print; + + struct + { + ASTNode *call; // The kernel call (NODE_EXPR_CALL) + ASTNode *grid; // Grid dimensions expression + ASTNode *block; // Block dimensions expression + ASTNode *shared_mem; // Optional shared memory size (NULL = default) + ASTNode *stream; // Optional CUDA stream (NULL = default) + } cuda_launch; }; }; -- cgit v1.2.3