HIP Source Backend¶
HIP Backend for CrossGL Translator
HIP AST Node definitions
- class crosstl.backend.HIP.HipAst.AtomicOperationNode(operation, args)[source]¶
Bases:
FunctionCallNodeNode representing a HIP atomic operation
- class crosstl.backend.HIP.HipAst.ConstantMemoryNode(vtype, name, value=None)[source]¶
Bases:
VariableNodeNode representing constant memory variable declaration
- class crosstl.backend.HIP.HipAst.HipBuiltinNode(builtin_name, component=None)[source]¶
Bases:
ASTNodeNode representing HIP built-in variables (threadIdx, hipThreadIdx_x, etc.)
- class crosstl.backend.HIP.HipAst.HipDevicePropertyNode(property_name, device_id=None)[source]¶
Bases:
ASTNodeNode representing HIP device property access
- class crosstl.backend.HIP.HipAst.HipErrorHandlingNode(error_type, error_expr)[source]¶
Bases:
ASTNodeNode representing HIP error handling (hipError_t, hipGetErrorString, etc.)
- class crosstl.backend.HIP.HipAst.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.HIP.HipAst.KernelNode(return_type, name, params, body, attributes=None)[source]¶
Bases:
FunctionNodeNode representing a HIP kernel function (marked with __global__)
Bases:
VariableNodeNode representing shared memory variable declaration
- class crosstl.backend.HIP.HipAst.TextureAccessNode(texture_name, coordinates)[source]¶
Bases:
ASTNodeNode representing texture memory access
Lexer for importing HIP source into CrossGL Translator.
- class crosstl.backend.HIP.HipLexer.HipLexer(code)[source]¶
Bases:
objectTokenize HIP source for the HIP backend parser.
- class crosstl.backend.HIP.HipLexer.Token(token_type, value, line=1, column=1)[source]¶
Bases:
objectToken object carrying HIP token type, text, and source location.
- crosstl.backend.HIP.HipLexer.parse_hip_code(code)[source]¶
Parse HIP source text and return the backend AST.
HIP Parser for converting HIP tokens to AST
- class crosstl.backend.HIP.HipParser.HipParser(tokens)[source]¶
Bases:
objectParse HIP tokens into the HIP backend AST.
- class crosstl.backend.HIP.HipParser.HipProgramNode(statements=None)[source]¶
Bases:
ASTNodeRoot node representing a complete HIP program
- crosstl.backend.HIP.HipParser.parse_hip_code(code)[source]¶
Parse HIP source text and return the backend AST.
- Return type:
HIP to CrossGL Code Generator
- class crosstl.backend.HIP.HipCrossGLCodeGen.HipToCrossGLConverter[source]¶
Bases:
objectSerialize HIP backend AST nodes back into CrossGL source.
- convert_hip_builtin_function(func_name)[source]¶
Convert HIP built-in functions to CrossGL equivalents.
- convert_hip_pointer_type(hip_type)[source]¶
Convert a HIP pointer type into nested CrossGL pointer syntax.