From a92d9fca38dd713376120fafe9ad1c299d42d413 Mon Sep 17 00:00:00 2001 From: Ashley Coleman Date: Mon, 18 May 2026 19:39:30 -0600 Subject: [PATCH 1/3] [SM6.10] Add Smoke Test For VectorAccumulate --- .../clang/unittests/HLSLExec/LinAlgTests.cpp | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tools/clang/unittests/HLSLExec/LinAlgTests.cpp b/tools/clang/unittests/HLSLExec/LinAlgTests.cpp index 7b8aeeeba7..e5435155eb 100644 --- a/tools/clang/unittests/HLSLExec/LinAlgTests.cpp +++ b/tools/clang/unittests/HLSLExec/LinAlgTests.cpp @@ -359,6 +359,9 @@ class DxilConf_SM610_LinAlg { // Convert TEST_METHOD(Convert); + // Vector Accumulate + TEST_METHOD(VectorAccumulateDescriptor_Thread_F16); + private: CComPtr D3DDevice; dxc::SpecificDllLoader DxcSupport; @@ -1718,4 +1721,41 @@ void DxilConf_SM610_LinAlg::Convert() { runConvert(D3DDevice, DxcSupport, VerboseLogging); } +static const char VectorAccumulateDescriptorShader[] = R"( + RWByteAddressBuffer Output : register(u0); + + [numthreads(1, 1, 1)] + void main() { + vector InVec = {1.0, 2.0, 3.0, 4.0}; + __builtin_LinAlg_VectorAccumulateToDescriptor(InVec, Output, 0, 64); + } +)"; + +static void runVectorAccumulateDescriptor(ID3D12Device *Device, dxc::SpecificDllLoader &DxcSupport, + bool Verbose) { + std::string Args = "-HV 202x"; + MatrixDim NumElements = 4; + size_t BufferSize = elementSize(ComponentType::F16) * NumElements; + + compileShader(DxcSupport, VectorAccumulateDescriptorShader, "cs_6_10", Args, Verbose); + + auto Expected = makeExpectedVec(ComponentType::F16, NumElements, 1.0); + + auto Op = createComputeOp(VectorAccumulateDescriptorShader, "cs_6_10", "UAV(u0)", Args.c_str()); + addUAVBuffer(Op.get(), "Output", BufferSize, true); + addRootView(Op.get(), 0, "Output"); + + auto Result = runShaderOp(Device, DxcSupport, std::move(Op)); + + MappedData OutData; + Result->Test->GetReadBackData("Output", &OutData); + + VERIFY_IS_TRUE(verifyComponentBuffer(ComponentType::F16, OutData.data(), + Expected, NumElements, Verbose)); +} + +void DxilConf_SM610_LinAlg::VectorAccumulateDescriptor_Thread_F16() { + runVectorAccumulateDescriptor(D3DDevice, DxcSupport, VerboseLogging); +} + } // namespace LinAlg From 39f1240b26555f64c8c42d1c20ee17425e556d85 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 19 May 2026 01:43:55 +0000 Subject: [PATCH 2/3] chore: autopublish 2026-05-19T01:43:55Z --- tools/clang/unittests/HLSLExec/LinAlgTests.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/clang/unittests/HLSLExec/LinAlgTests.cpp b/tools/clang/unittests/HLSLExec/LinAlgTests.cpp index e5435155eb..a13e23f73d 100644 --- a/tools/clang/unittests/HLSLExec/LinAlgTests.cpp +++ b/tools/clang/unittests/HLSLExec/LinAlgTests.cpp @@ -1731,17 +1731,20 @@ static const char VectorAccumulateDescriptorShader[] = R"( } )"; -static void runVectorAccumulateDescriptor(ID3D12Device *Device, dxc::SpecificDllLoader &DxcSupport, - bool Verbose) { +static void runVectorAccumulateDescriptor(ID3D12Device *Device, + dxc::SpecificDllLoader &DxcSupport, + bool Verbose) { std::string Args = "-HV 202x"; MatrixDim NumElements = 4; size_t BufferSize = elementSize(ComponentType::F16) * NumElements; - compileShader(DxcSupport, VectorAccumulateDescriptorShader, "cs_6_10", Args, Verbose); + compileShader(DxcSupport, VectorAccumulateDescriptorShader, "cs_6_10", Args, + Verbose); auto Expected = makeExpectedVec(ComponentType::F16, NumElements, 1.0); - auto Op = createComputeOp(VectorAccumulateDescriptorShader, "cs_6_10", "UAV(u0)", Args.c_str()); + auto Op = createComputeOp(VectorAccumulateDescriptorShader, "cs_6_10", + "UAV(u0)", Args.c_str()); addUAVBuffer(Op.get(), "Output", BufferSize, true); addRootView(Op.get(), 0, "Output"); From bf916ce37b0b71bd24ff8ee91fe11239d85ae582 Mon Sep 17 00:00:00 2001 From: Ashley Coleman Date: Tue, 19 May 2026 10:51:13 -0600 Subject: [PATCH 3/3] Add missing -enable-16bit-types --- tools/clang/unittests/HLSLExec/LinAlgTests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/clang/unittests/HLSLExec/LinAlgTests.cpp b/tools/clang/unittests/HLSLExec/LinAlgTests.cpp index a13e23f73d..b3c4b761ea 100644 --- a/tools/clang/unittests/HLSLExec/LinAlgTests.cpp +++ b/tools/clang/unittests/HLSLExec/LinAlgTests.cpp @@ -1696,7 +1696,7 @@ static const char ConvertShader[] = R"( static void runConvert(ID3D12Device *Device, dxc::SpecificDllLoader &DxcSupport, bool Verbose) { - std::string Args = "-HV 202x"; + std::string Args = "-HV 202x -enable-16bit-types"; MatrixDim NumElements = 4; size_t BufferSize = elementSize(ComponentType::F32) * NumElements; @@ -1734,7 +1734,7 @@ static const char VectorAccumulateDescriptorShader[] = R"( static void runVectorAccumulateDescriptor(ID3D12Device *Device, dxc::SpecificDllLoader &DxcSupport, bool Verbose) { - std::string Args = "-HV 202x"; + std::string Args = "-HV 202x -enable-16bit-types"; MatrixDim NumElements = 4; size_t BufferSize = elementSize(ComponentType::F16) * NumElements;