IMPROPER_GPU_KERNEL_ARG

Static IMPROPER_GPU_KERNEL_ARG 

Source
static IMPROPER_GPU_KERNEL_ARG: &Lint
Expand description

The improper_gpu_kernel_arg lint detects incorrect use of types in gpu-kernel arguments.

§Example

#[unsafe(no_mangle)]
extern "gpu-kernel" fn kernel(_: [i32; 10]) {}

This will produce:

warning: passing type `[i32; 10]` to a function with "gpu-kernel" ABI may have unexpected behavior
 --> t.rs:2:34
  |
2 | extern "gpu-kernel" fn kernel(_: [i32; 10]) {}
  |                                  ^^^^^^^^^
  |
  = help: use primitive types and raw pointers to get reliable behavior
  = note: `#[warn(improper_gpu_kernel_arg)]` on by default

§Explanation

The compiler has several checks to verify that types used as arguments in gpu-kernel functions follow certain rules to ensure proper compatibility with the foreign interfaces. This lint is issued when it detects a probable mistake in a signature.