File tree Expand file tree Collapse file tree
tools/clang/unittests/HLSLExec Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -580,7 +580,7 @@ static void runElementAccess(ID3D12Device *Device,
580580 // Build actual data.
581581 std::vector<float > ActualFloats (NumElements);
582582 std::vector<int32_t > ActualInts (NumElements);
583- for (size_t I = 0 ; I < NumElements * 4 ; I = I + 4 ) {
583+ for (size_t I = 0 ; I < NumElements * ElementSize ; I = I + ElementSize ) {
584584 switch (Params.CompType ) {
585585 case ComponentType::F32: {
586586 float Actual;
@@ -615,9 +615,11 @@ static void runElementAccess(ID3D12Device *Device,
615615
616616 // The sum of the values returned by Length across all threads must be
617617 // greater than or equal to the total number of matrix elements
618+ size_t MatrixEndOffset = NumElements * ElementSize;
619+ size_t LengthValuesEnd = MatrixEndOffset + (NumThreads * sizeof (uint32_t ));
618620 size_t TotalLength = 0 ;
619- for (size_t I = NumElements * 4 ; I < (NumElements + NumThreads) * 4 ;
620- I = I + 4 ) {
621+ for (size_t I = MatrixEndOffset ; I < LengthValuesEnd ;
622+ I = I + sizeof ( uint32_t ) ) {
621623 TotalLength += Out[I];
622624 }
623625 VERIFY_IS_TRUE (TotalLength >= NumElements,
You can’t perform that action at this time.
0 commit comments