From ce879112cb16e3def1b8673104e7123b8b17ee2a Mon Sep 17 00:00:00 2001 From: Yong He Date: Sun, 21 Jan 2018 07:09:55 -0500 Subject: Improvements and bug fixes for global type parameters 1. allow spReflection_FindTypeByName to accept arbitrary type expression string 2. allow const int generic value to be used as expression value, and as array size 3. various bug fixes in witness table specialization / function cloning during specializeIRForEntryPoint to avoid creating duplicate global values, not copying the right definition of a function from the other module, not cloning witness tables that are required by specializeGenerics etc. --- tests/compute/globalTypeParamArrayShared.slang | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/compute/globalTypeParamArrayShared.slang (limited to 'tests/compute/globalTypeParamArrayShared.slang') diff --git a/tests/compute/globalTypeParamArrayShared.slang b/tests/compute/globalTypeParamArrayShared.slang new file mode 100644 index 000000000..65d09f14e --- /dev/null +++ b/tests/compute/globalTypeParamArrayShared.slang @@ -0,0 +1,31 @@ +interface IBase +{ + float compute(T g); +} +struct Base:IBase +{ + float b; + float compute(T g) { return b; } +}; + +struct Pair : IBase +{ + T1 head; + T2 tail; + float compute(T g) + { + return head.compute(g) + tail.compute(g); + } +}; + +struct Arr : IBase +{ + T base[N]; // = 1.0 + float compute(T g) + { + float sum = 0.0; + for (int i = 0; i < N; i++) + sum += base[i].compute(g); + return sum; + } +}; -- cgit v1.2.3 From f681a1505c98995683a7fbae7ce208dc5e444b9b Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Sun, 21 Jan 2018 09:45:58 -0800 Subject: Add directive to ignore file for test runner --- tests/compute/globalTypeParamArrayShared.slang | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/compute/globalTypeParamArrayShared.slang') diff --git a/tests/compute/globalTypeParamArrayShared.slang b/tests/compute/globalTypeParamArrayShared.slang index 65d09f14e..ee3caa372 100644 --- a/tests/compute/globalTypeParamArrayShared.slang +++ b/tests/compute/globalTypeParamArrayShared.slang @@ -1,3 +1,4 @@ +//TEST_IGNORE_FILE: interface IBase { float compute(T g); -- cgit v1.2.3