Skip to content

Commit 5227132

Browse files
committed
[SYCL][CUDA] Disable by default the Image support
due to the fact that its actual CUDA implementation is partial. It is possible to re-enable it by setting PI_CUDA_ENABLE_IMAGE_SUPPORT environment variable at runtime.
1 parent ebf9ea8 commit 5227132

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,8 +1161,21 @@ pi_result cuda_piDeviceGetInfo(pi_device device, pi_device_info param_name,
11611161
pi_uint64{max_alloc});
11621162
}
11631163
case PI_DEVICE_INFO_IMAGE_SUPPORT: {
1164+
pi_bool enabled;
1165+
1166+
if (std::getenv("PI_CUDA_ENABLE_IMAGE_SUPPORT") != nullptr) {
1167+
enabled = PI_TRUE;
1168+
} else {
1169+
cl::sycl::detail::pi::cuPrint(
1170+
"Images are not fully supported by the CUDA BE, their support is "
1171+
"disabled by default. Their partial support can be activated by "
1172+
"setting PI_CUDA_ENABLE_IMAGE_SUPPORT environment variable at "
1173+
"runtime.");
1174+
enabled = PI_FALSE;
1175+
}
1176+
11641177
return getInfo(param_value_size, param_value, param_value_size_ret,
1165-
PI_TRUE);
1178+
enabled);
11661179
}
11671180
case PI_DEVICE_INFO_MAX_READ_IMAGE_ARGS: {
11681181
// This call doesn't match to CUDA as it doesn't have images, but instead

0 commit comments

Comments
 (0)