CUDASafety-1.2ΒΆ
Do not use ASM declarations in device code
Required inputs: IR
CUDA SAFETY 1.2 [safety.inline_ptx] Do not use ASM declarations in device code
Asm declarations and extended asm declarations shall not be used in device code.
Scope: Device.
Audience: CUDA C++.
Category: Mandatory.
Hardware Applicability: All Compute Capabilities.
Rationale
PTX ASM instructions are not supported in the safety subset.
Example 1 (Bad)
__global__ void kernel() { asm("trap;"); // Non-compliant: use of asm declaration in device code. }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 |
|---|---|---|---|
asm_in_device_code |
Do not use ASM declarations in device code |
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
This rule has no individual options.