blob: 0e7604b3de8892269fed2e9983d7ed859c1d9533 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
//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]
[Differentiable]
void myBadKernel(float x, TensorView<float> t1, TensorView<float> t2)
{
// CHECK: tests/diagnostics/cuda-kernel-differentiable-params.slang([[@LINE-2]]): error 31214: differentiable kernel entry point cannot have differentiable parameters. Consider using DiffTensorView to pass differentiable data, or marking this parameter with 'no_diff'
// CHECK-NEXT: void myBadKernel(float x, TensorView<float> t1, TensorView<float> t2)
// CHECK-NEXT: ^
}
[CudaKernel]
void myGoodKernel(float x, TensorView<float> t1, TensorView<float> t2)
{
}
|