CLI Reference#

cutile-basic provides a command-line interface for compiling BASIC source files.

Usage#

python -m cutile_basic.cli [options] <input.bas>

Arguments#

Argument

Description

input

Input .bas file (required)

Options#

Option

Description

-o, --output FILE

Write the compiled .cubin to FILE. If omitted, the path to the .cubin is printed to stdout.

--dump-tokens

Dump the token stream and exit.

--dump-ast

Dump the parsed AST and exit.

--dump-analyzed

Dump the analyzed program (symbols, types, metadata) and exit.

--gpu-arch ARCH

GPU architecture for compilation (e.g. sm_120). Default: auto-detect.

Examples#

Compile and print the path to the .cubin:

python -m cutile_basic.cli examples/vector_add.bas

Write the .cubin to a file:

python -m cutile_basic.cli examples/vector_add.bas -o vector_add.cubin

Inspect the token stream:

python -m cutile_basic.cli examples/hello.bas --dump-tokens

Inspect the AST:

python -m cutile_basic.cli examples/hello.bas --dump-ast

Compile to cubin with an explicit GPU architecture:

python -m cutile_basic.cli examples/vector_add.bas --gpu-arch sm_120 -o vector_add.cubin