Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions test/Basic/matrix_scalar_arithmetic.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ void main(uint GI : SV_GroupIndex) {
int2x3 A = int2x3(In[0], In[1], In[2],
In[3], In[4], In[5]);

int row = GI / 2;
int col = GI % 2;
DivOut[GI] = A[col][row] / 2;
MulOut[GI] = A[col][row] * 2;
AddOut[GI] = A[col][row] + 1;
SubOut[GI] = A[col][row] - 1;
const uint COLS = 3; // int2x3 => 2 rows, 3 columns
uint row = GI / COLS; // 0..1
uint col = GI % COLS; // 0..2
DivOut[GI] = A[row][col] / 2;
MulOut[GI] = A[row][col] * 2;
AddOut[GI] = A[row][col] + 1;
SubOut[GI] = A[row][col] - 1;
}

//--- pipeline.yaml
Expand Down Expand Up @@ -92,13 +93,13 @@ DescriptorSets:
# CHECK: Data: [ 2, 4, 6, 8, 10, 12 ]
# CHECK: Name: DivOut
# CHECK: Format: Int32
# CHECK: Data: [ 1, 4, 2, 5, 3, 6 ]
# CHECK: Data: [ 1, 2, 3, 4, 5, 6 ]
# CHECK: Name: MulOut
# CHECK: Format: Int32
# CHECK: Data: [ 4, 16, 8, 20, 12, 24 ]
# CHECK: Data: [ 4, 8, 12, 16, 20, 24 ]
# CHECK: Name: AddOut
# CHECK: Format: Int32
# CHECK: Data: [ 3, 9, 5, 11, 7, 13 ]
# CHECK: Data: [ 3, 5, 7, 9, 11, 13 ]
# CHECK: Name: SubOut
# CHECK: Format: Int32
# CHECK: Data: [ 1, 7, 3, 9, 5, 11 ]
# CHECK: Data: [ 1, 3, 5, 7, 9, 11 ]
10 changes: 6 additions & 4 deletions test/Basic/matrix_scalar_constructor.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ void main(uint GI : SV_GroupIndex) {
int2x3 A = int2x3(In[0], In[1], In[2],
In[3], In[4], In[5]);

int row = GI / 2;
int col = GI % 2;
Out[GI] = A[col][row];
const uint COLS = 3; // int2x3 => 2 rows, 3 columns
uint row = GI / COLS; // 0..1
uint col = GI % COLS; // 0..2

Out[GI] = A[row][col];
}

//--- pipeline.yaml
Expand All @@ -29,7 +31,7 @@ Buffers:
FillSize: 24
- Name: ExpectedOut
Format: Int32
Data: [ 1, 4, 2, 5, 3, 6 ]
Data: [ 1, 2, 3, 4, 5, 6 ]
Results:
- Result: Out
Rule: BufferExact
Expand Down
Loading