Skip to content

Commit 2e9542a

Browse files
authored
[SYCL][L0] Fixed SYCL_PI_TRACE printing problem (#2619)
SYCL_PI_TRACE is used for internal debugging. It displays the PI function that is being called and its arguments. When piGetDeviceInfo() was called, the printing of the pointer used for a variable sized string was incorrect. Added a print() specialization. The nullptr print() specialization was also updated because specializations should be special. Signed-off-by: Gail Lyons <[email protected]>
1 parent f20fd4d commit 2e9542a

File tree

1 file changed

+11
-1
lines changed
  • sycl/include/CL/sycl/detail

1 file changed

+11
-1
lines changed

sycl/include/CL/sycl/detail/pi.hpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,17 @@ template <> inline void print<>(PiResult val) {
215215
}
216216

217217
// cout does not resolve a nullptr.
218-
template <> inline void print<>(std::nullptr_t val) { print<void *>(val); }
218+
template <> inline void print<>(std::nullptr_t) {
219+
std::cout << "<nullptr>" << std::endl;
220+
}
221+
222+
template <> inline void print<>(char *val) {
223+
std::cout << "<char * > : " << static_cast<void *>(val) << std::endl;
224+
}
225+
226+
template <> inline void print<>(const char *val) {
227+
std::cout << "<const char *>: " << val << std::endl;
228+
}
219229

220230
inline void printArgs(void) {}
221231
template <typename Arg0, typename... Args>

0 commit comments

Comments
 (0)