From 798db8d2bef31355c8aba5ba926556b4a297bc5f Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 19 Jul 2022 13:55:01 -0400 Subject: Yet more improvements/fixes to cpu-target.md (#2330) * #include an absolute path didn't work - because paths were taken to always be relative. * Small improvements to cpu-target documentation. * More improvements to cpu-target.md doc. * More CPU target doc improvements. * More improvements around cpu-target.md * More fixes and improvements. * Added test for behavior of actual global and reflection. * Add category to determine cpu word size, so that reflection tests can target width. --- tests/reflection/actual-global.slang | 12 +++++++ tests/reflection/actual-global.slang.expected | 51 +++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 tests/reflection/actual-global.slang create mode 100644 tests/reflection/actual-global.slang.expected (limited to 'tests/reflection') diff --git a/tests/reflection/actual-global.slang b/tests/reflection/actual-global.slang new file mode 100644 index 000000000..806b75f2f --- /dev/null +++ b/tests/reflection/actual-global.slang @@ -0,0 +1,12 @@ +//TEST(64-bit):REFLECTION:-stage compute -no-codegen -target host-callable -entry computeMain + +__global int actualGlobal; +int regularGlobal; + +RWStructuredBuffer outputBuffer; + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + outputBuffer[dispatchThreadID.x] = dispatchThreadID.x + actualGlobal + regularGlobal; +} \ No newline at end of file diff --git a/tests/reflection/actual-global.slang.expected b/tests/reflection/actual-global.slang.expected new file mode 100644 index 000000000..5dbcde22e --- /dev/null +++ b/tests/reflection/actual-global.slang.expected @@ -0,0 +1,51 @@ +result code = 0 +standard error = { +} +standard output = { +{ + "parameters": [ + { + "name": "regularGlobal", + "binding": {"kind": "uniform", "offset": 0, "size": 4}, + "type": { + "kind": "scalar", + "scalarType": "int32" + } + }, + { + "name": "outputBuffer", + "binding": {"kind": "uniform", "offset": 8, "size": 16}, + "type": { + "kind": "resource", + "baseShape": "structuredBuffer", + "access": "readWrite", + "resultType": { + "kind": "scalar", + "scalarType": "int32" + } + } + } + ], + "entryPoints": [ + { + "name": "computeMain", + "stage:": "compute", + "parameters": [ + { + "name": "dispatchThreadID", + "semanticName": "SV_DISPATCHTHREADID", + "type": { + "kind": "vector", + "elementCount": 3, + "elementType": { + "kind": "scalar", + "scalarType": "uint32" + } + } + } + ], + "threadGroupSize": [4, 1, 1] + } + ] +} +} -- cgit v1.2.3