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¶
This rule shares the following common options: exclude_in_macros, exclude_messages_in_system_headers, excludes, extend_exclude_to_macro_invocations, includes, justification_checker, languages, post_processing, provider, report_at, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
allowed_extensions¶
allowed_extensions : set[str] = {'.cu', '.cubin', '.cuh', '.fatbin', '.ptx'}