cuda.core.experimental.Program

class cuda.core.experimental.Program(code, code_type)

Represent a compilation machinery to process programs into ObjectCode.

This object provides a unified interface to multiple underlying compiler libraries. Compilation support is enabled for a wide range of code types and compilation types.

Parameters:
  • code (Any) – String of the CUDA Runtime Compilation program.

  • code_type (Any) – String of the code type. Currently only "c++" is supported.

Methods

__init__(code, code_type)
close()

Destroy this program.

compile(target_type, options=(), name_expressions=(), logs=None)

Compile the program with a specific compilation type.

Parameters:
  • target_type (Any) – String of the targeted compilation type. Supported options are “ptx”, “cubin” and “ltoir”.

  • options (Union[List, Tuple], optional) – List of compilation options associated with the backend of this Program. (Default to no options)

  • name_expressions (Union[List, Tuple], optional) – List of explicit name expressions to become accessible. (Default to no expressions)

  • logs (Any, optional) – Object with a write method to receive the logs generated from compilation. (Default to no logs)

Returns:

Newly created code object.

Return type:

ObjectCode

Attributes

backend

Return the backend type string associated with this program.

handle

Return the program handle object.