Skip to content

Commit 4ad9834

Browse files
[SM6.10][Exec] Implement Remaining LinAlg Smoke Tests (#8366)
Implements the remaining smoke tests for the LinAlg DXIL ops Fixes #8126 Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 8066e06 commit 4ad9834

3 files changed

Lines changed: 1210 additions & 64 deletions

File tree

tools/clang/unittests/HLSLExec/HlslExecTestUtils.cpp

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,30 @@ void addUAVBuffer(st::ShaderOp *Op, const char *Name, UINT64 Width,
691691
Op->Resources.push_back(Res);
692692
}
693693

694-
void addRootUAV(st::ShaderOp *Op, UINT Index, const char *ResName) {
694+
void addSRVBuffer(st::ShaderOp *Op, const char *Name, UINT64 Width,
695+
const char *Init) {
696+
st::ShaderOpResource Res = {};
697+
Res.Name = Op->Strings.insert(Name);
698+
Res.Init = Op->Strings.insert(Init);
699+
Res.ReadBack = FALSE;
700+
701+
Res.HeapProperties.Type = D3D12_HEAP_TYPE_DEFAULT;
702+
Res.HeapFlags = D3D12_HEAP_FLAG_NONE;
703+
Res.Desc.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;
704+
Res.Desc.Width = Width;
705+
Res.Desc.Height = 1;
706+
Res.Desc.DepthOrArraySize = 1;
707+
Res.Desc.MipLevels = 1;
708+
Res.Desc.SampleDesc.Count = 1;
709+
Res.Desc.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR;
710+
Res.Desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
711+
Res.InitialResourceState = D3D12_RESOURCE_STATE_COPY_DEST;
712+
Res.TransitionTo = D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE;
713+
714+
Op->Resources.push_back(Res);
715+
}
716+
717+
void addRootView(st::ShaderOp *Op, UINT Index, const char *ResName) {
695718
st::ShaderOpRootValue RV = {};
696719
RV.ResName = Op->Strings.insert(ResName);
697720
RV.HeapName = nullptr;
@@ -751,7 +774,7 @@ void compileShader(dxc::SpecificDllLoader &DxcSupport, const char *Source,
751774

752775
if (VerboseLogging) {
753776
hlsl_test::LogCommentFmt(L"Shader Source:");
754-
hlsl_test::LogCommentFmt(L"%c", Source);
777+
hlsl_test::LogCommentFmt(L"%S", Source);
755778
}
756779

757780
hlsl_test::LogCommentFmt(LogFlags.str().c_str());

tools/clang/unittests/HLSLExec/HlslExecTestUtils.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,12 @@ createComputeOp(const char *Source, const char *Target, const char *RootSig,
8888
void addUAVBuffer(st::ShaderOp *Op, const char *Name, UINT64 Width,
8989
bool ReadBack, const char *Init = "zero");
9090

91-
/// Bind a resource to a root UAV parameter by index.
92-
void addRootUAV(st::ShaderOp *Op, UINT Index, const char *ResName);
91+
/// Add a SRV buffer resource to a ShaderOp.
92+
void addSRVBuffer(st::ShaderOp *Op, const char *Name, UINT64 Width,
93+
const char *Init = "zero");
94+
95+
/// Bind a resource to a root view parameter by index.
96+
void addRootView(st::ShaderOp *Op, UINT Index, const char *ResName);
9397

9498
/// Run a programmatically-built ShaderOp and return the result.
9599
std::shared_ptr<st::ShaderOpTestResult>

0 commit comments

Comments
 (0)