Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 45daa9b

Browse files
[SYCL] Fix result check in joint matrix tests (#1432)
Some tests in SYCL/Matrix verify their results but only use the results to print "passed" or "failed". A subset of these tests have checks for "passed" in the output, but does not use FileCheck to govern the check. This commit changes these tests to return a non-zero value in the main function if the result verification failed. This allows the test system to correctly identify tests that fail this verification. Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 94b6509 commit 45daa9b

21 files changed

+36
-79
lines changed

SYCL/Matrix/element_wise_ops_impl.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@ int main() {
145145
res = false;
146146
}
147147
}
148-
if (res)
149-
std::cout << "passed\n";
150-
else
151-
std::cout << "failed\n";
148+
std::cout << (res ? "passed" : "failed") << std::endl;
149+
return !res;
152150
}

SYCL/Matrix/elemwise_irreg_size_ops_bf16.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,6 @@ int main() {
183183
res = false;
184184
}
185185
}
186-
if (res)
187-
std::cout << "passed\n";
188-
else
189-
std::cout << "failed\n";
186+
std::cout << (res ? "passed" : "failed") << std::endl;
187+
return !res;
190188
}

SYCL/Matrix/joint_matrix_bf16_impl.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ int main() {
155155
res = false;
156156
}
157157
}
158-
if (res)
159-
std::cout << "passed\n";
160-
else
161-
std::cout << "failed\n";
158+
std::cout << (res ? "passed" : "failed") << std::endl;
159+
return !res;
162160
}

SYCL/Matrix/joint_matrix_bfloat16_32x64.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,6 @@ int main() {
176176
res = false;
177177
}
178178
}
179-
if (res)
180-
std::cout << "passed\n";
181-
else
182-
std::cout << "failed\n";
179+
std::cout << (res ? "passed" : "failed") << std::endl;
180+
return !res;
183181
}

SYCL/Matrix/joint_matrix_bfloat16_colmajorA_colmajorB.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
// RUN: %clangxx -fsycl %s -o %t.out
1111
// RUN: %CPU_RUN_PLACEHOLDER %t.out
1212
// RUN: %GPU_RUN_PLACEHOLDER %t.out
13-
// CHECK: passed
1413

1514
// This tests support of col major layout for matrix B which does transpose and
1615
// then VNNI transform. This is currently only available on AMX

SYCL/Matrix/joint_matrix_bfloat16_colmajorA_colmajorB_impl.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ int main() {
136136
res = false;
137137
}
138138
}
139-
if (res)
140-
std::cout << "passed\n";
141-
else
142-
std::cout << "failed\n";
139+
std::cout << (res ? "passed" : "failed") << std::endl;
140+
return !res;
143141
}

SYCL/Matrix/joint_matrix_bfloat16_impl.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@ int main() {
152152
res = false;
153153
}
154154
}
155-
if (res)
156-
std::cout << "passed\n";
157-
else
158-
std::cout << "failed\n";
155+
std::cout << (res ? "passed" : "failed") << std::endl;
156+
return !res;
159157
}

SYCL/Matrix/joint_matrix_bfloat16_rowmajorA_rowmajorB.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
// RUN: %clangxx -fsycl %s -o %t.out
1111
// RUN: %CPU_RUN_PLACEHOLDER %t.out
1212
// RUN: %GPU_RUN_PLACEHOLDER %t.out
13-
// CHECK: passed
1413

1514
// This tests support of row major layout for matrix B which does automatic VNNI
1615
// transform. This is currently only available on AMX

SYCL/Matrix/joint_matrix_bfloat16_rowmajorA_rowmajorB_impl.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ int main() {
136136
res = false;
137137
}
138138
}
139-
if (res)
140-
std::cout << "passed\n";
141-
else
142-
std::cout << "failed\n";
139+
std::cout << (res ? "passed" : "failed") << std::endl;
140+
return !res;
143141
}

SYCL/Matrix/joint_matrix_bfloat16_use_impl.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ int main() {
149149
res = false;
150150
}
151151
}
152-
if (res)
153-
std::cout << "passed\n";
154-
else
155-
std::cout << "failed\n";
152+
std::cout << (res ? "passed" : "failed") << std::endl;
153+
return !res;
156154
}

