summaryrefslogtreecommitdiffstats
path: root/tests/language-feature
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-11-10 13:55:14 -0800
committerGitHub <noreply@github.com>2023-11-10 13:55:14 -0800
commit011d4281647e3a2a3cf0dbdda1fa65cc1b8ed881 (patch)
tree70f91655e86d30529eda0a683e15f378eeae2cb5 /tests/language-feature
parentbfd3f39d04047d7a46e75206cd125ed87b3f3f99 (diff)
Cleanup builtin arithmetic interfaces. (#3317)
* wip: clean up IArithmetic * wip. * Cleanup builtin arithmetic interfaces. * Fix. * Fixes. * Fix. * Fix. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/language-feature')
-rw-r--r--tests/language-feature/generics/iarray.slang12
1 files changed, 2 insertions, 10 deletions
diff --git a/tests/language-feature/generics/iarray.slang b/tests/language-feature/generics/iarray.slang
index c2314f106..b66c3ab27 100644
--- a/tests/language-feature/generics/iarray.slang
+++ b/tests/language-feature/generics/iarray.slang
@@ -1,7 +1,7 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -shaderobj -output-using-type
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -vk -shaderobj -output-using-type
-T sum<T:__BuiltinArithmeticType>(IArray<T> array)
+T sum<T:IFloat>(IArray<T> array)
{
T result = T(0);
for (int i = 0; i < array.getCount(); i++)
@@ -10,15 +10,7 @@ T sum<T:__BuiltinArithmeticType>(IArray<T> array)
}
return result;
}
-vector<T,N> sum<T:__BuiltinArithmeticType, let N:int>(IArray<vector<T,N>> array)
-{
- vector<T,N> result = vector<T,N>(T(0));
- for (int i = 0; i < array.getCount(); i++)
- {
- result = result + array[i];
- }
- return result;
-}
+
//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<float> outputBuffer;