diff options
| author | jarcherNV <jarcher@nvidia.com> | 2025-08-12 11:19:15 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-12 18:19:15 +0000 |
| commit | 3618f7a4c35de32405e6ebe458bae835869e2876 (patch) | |
| tree | 97b259f79b19cdcd3d68c0443a18c7034ae9d645 | |
| parent | 719ecf3bf6ce50a8f1d02c6f96ae65e6f492321a (diff) | |
Enable CUDA testing for batch 2 (#8147)
Enable CUDA for the tests listed in issue #8078
This requires a minor CUDA prelude change, adding some math functions.
| -rw-r--r-- | prelude/slang-cpp-scalar-intrinsics.h | 12 | ||||
| -rw-r--r-- | prelude/slang-cuda-prelude.h | 12 | ||||
| -rw-r--r-- | tests/autodiff-dstdlib/dstdlib-inverse-hyperbolic.slang | 1 | ||||
| -rw-r--r-- | tests/autodiff/custom-diff-empty-func.slang | 1 | ||||
| -rw-r--r-- | tests/autodiff/deduplicate-witness-table.slang | 1 | ||||
| -rw-r--r-- | tests/autodiff/differentiable-constructor.slang | 1 | ||||
| -rw-r--r-- | tests/autodiff/differential-type-syntheize-diagnostics.slang | 1 | ||||
| -rw-r--r-- | tests/autodiff/dont-warn-on-simple-prefer-recompute.slang | 1 |
8 files changed, 30 insertions, 0 deletions
diff --git a/prelude/slang-cpp-scalar-intrinsics.h b/prelude/slang-cpp-scalar-intrinsics.h index 731fd02be..f65fa90a2 100644 --- a/prelude/slang-cpp-scalar-intrinsics.h +++ b/prelude/slang-cpp-scalar-intrinsics.h @@ -261,6 +261,18 @@ SLANG_FORCE_INLINE float F32_tanh(float f) { return ::tanhf(f); } +SLANG_FORCE_INLINE float F32_asinh(float f) +{ + return ::asinhf(f); +} +SLANG_FORCE_INLINE float F32_acosh(float f) +{ + return ::acoshf(f); +} +SLANG_FORCE_INLINE float F32_atanh(float f) +{ + return ::atanhf(f); +} SLANG_FORCE_INLINE float F32_log2(float f) { return ::log2f(f); diff --git a/prelude/slang-cuda-prelude.h b/prelude/slang-cuda-prelude.h index c366ae856..9df2727f6 100644 --- a/prelude/slang-cuda-prelude.h +++ b/prelude/slang-cuda-prelude.h @@ -1792,6 +1792,18 @@ SLANG_FORCE_INLINE SLANG_CUDA_CALL float F32_tanh(float f) { return ::tanhf(f); } +SLANG_FORCE_INLINE SLANG_CUDA_CALL float F32_asinh(float f) +{ + return ::asinhf(f); +} +SLANG_FORCE_INLINE SLANG_CUDA_CALL float F32_acosh(float f) +{ + return ::acoshf(f); +} +SLANG_FORCE_INLINE SLANG_CUDA_CALL float F32_atanh(float f) +{ + return ::atanhf(f); +} SLANG_FORCE_INLINE SLANG_CUDA_CALL float F32_log2(float f) { return ::log2f(f); diff --git a/tests/autodiff-dstdlib/dstdlib-inverse-hyperbolic.slang b/tests/autodiff-dstdlib/dstdlib-inverse-hyperbolic.slang index c7c59ff49..7316e3be8 100644 --- a/tests/autodiff-dstdlib/dstdlib-inverse-hyperbolic.slang +++ b/tests/autodiff-dstdlib/dstdlib-inverse-hyperbolic.slang @@ -1,5 +1,6 @@ //TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK):-vk -compute -shaderobj -output-using-type //TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK):-slang -compute -dx12 -use-dxil -shaderobj -output-using-type +//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK):-cuda -compute -shaderobj -output-using-type //TEST_INPUT:ubuffer(data=[0 0 0 0 0 0], stride=4):out,name=outputBuffer RWStructuredBuffer<float> outputBuffer; diff --git a/tests/autodiff/custom-diff-empty-func.slang b/tests/autodiff/custom-diff-empty-func.slang index c566d9e19..153ba17ce 100644 --- a/tests/autodiff/custom-diff-empty-func.slang +++ b/tests/autodiff/custom-diff-empty-func.slang @@ -1,4 +1,5 @@ //TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK):-slang -compute -shaderobj -output-using-type -g0 +//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK):-cuda -compute -shaderobj -output-using-type -g0 //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer RWStructuredBuffer<float> outputBuffer; diff --git a/tests/autodiff/deduplicate-witness-table.slang b/tests/autodiff/deduplicate-witness-table.slang index ea4c4e730..6b1435e5b 100644 --- a/tests/autodiff/deduplicate-witness-table.slang +++ b/tests/autodiff/deduplicate-witness-table.slang @@ -1,4 +1,5 @@ //TEST:SIMPLE(filecheck=CHK):-stage compute -entry computeMain -target hlsl +//TEST:SIMPLE(filecheck=CHK):-target cuda -line-directive-mode none //CHK: struct DiffPair_1 //CHK-NOT: struct DiffPair_2 diff --git a/tests/autodiff/differentiable-constructor.slang b/tests/autodiff/differentiable-constructor.slang index 8528f3792..857bdb659 100644 --- a/tests/autodiff/differentiable-constructor.slang +++ b/tests/autodiff/differentiable-constructor.slang @@ -1,5 +1,6 @@ //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -shaderobj -output-using-type //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -vk -shaderobj -output-using-type +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -cuda -shaderobj -output-using-type //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer RWStructuredBuffer<float> outputBuffer; diff --git a/tests/autodiff/differential-type-syntheize-diagnostics.slang b/tests/autodiff/differential-type-syntheize-diagnostics.slang index f8663a5a1..3ca385177 100644 --- a/tests/autodiff/differential-type-syntheize-diagnostics.slang +++ b/tests/autodiff/differential-type-syntheize-diagnostics.slang @@ -1,4 +1,5 @@ //DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -target cuda -line-directive-mode none struct PartlyDiffable : IDifferentiable { diff --git a/tests/autodiff/dont-warn-on-simple-prefer-recompute.slang b/tests/autodiff/dont-warn-on-simple-prefer-recompute.slang index c1c4d7d70..2a9b9eab0 100644 --- a/tests/autodiff/dont-warn-on-simple-prefer-recompute.slang +++ b/tests/autodiff/dont-warn-on-simple-prefer-recompute.slang @@ -1,4 +1,5 @@ //TEST:SIMPLE(filecheck=CHECK): -target hlsl -line-directive-mode none -stage compute -entry computeMain +//TEST:SIMPLE(filecheck=CHECK): -target cuda -line-directive-mode none //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer RWStructuredBuffer<float> outputBuffer; |
