From dd4ae76f348bad40f56969a82bef606b2418f74b Mon Sep 17 00:00:00 2001 From: Nicolas Miller Date: Wed, 20 Nov 2024 11:30:31 +0000 Subject: [PATCH 1/2] [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". --- source/adapters/cuda/device.cpp | 2 +- source/adapters/hip/device.cpp | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/source/adapters/cuda/device.cpp b/source/adapters/cuda/device.cpp index cb6b757dd3..3f7fdc8c46 100644 --- a/source/adapters/cuda/device.cpp +++ b/source/adapters/cuda/device.cpp @@ -292,7 +292,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, logger::always( "Images are not fully supported by the CUDA BE, their support is " "disabled by default. Their partial support can be activated by " - "setting SYCL_PI_CUDA_ENABLE_IMAGE_SUPPORT environment variable at " + "setting UR_CUDA_ENABLE_IMAGE_SUPPORT environment variable at " "runtime."); } diff --git a/source/adapters/hip/device.cpp b/source/adapters/hip/device.cpp index 5271f73709..3922843ed1 100644 --- a/source/adapters/hip/device.cpp +++ b/source/adapters/hip/device.cpp @@ -12,6 +12,7 @@ #include "adapter.hpp" #include "context.hpp" #include "event.hpp" +#include "logger/ur_logger.hpp" #include @@ -223,7 +224,19 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, return ReturnValue(uint64_t{MaxAlloc}); } case UR_DEVICE_INFO_IMAGE_SUPPORTED: { - return ReturnValue(ur_bool_t{true}); + bool Enabled = false; + + if (std::getenv("UR_HIP_ENABLE_IMAGE_SUPPORT") != nullptr) { + Enabled = true; + } else { + logger::always( + "Images are not fully supported by the HIP BE, their support is " + "disabled by default. Their partial support can be activated by " + "setting UR_HIP_ENABLE_IMAGE_SUPPORT environment variable at " + "runtime."); + } + + return ReturnValue(Enabled); } case UR_DEVICE_INFO_MAX_READ_IMAGE_ARGS: { // This call doesn't match to HIP as it doesn't have images, but instead From 1b373f83c71eb39d440ca2c1ed82faf3bfa9b720 Mon Sep 17 00:00:00 2001 From: Nicolas Miller Date: Wed, 20 Nov 2024 11:55:42 +0000 Subject: [PATCH 2/2] [HIP] Update match files for disabled images --- test/conformance/memory/memory_adapter_hip.match | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/conformance/memory/memory_adapter_hip.match b/test/conformance/memory/memory_adapter_hip.match index a4181fcc8a..2acbdfb2e8 100644 --- a/test/conformance/memory/memory_adapter_hip.match +++ b/test/conformance/memory/memory_adapter_hip.match @@ -1,6 +1,4 @@ urMemImageCreateTest.InvalidSize/* -urMemImageGetInfoTest.Success/* urMemBufferCreateWithNativeHandleTest.Success/* urMemBufferCreateWithNativeHandleTest.SuccessWithOwnedNativeHandle/* urMemBufferCreateWithNativeHandleTest.SuccessWithUnOwnedNativeHandle/* -urMemImageCreateWithNativeHandleTest.Success/*