diff --git a/rocclr/runtime/device/gpu/gpudevice.cpp b/rocclr/runtime/device/gpu/gpudevice.cpp index 2df6f5058f..aa8ed5147d 100644 --- a/rocclr/runtime/device/gpu/gpudevice.cpp +++ b/rocclr/runtime/device/gpu/gpudevice.cpp @@ -2233,6 +2233,12 @@ cl_int Device::hwDebugManagerInit(amd::Context* context, uintptr_t messageStorag bool Device::SetClockMode(const cl_set_device_clock_mode_input_amd setClockModeInput, cl_set_device_clock_mode_output_amd* pSetClockModeOutput) { bool result = true; + static const bool bValidate = true; + PerformAdapterInitialization(bValidate); + GSLClockModeInfo clockModeInfo = {}; + clockModeInfo.clockmode = static_cast(setClockModeInput.clock_mode); + result = gslSetClockMode(&clockModeInfo); + CloseInitializedAdapter(bValidate); return result; } diff --git a/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp b/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp index 8d9021981b..24cb4c6ea4 100644 --- a/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp +++ b/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp @@ -1623,3 +1623,15 @@ CALGSLDevice::fillSamplerHwState(bool unnorm, uint32 min, uint32 mag, uint32 add m_textureSampler->getSamplerSrd(m_cs, hwState, hwStateSize); } +bool +CALGSLDevice::gslSetClockMode(GSLClockModeInfo * clockModeInfo) +{ + bool result = false; + const void* requestClockInfo = reinterpret_cast(clockModeInfo); + uint32 uReturn = m_adp->requestClockModeInfo((void*)requestClockInfo); + if(uReturn == GSL_SETCLOCK_SUCCESS || uReturn == GSL_SETCLOCK_QUERY_ONLY) + { + result = true; + } + return result; +} \ No newline at end of file diff --git a/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.h b/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.h index 6e44ad5daa..627a140d1d 100644 --- a/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.h +++ b/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.h @@ -6,6 +6,7 @@ #include "gsl_types.h" #include "gsl_config.h" #include "thread/monitor.hpp" +#include "gsl_types_internal.h" #ifdef ATI_OS_LINUX typedef unsigned int IDirect3DDevice9; @@ -140,6 +141,7 @@ public: gslEngineID getFirstAvailableComputeEngineID() const { return static_cast( m_adp->findFirstAvailableComputeEngineID()); } + virtual bool gslSetClockMode(GSLClockModeInfo * clockModeInfo); protected: // /// channel order enumerants