Skip to content

Commit bcd9a41

Browse files
committed
[SYCL] Addressing feedback from reviewers
Signed-off-by: Ruyman Reyes <[email protected]>
1 parent 6697fff commit bcd9a41

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

sycl/source/detail/platform_impl.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ namespace sycl {
2121
namespace detail {
2222

2323
static bool IsBannedPlatform(platform Platform) {
24+
// The NVIDIA OpenCL platform is currently not compatible with DPC++
25+
// since it is only 1.2 but gets selected by default in many systems
26+
// There is also no support on the PTX backend for OpenCL consumption,
27+
// and there have been some internal reports.
28+
// To avoid problems on default users and deployment of DPC++ on platforms
29+
// where CUDA is available, the OpenCL support is disabled.
30+
//
2431
auto IsNVIDIAOpenCL = [](platform Platform) {
2532
if (Platform.is_host())
2633
return false;
@@ -29,7 +36,13 @@ static bool IsBannedPlatform(platform Platform) {
2936
"NVIDIA CUDA") != std::string::npos;
3037
const auto Backend =
3138
detail::getSyclObjImpl(Platform)->getPlugin().getBackend();
32-
return (HasCUDA && Backend == backend::opencl);
39+
const bool IsCUDAOCL = (HasCUDA && Backend == backend::opencl);
40+
if (detail::pi::trace(detail::pi::TraceLevel::PI_TRACE_ALL) && IsCUDAOCL) {
41+
std::cout << "SYCL_PI_TRACE[all]: "
42+
<< "NVIDIA CUDA OpenCL platform found but is not compatible."
43+
<< std::endl;
44+
}
45+
return IsCUDAOCL;
3346
};
3447
return IsNVIDIAOpenCL(Platform);
3548
}

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ static RT::PiProgram createBinaryProgram(const ContextImplPtr Context,
8888

8989
// TODO: Implement `piProgramCreateWithBinary` to not require extra logic for
9090
// the CUDA backend.
91-
if (Context->getPlugin().getBackend() == backend::cuda) {
91+
const auto Backend = Context->getPlugin().getBackend();
92+
if (Backend == backend::cuda) {
9293
// TODO: Reemplace CreateWithSource with CreateWithBinary in CUDA backend
9394
const char *SignedData = reinterpret_cast<const char *>(Data);
9495
Plugin.call<PiApiKind::piclProgramCreateWithSource>(Context->getHandleRef(), 1 /*one binary*/, &SignedData,

0 commit comments

Comments
 (0)