CUDA Source Backend¶
CUDA source backend exports for CrossGL Translator.
CUDA AST Node definitions
- class crosstl.backend.CUDA.CudaAst.AtomicOperationNode(operation, args)[source]¶
Bases:
FunctionCallNodeNode representing a CUDA atomic operation
- class crosstl.backend.CUDA.CudaAst.ConstantMemoryNode(vtype, name, value=None)[source]¶
Bases:
VariableNodeNode representing constant memory variable declaration
- class crosstl.backend.CUDA.CudaAst.CudaBuiltinNode(builtin_name, component=None)[source]¶
Bases:
ASTNodeNode representing CUDA built-in variables (threadIdx, blockIdx, etc.)
- class crosstl.backend.CUDA.CudaAst.KernelLaunchNode(kernel_name, blocks, threads, shared_mem=None, stream=None, args=None)[source]¶
Bases:
ASTNodeNode representing a kernel launch: kernel<<<blocks, threads>>>(args)
- class crosstl.backend.CUDA.CudaAst.KernelNode(return_type, name, params, body, attributes=None)[source]¶
Bases:
FunctionNodeNode representing a CUDA kernel function (marked with __global__)
Bases:
VariableNodeNode representing shared memory variable declaration
- class crosstl.backend.CUDA.CudaAst.TextureAccessNode(texture_name, coordinates)[source]¶
Bases:
ASTNodeNode representing texture memory access
Lexer for importing CUDA source into CrossGL Translator.
- class crosstl.backend.CUDA.CudaLexer.CudaLexer(code)[source]¶
Bases:
objectTokenize CUDA source for the CUDA backend parser.
- class crosstl.backend.CUDA.CudaLexer.Lexer(input_str)[source]¶
Bases:
objectCompatibility wrapper around CudaLexer
- class crosstl.backend.CUDA.CudaLexer.TokenType(value)[source]¶
Bases:
EnumToken names emitted by the CUDA lexer.
CUDA Parser Implementation
- class crosstl.backend.CUDA.CudaParser.CudaParser(tokens)[source]¶
Bases:
objectParse CUDA tokens into the CUDA backend shader AST.
- is_range_for_statement()[source]¶
Check if the current parenthesized for header is a range-for loop.
CUDA to CrossGL Code Generator
- class crosstl.backend.CUDA.CudaCrossGLCodeGen.CudaToCrossGLConverter[source]¶
Bases:
objectSerialize CUDA backend AST nodes back into CrossGL source.
- convert_cuda_builtin_function(func_name)[source]¶
Convert CUDA built-in functions to CrossGL equivalents.