Skip to content

Commit 42d52b8

Browse files
author
Andrew Savonichev
committed
Re-order local and global id in the assert format string
Signed-off-by: Andrew Savonichev <[email protected]>
1 parent 423a054 commit 42d52b8

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

sycl/doc/extensions/C-CXX-StandardLibrary/DeviceLibExtensions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ Arguments:
3131

3232
Example of a message:
3333
.. code:
34-
foo.cpp:42: void foo(int): local id: [0,0,0], global id: [0,0,0] Assertion `buf[wiID] == 0 && "Invalid value"` failed.
34+
foo.cpp:42: void foo(int): global id: [0,0,0], local id: [0,0,0] Assertion `buf[wiID] == 0 && "Invalid value"` failed.

sycl/source/detail/devicelib/fallback-cassert.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ int __spirv_ocl_printf(const __attribute__((opencl_constant)) char *fmt, ...)
1313
__attribute__((format(printf, 1, 2)));
1414

1515
static const __attribute__((opencl_constant)) char assert_fmt[] =
16-
"%s:%d: %s: local id: [%lu,%lu,%lu], global id: [%lu,%lu,%lu] "
16+
"%s:%d: %s: global id: [%lu,%lu,%lu], local id: [%lu,%lu,%lu] "
1717
"Assertion `%s` failed.\n";
1818

1919
SYCL_EXTERNAL

sycl/test/devicelib/assert-windows.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//
1717
// RUN: env SYCL_PI_TRACE=1 SYCL_DEVICELIB_INHIBIT_NATIVE=1 SYCL_DEVICE_TYPE=CPU %t.out >%t.stdout.fallback 2>%t.stderr.fallback
1818
// RUN: FileCheck %s --check-prefix=CHECK-MESSAGE --input-file %t.stdout.fallback
19-
// CHECK-MESSAGE: {{.*}}assert-windows.cpp:{{[0-9]+}}: (null): local id: [{{[0-3]}},0,0], global id: [{{[0-3]}},0,0] Assertion `accessorC[wiID] == 0 && "Invalid value"` failed.
19+
// CHECK-MESSAGE: {{.*}}assert-windows.cpp:{{[0-9]+}}: (null): global id: [{{[0-3]}},0,0], local id: [{{[0-3]}},0,0] Assertion `accessorC[wiID] == 0 && "Invalid value"` failed.
2020
//
2121
// RUN: FileCheck %s --input-file %t.stdout.fallback --check-prefix=CHECK-FALLBACK
2222
// CHECK-FALLBACK: ---> piProgramLink

sycl/test/devicelib/assert.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
// native modes (fallback prints to stdout, while native prints to stderr; we
8888
// already handled this difference in the RUN lines):
8989
//
90-
// CHECK-MESSAGE: {{.*}}assert.cpp:{{[0-9]+}}: auto simple_vadd(const std::array<int, 3UL> &, const std::array<int, 3UL> &, std::array<int, 3UL> &)::(anonymous class)::operator()(cl::sycl::handler &)::(anonymous class)::operator()(cl::sycl::id<1>) const: local id: [{{[0-3]}},0,0], global id: [{{[0-3]}},0,0] Assertion `accessorC[wiID] == 0 && "Invalid value"` failed.
90+
// CHECK-MESSAGE: {{.*}}assert.cpp:{{[0-9]+}}: auto simple_vadd(const std::array<int, 3UL> &, const std::array<int, 3UL> &, std::array<int, 3UL> &)::(anonymous class)::operator()(cl::sycl::handler &)::(anonymous class)::operator()(cl::sycl::id<1>) const: global id: [{{[0-3]}},0,0], local id: [{{[0-3]}},0,0] Assertion `accessorC[wiID] == 0 && "Invalid value"` failed.
9191
//
9292
// Note that the work-item that hits the assert first may vary, since the order
9393
// of execution is undefined. We catch only the first one (whatever id it is).

0 commit comments

Comments
 (0)