CUDA-4.2ΒΆ

Never invoke a non-kernel with a configuration

Required inputs: IR

CUDA 4.2 [kernel.configured_call] Never invoke a non-kernel with a configuration

The postfix expression of configured calls must always refer to a global function.

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

Non global functions will not be properly compiled to execute on the device. Calling these functions using the postfix expression of configured calls will result in an incorrect kernel invocation.

Example 1 (Bad)
void not_a_kernel();

int main() {
  auto pfn = &not_a_kernel;
  pfn<<<1,1>>>(); // Non-compliant: configured call does not refer to a
// __global__ function.
}
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_configured_call

Never invoke a non-kernel with a configuration

None

False

Options