CUDADirective-1.1

Use standardized CUDA file extensions

Required inputs: IR

CUDA DIRECTIVE 1.1 [file.extensions] Use standardized CUDA file extensions

Use the standardized file extensions for all CUDA files. - .cu - CUDA source files. - .cuh - CUDA header files. (By convention) - .ptx - CUDA assembly files. - .cubin - CUDA device code binary files. - .fatbin - CUDA file that may contain multiple PTX and CUBIN files.

Scope: Device.
Audience: CUDA C++, CUDA Libraries.
Hardware Applicability: All Compute Capabilities.
Rationale

This rule adds the standardized set of file extensions to the safety subset to encourage developers to follow these conventions and to suggest that tools enforcing the rules should not complain about the use of these file extensions.

Examples

N/A

Excerpt from NVIDIA CUDA C++ Guidelines for robust and safety-critical programming, Version 3.0.1, Copyright (C) 2018-2023 NVIDIA Corporation.

Possible Messages

Key

Text

Severity

Disabled

cuda_in_wrong_filetype

CUDA call in file with wrong extension.

None

False

Options

allowed_extensions

allowed_extensions : set[str] = {'.cu', '.cubin', '.cuh', '.fatbin', '.ptx'}

Which file extensions are allowed.