Skip to main content

Module loops

Module loops 

Source
Expand description

Loop transpilation helpers for CUDA code generation.

This module provides utilities for transpiling Rust loop constructs to their CUDA C equivalents.

§Supported Loop Types

  • for i in start..endfor (int i = start; i < end; i++)
  • for i in start..=endfor (int i = start; i <= end; i++)
  • while conditionwhile (condition)
  • loopwhile (true) or for (;;)

§Control Flow

  • breakbreak;
  • continuecontinue;
  • break 'label → Not yet supported (would require goto)

Structs§

RangeInfo
Information about a parsed range expression.

Enums§

LoopPattern
Represents different loop patterns that can be transpiled.

Functions§

extract_loop_var
Extract the loop variable name from a for loop pattern.
infer_loop_var_type
Determine the appropriate CUDA type for a loop variable.
is_range_expr
Check if an expression is a simple range (start..end or start..=end).