From e95b576dc55f109a1d97336e53c7e1f23c8af6ac Mon Sep 17 00:00:00 2001 From: foreman Date: Wed, 19 Dec 2018 17:18:55 -0500 Subject: [PATCH] P4 to Git Change 1722571 by gandryey@gera-w8 on 2018/12/19 16:37:51 SWDEV-79445 - Back out changelist 1722556 - More changes are necessary on ROCm backend to support a dynamic switch between HSAIL and LC Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#107 edit [ROCm/clr commit: 172e8b7e8972a04d26a2d653d363607a1c0d31cc] --- .../rocclr/runtime/device/rocm/rocdevice.cpp | 35 +++++++------------ 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/projects/clr/rocclr/runtime/device/rocm/rocdevice.cpp b/projects/clr/rocclr/runtime/device/rocm/rocdevice.cpp index d77537bb1f..222bafd405 100644 --- a/projects/clr/rocclr/runtime/device/rocm/rocdevice.cpp +++ b/projects/clr/rocclr/runtime/device/rocm/rocdevice.cpp @@ -744,33 +744,22 @@ bool Device::create() { } device::Program* NullDevice::createProgram(amd::option::Options* options) { - device::Program* program; - if (settings().useLightning_) { - program = new LightningProgram(*this); - } - else { - program = new HSAILProgram(*this); - } - if (program == nullptr) { - LogError("We failed memory allocation for program!"); - } - - return program; +#if defined(WITH_COMPILER_LIB) + return new roc::HSAILProgram(*this); +#else // !defined(WITH_COMPILER_LIB) + return NULL; +#endif // !defined(WITH_COMPILER_LIB) } device::Program* Device::createProgram(amd::option::Options* options) { - device::Program* program; - if (settings().useLightning_) { - program = new LightningProgram(*this); +#if defined(WITH_LIGHTNING_COMPILER) + if (!compilerHandle_ || !options->oVariables->Legacy) { + return new roc::LightningProgram(*this); } - else { - program = new HSAILProgram(*this); - } - if (program == nullptr) { - LogError("We failed memory allocation for program!"); - } - - return program; +#endif // defined(WITH_LIGHTNING_COMPILER) +#if defined(WITH_COMPILER_LIB) + return new roc::HSAILProgram(*this); +#endif // defined(WITH_COMPILER_LIB) } hsa_status_t Device::iterateGpuMemoryPoolCallback(hsa_amd_memory_pool_t pool, void* data) {