Browse Source

Execution Test: Wave Intrinsics Caps check (#613)

Young Kim 8 years ago
parent
commit
1590f7e953
1 changed files with 21 additions and 0 deletions
  1. 21 0
      tools/clang/unittests/HLSL/ExecutionTest.cpp

+ 21 - 0
tools/clang/unittests/HLSL/ExecutionTest.cpp

@@ -524,6 +524,7 @@ public:
   TEST_METHOD(SignTest);
   TEST_METHOD(Int64Test);
   TEST_METHOD(WaveIntrinsicsTest);
+  TEST_METHOD(WaveIntrinsicsDDITest);
   TEST_METHOD(WaveIntrinsicsInPSTest);
   TEST_METHOD(PartialDerivTest);
 
@@ -1493,6 +1494,26 @@ TEST_F(ExecutionTest, SignTest) {
   VERIFY_ARE_EQUAL(values[7], 1);
 }
 
+TEST_F(ExecutionTest, WaveIntrinsicsDDITest) {
+  CComPtr<ID3D12Device> pDevice;
+  if (!CreateDevice(&pDevice))
+    return;
+  D3D12_FEATURE_DATA_D3D12_OPTIONS1 O;
+  if (FAILED(pDevice->CheckFeatureSupport((D3D12_FEATURE)D3D12_FEATURE_D3D12_OPTIONS1, &O, sizeof(O))))
+    return;
+  bool waveSupported = O.WaveOps;
+  UINT laneCountMin = O.WaveLaneCountMin;
+  UINT laneCountMax = O.WaveLaneCountMax;
+  LogCommentFmt(L"WaveOps %i, WaveLaneCountMin %u, WaveLaneCountMax %u", waveSupported, laneCountMin, laneCountMax);
+  VERIFY_IS_TRUE(laneCountMin <= laneCountMax);
+  if (waveSupported) {
+    VERIFY_IS_TRUE(laneCountMin > 0 && laneCountMax > 0);
+  }
+  else {
+    VERIFY_IS_TRUE(laneCountMin == 0 && laneCountMax == 0);
+  }
+}
+
 TEST_F(ExecutionTest, WaveIntrinsicsTest) {
   WEX::TestExecution::SetVerifyOutput verifySettings(WEX::TestExecution::VerifyOutputSettings::LogOnlyFailures);