Spectral LLVM diagnostics

C++ family

This section describes new or enhanced diagnostics that apply to all C++ family code.

Improved diagnostic readability

CUDA

This section describes new or enhanced diagnostics that apply to CUDA code and SCALE code.

-fcuda-remarks

Enables a set of diagnostics that are useful for optimizing GPU programs. It turns on remarks to tell the user about:

-Wcuda-attribute-ignored

Warns when attributes that apply to CUDA code, such as kernels, are ignored. For example where __host__ or __device__ is applied to a defaulted method (since this is automatically the case).

-Wcuda-external-static-member-variable

C++17 static inline member variables. This allows a static member variable to be defined (not just declared) in a class body. This avoids the need for a separate definition outside the class. For GPU code, this allows, for example:

class C
{
    static inline __shared__ int sharedCount;
};

In GPU code, it is rare to reference a variable from another translation unit. This means that a device-side static member variable that is neither defined in the same translation unit as the class, nor marked inline is probably a mistake. This warning alerts the programmer to such a mistake.

-Wcuda-function-arguments

This diagnostic prints warnings about bad arguments to certain CUDA language functions and intrinsics. This section documents the functions for which warnings can be generated.

__shfl and friends

The diagnostic checks that the warp size is in range and is a power of two. It supports the following functions: