summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics/cuda-kernel-non-void-return.slang
blob: 75c8bc6d4cd180362c41ed1f0f91d6d9a149cc6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):

// Simple check to see if the compiler throws an error if a CUDA kernel is declared with non-void return type.

[CudaKernel]
float myBadKernel(TensorView<float> t1, TensorView<float> t2)
{
    // CHECK:      tests/diagnostics/cuda-kernel-non-void-return.slang([[@LINE-2]]): error 31213: return type of a CUDA kernel function cannot be non-void.
    // CHECK-NEXT:     float myBadKernel(TensorView<float> t1, TensorView<float> t2)
    // CHECK-NEXT:           ^~~~~~~~~~~
}

[CudaKernel]
void myGoodKernel(TensorView<float> t1, TensorView<float> t2)
{

}