CUDA-1.13ΒΆ
No thread_local storage duration objects in device code
Required inputs: IR
CUDA 1.13 [storage.thread_local] No thread_local storage duration objects in device code
The thread_local storage duration specifier should not be used in device code.
Scope: Device.
Audience: CUDA C++.
Category: Mandatory.
Hardware Applicability: All Compute Capabilities.
Rational The thread_local duration specifier is not supported on device variables.
Example 1 (Bad)
__device__ thread_local int x; // Non-compliant: device variable cannot have // thread-local storage.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 |
|---|---|---|---|
thread_local_used_in_device_code |
Thread-local storage duration object 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.