SYCL/Matrix/joint_matrix_half_impl.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ int main() {
137137
res = false;
138138
}
139139
}
140-
if (res)
141-
std::cout << "passed\n";
142-
else
143-
std::cout << "failed\n";
140+
std::cout << (res ? "passed" : "failed") << std::endl;
141+
return !res;
144142
}

SYCL/Matrix/joint_matrix_int8_colmajorA_colmajorB.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
// RUN: %clangxx -fsycl %s -o %t.out
1111
// RUN: %CPU_RUN_PLACEHOLDER %t.out
1212
// RUN: %GPU_RUN_PLACEHOLDER %t.out
13-
// CHECK: passed
1413

1514
// This tests support of col major layout for matrix B which does transpose and
1615
// then VNNI transform. This is currently only available on AMX

SYCL/Matrix/joint_matrix_int8_colmajorA_colmajorB_impl.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ int main() {
133133
res = false;
134134
}
135135
}
136-
if (res)
137-
std::cout << "passed\n";
138-
else
139-
std::cout << "failed\n";
136+
std::cout << (res ? "passed" : "failed") << std::endl;
137+
return !res;
140138
}

SYCL/Matrix/joint_matrix_int8_vnni_impl.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,6 @@ int main() {
148148
res = false;
149149
}
150150
}
151-
if (res)
152-
std::cout << "passed\n";
153-
else
154-
std::cout << "failed\n";
151+
std::cout << (res ? "passed" : "failed") << std::endl;
152+
return !res;
155153
}

SYCL/Matrix/joint_matrix_query_default.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ int main() {
159159
res = false;
160160
}
161161
}
162-
if (res)
163-
std::cout << "passed\n";
164-
else
165-
std::cout << "failed\n";
162+
std::cout << (res ? "passed" : "failed") << std::endl;
163+
return !res;
166164
}

SYCL/Matrix/joint_matrix_query_use_default.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
// RUN: %clangxx -fsycl %s -o %t.out -DSYCL_EXT_ONEAPI_MATRIX_VERSION=2
1111
// RUN: %CPU_RUN_PLACEHOLDER %t.out
1212

13-
// CHECK: passed
14-
15-
// CHECK: passed
16-
1713
#include <iostream>
1814
#include <sycl/sycl.hpp>
1915

@@ -166,8 +162,6 @@ int main() {
166162
res = false;
167163
}
168164
}
169-
if (res)
170-
std::cout << "passed\n";
171-
else
172-
std::cout << "failed\n";
165+
std::cout << (res ? "passed" : "failed") << std::endl;
166+
return !res;
173167
}

SYCL/Matrix/joint_matrix_ss_int8_impl.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ int main() {
135135
res = false;
136136
}
137137
}
138-
if (res)
139-
std::cout << "passed\n";
140-
else
141-
std::cout << "failed\n";
138+
std::cout << (res ? "passed" : "failed") << std::endl;
139+
return !res;
142140
}

SYCL/Matrix/joint_matrix_ss_int8_use_impl.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ int main() {
129129
res = false;
130130
}
131131
}
132-
if (res)
133-
std::cout << "passed\n";
134-
else
135-
std::cout << "failed\n";
132+
std::cout << (res ? "passed" : "failed") << std::endl;
133+
return !res;
136134
}

SYCL/Matrix/joint_matrix_su_int8_impl.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ int main() {
140140
res = false;
141141
}
142142
}
143-
if (res)
144-
std::cout << "passed\n";
145-
else
146-
std::cout << "failed\n";
143+
std::cout << (res ? "passed" : "failed") << std::endl;
144+
return !res;
147145
}

SYCL/Matrix/joint_matrix_us_int8_impl.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ int main() {
142142
res = false;
143143
}
144144
}
145-
if (res)
146-
std::cout << "passed\n";
147-
else
148-
std::cout << "failed\n";
145+
std::cout << (res ? "passed" : "failed") << std::endl;
146+
return !res;
149147
}

SYCL/Matrix/joint_matrix_uu_int8_impl.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ int main() {
140140
res = false;
141141
}
142142
}
143-
if (res)
144-
std::cout << "passed\n";
145-
else
146-
std::cout << "failed\n";
143+
std::cout << (res ? "passed" : "failed") << std::endl;
144+
return !res;
147145
}

0 commit comments

Comments
 (0)