CUDA-1.9ΒΆ
Kernel parameters passed by reference should be managed storage duration objects
Required inputs: IR
CUDA 1.9 [kernel-launch.parameter.reference] Kernel parameters passed by reference should be managed storage duration objects
Any parameter passed by reference to a kernel launch made from the host should have managed storage
duration (e.g. __managed__ or managed by unified virtual memory).
Scope: Host, Device.
Audience: CUDA C++.
Category: Required.
Hardware Applicability: All Compute Capabilities.
Rationale
The host can only ODR-use host-private objects and objects with managed storage duration. Only objects with managed storage duration may be ODR-used from devices; passing a host-private object by reference to a device will lead to undefined behavior if that host-private object is ODR-used on the device.
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_kernel_launch_parameter_reference |
Kernel parameters passed by reference should be managed storage duration objects |
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.