From 7ab6f021b58f5c93ad25f40b7809a8da26feeedb Mon Sep 17 00:00:00 2001 From: foreman Date: Thu, 3 Jan 2019 14:48:40 -0500 Subject: [PATCH] P4 to Git Change 1725771 by gandryey@gera-w8 on 2019/01/03 14:33:02 SWDEV-79445 - OCL generic changes and code clean-up - Allow ROCr and PAL support from a single runtime binary. Runtime will use ROCr path by default with GPU_ENABLE_PAL=1 forcing PAL. Affected files ... ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/build/Makefile.api#183 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#240 edit [ROCm/clr commit: 0a5b58ddec651446d01768ab8fe2155ba63f8541] --- projects/clr/rocclr/runtime/device/device.cpp | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/projects/clr/rocclr/runtime/device/device.cpp b/projects/clr/rocclr/runtime/device/device.cpp index 02f46ace4b..8c0cbecf8a 100644 --- a/projects/clr/rocclr/runtime/device/device.cpp +++ b/projects/clr/rocclr/runtime/device/device.cpp @@ -148,17 +148,19 @@ bool Device::init() { // GPU stack. The order of initialization is signiicant and if changed // amd::Device::registerDevice() must be accordingly modified. #if defined(WITH_HSA_DEVICE) - // Return value of roc::Device::init() - // If returned false, error initializing HSA stack. - // If returned true, either HSA not installed or HSA stack - // successfully initialized. - if (!roc::Device::init()) { - // abort() commentted because this is the only indication - // that KFD is not installed. - // Ignore the failure and assume KFD is not installed. - // abort(); + if (GPU_ENABLE_PAL != 1) { + // Return value of roc::Device::init() + // If returned false, error initializing HSA stack. + // If returned true, either HSA not installed or HSA stack + // successfully initialized. + if (!roc::Device::init()) { + // abort() commentted because this is the only indication + // that KFD is not installed. + // Ignore the failure and assume KFD is not installed. + // abort(); + } + ret |= roc::NullDevice::init(); } - ret |= roc::NullDevice::init(); #endif // WITH_HSA_DEVICE #if defined(WITH_GPU_DEVICE) if (GPU_ENABLE_PAL != 1) {