Skip to content

Commit 99a85db

Browse files
author
Alexander Batashev
authored
[SYCL][NFC] Fix warning in self-build (#3023)
Implicit conversion between pointer-to-function and pointer-to-object is a Microsoft extension
1 parent 328a12c commit 99a85db

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

sycl/source/detail/plugin_printers.hpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,26 @@
1212

1313
#include <CL/sycl/detail/pi.hpp>
1414

15+
#include <type_traits>
16+
1517
__SYCL_INLINE_NAMESPACE(cl) {
1618
namespace sycl {
1719
namespace detail {
1820
namespace pi {
1921

20-
template <typename T> inline void print(T val) {
22+
template <typename T>
23+
inline typename std::enable_if<!std::is_pointer<T>::value, void>::type
24+
print(T val) {
2125
std::cout << "<unknown> : " << val << std::endl;
2226
}
2327

28+
template <typename T>
29+
inline typename std::enable_if<std::is_pointer<T>::value, void>::type
30+
print(T val) {
31+
std::cout << "<unknown> : " << reinterpret_cast<const void *>(val)
32+
<< std::endl;
33+
}
34+
2435
template <> inline void print<>(PiPlatform val) {
2536
std::cout << "pi_platform : " << val << std::endl;
2637
}

0 commit comments

Comments
 (0)