Skip to content

Commit 8b938cf

Browse files
author
Georgi Mirazchiyski
committed
Address comments
1 parent 65941e5 commit 8b938cf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sycl/test-e2e/Basic/launch_queries/max_num_work_groups.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ int test_max_num_work_groups(sycl::queue &q, const sycl::device &dev) {
176176
// returns 0 possible work-groups, test that the kernel launch will fail.
177177
// A configuration that defines a work-group size larger than the maximum
178178
// possible should result in failure.
179+
bool result{0};
179180
try {
180181
launch_range = sycl::nd_range<1>{sycl::range<1>{NumWorkItems},
181182
sycl::range<1>{workGroupSize}};
@@ -190,11 +191,12 @@ int test_max_num_work_groups(sycl::queue &q, const sycl::device &dev) {
190191
cgh.parallel_for(launch_range, KernelName{acc});
191192
}
192193
}).wait_and_throw();
194+
// We shouldn't be here, exception is expected
193195
if constexpr (KernelName::HasLocalMemory)
194196
std::cerr << "Test (LocalMemory) with exceeded resource limits failed\n";
195197
else
196198
std::cerr << "Test with exceed resource limits failed\n";
197-
return 1; // We shouldn't be here, exception is expected
199+
result = 1;
198200
} catch (const sycl::exception &e) {
199201
// 'nd_range' error is the expected outcome from the above launch config.
200202
if (e.code() == sycl::make_error_code(sycl::errc::nd_range)) {
@@ -205,7 +207,7 @@ int test_max_num_work_groups(sycl::queue &q, const sycl::device &dev) {
205207
return 1;
206208
}
207209

208-
return 0;
210+
return result;
209211
}
210212

211213
} // namespace

0 commit comments

Comments
 (0)