yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Sai Praveen BangaruAdded diagnostics & built-in type lowering for `[CUDAKernel]` functions (#4042)52b91231c

master
597 B17 linesraw
1//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):
2
3// Simple check to see if the compiler throws an error if a CUDA kernel is declared with non-void return type.
4
5[CudaKernel]
6float myBadKernel(TensorView<float> t1, TensorView<float> t2)
7{
8    // CHECK:      tests/diagnostics/cuda-kernel-non-void-return.slang([[@LINE-2]]): error 31213: return type of a CUDA kernel function cannot be non-void.
9    // CHECK-NEXT:     float myBadKernel(TensorView<float> t1, TensorView<float> t2)
10    // CHECK-NEXT:           ^~~~~~~~~~~
11}
12
13[CudaKernel]
14void myGoodKernel(TensorView<float> t1, TensorView<float> t2)
15{
16
17}