Skip to content

Commit d7113a7

Browse files
committed
[HIP] Disable SYCL images by default
Align the HIP adapter with the CUDA adapter and report SYCL images disabled by default, they're implemented at about the same level as the ones in CUDA, so there's no reason to treat them differently on HIP. Also any future work to improve the HIP image support should focus on bindless images rather than this SYCL image support, so it makes sense to consider this essentially "deprecated".
1 parent 76b5df4 commit d7113a7

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

source/adapters/cuda/device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
292292
logger::always(
293293
"Images are not fully supported by the CUDA BE, their support is "
294294
"disabled by default. Their partial support can be activated by "
295-
"setting SYCL_PI_CUDA_ENABLE_IMAGE_SUPPORT environment variable at "
295+
"setting UR_CUDA_ENABLE_IMAGE_SUPPORT environment variable at "
296296
"runtime.");
297297
}
298298

source/adapters/hip/device.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "adapter.hpp"
1313
#include "context.hpp"
1414
#include "event.hpp"
15+
#include "logger/ur_logger.hpp"
1516

1617
#include <sstream>
1718

@@ -223,7 +224,19 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
223224
return ReturnValue(uint64_t{MaxAlloc});
224225
}
225226
case UR_DEVICE_INFO_IMAGE_SUPPORTED: {
226-
return ReturnValue(ur_bool_t{true});
227+
bool Enabled = false;
228+
229+
if (std::getenv("UR_HIP_ENABLE_IMAGE_SUPPORT") != nullptr) {
230+
Enabled = true;
231+
} else {
232+
logger::always(
233+
"Images are not fully supported by the HIP BE, their support is "
234+
"disabled by default. Their partial support can be activated by "
235+
"setting UR_HIP_ENABLE_IMAGE_SUPPORT environment variable at "
236+
"runtime.");
237+
}
238+
239+
return ReturnValue(Enabled);
227240
}
228241
case UR_DEVICE_INFO_MAX_READ_IMAGE_ARGS: {
229242
// This call doesn't match to HIP as it doesn't have images, but instead

0 commit comments

Comments
 (0)