Skip to content

Commit d190de6

Browse files
authored
[SYCL] Fix undefined behaviour in vector printf specifier (#8855)
The use of `%v` vector specifiers requires a length modifier as per OpenCL specification.
1 parent 7f49367 commit d190de6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sycl/test-e2e/DeviceLib/built-ins/printf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ int main() {
6464
// On SPIRV devices, vectors can be printed via native OpenCL types:
6565
using ocl_int4 = sycl::vec<int, 4>::vector_t;
6666
{
67-
static const CONSTANT char format[] = "%v4d\n";
67+
static const CONSTANT char format[] = "%v4hld\n";
6868
ext::oneapi::experimental::printf(format, (ocl_int4)v4);
6969
}
7070

0 commit comments

Comments
 (0)