summaryrefslogtreecommitdiff
path: root/src/ast
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/ast
parentfc4abb77ecab8fe3c497e13d7f7d6d8f832514b2 (diff)
CUDA Interop, baby.
Diffstat (limited to 'src/ast')
-rw-r--r--src/ast/ast.h16
1 files changed, 15 insertions, 1 deletions
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;
};
};