From ad2c1e899a0f8ed74ed39ce8f8b7f834af727c54 Mon Sep 17 00:00:00 2001 From: German Date: Thu, 29 Jun 2023 15:37:38 -0400 Subject: [PATCH] SWDEV-408650 - Report CL_DEVICE_HALF_FP_CONFIG query If cl_khr_fp16 extension is enabled, then OCL runtime should report CL_DEVICE_HALF_FP_CONFIG. Change-Id: I7c4ac48387f80bc704a475c57e5b52a462090d1b --- rocclr/device/pal/paldevice.cpp | 4 ++++ rocclr/device/rocm/rocdevice.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/rocclr/device/pal/paldevice.cpp b/rocclr/device/pal/paldevice.cpp index c50d80ed3a..4192752f34 100644 --- a/rocclr/device/pal/paldevice.cpp +++ b/rocclr/device/pal/paldevice.cpp @@ -381,6 +381,10 @@ void NullDevice::fillDeviceInfo(const Pal::DeviceProperties& palProp, info_.singleFPConfig_ |= CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT; } + if (settings().checkExtension(ClKhrFp16)) { + info_.halfFPConfig_ = info_.singleFPConfig_; + } + info_.globalMemCacheLineSize_ = settings().cacheLineSize_; info_.globalMemCacheSize_ = settings().cacheSize_; if ((settings().cacheLineSize_ != 0) || (settings().cacheSize_ != 0)) { diff --git a/rocclr/device/rocm/rocdevice.cpp b/rocclr/device/rocm/rocdevice.cpp index 69bec0a764..5acaab4a0e 100644 --- a/rocclr/device/rocm/rocdevice.cpp +++ b/rocclr/device/rocm/rocdevice.cpp @@ -1430,6 +1430,10 @@ bool Device::populateOCLDeviceConstants() { info_.singleFPConfig_ |= CL_FP_DENORM; } + if (settings().checkExtension(ClKhrFp16)) { + info_.halfFPConfig_ = info_.singleFPConfig_; + } + info_.preferredPlatformAtomicAlignment_ = 0; info_.preferredGlobalAtomicAlignment_ = 0; info_.preferredLocalAtomicAlignment_ = 0;