P4 to Git Change 1718337 by gandryey@gera-w8 on 2018/12/10 15:30:30

SWDEV-162389 - Prepare the runtime code for enabling COMGR by default in the non-LC workspace
	- Make sure OCL runtime can dynamically switch between HSAIL and LC paths
	- For now use the both WITH_LIGHTNING_COMPILER and USE_COMGR_LIBRARY defines to identify LC specific code. The clean-up will come later

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/build/Makefile.api#179 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#238 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#327 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/devkernel.cpp#14 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/devkernel.hpp#10 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.cpp#19 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.hpp#12 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#249 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#118 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#74 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#85 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#63 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#101 edit
Este commit está contenido en:
foreman
2018-12-10 15:49:24 -05:00
padre ca58d7a9bb
commit e643f0bc00
Se han modificado 12 ficheros con 99 adiciones y 94 borrados
+6 -6
Ver fichero
@@ -10,11 +10,11 @@
#include "utils/options.hpp"
#include "acl.h"
#if defined(WITH_LIGHTNING_COMPILER)
#if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
#include "llvm/Support/AMDGPUMetadata.h"
typedef llvm::AMDGPU::HSAMD::Kernel::Metadata KernelMD;
#endif // defined(WITH_LIGHTNING_COMPILER)
#endif // defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
#include <string>
#include <memory>
@@ -377,7 +377,7 @@ const LightningProgram& LightningKernel::prog() const {
return reinterpret_cast<const LightningProgram&>(prog_);
}
#if defined(WITH_LIGHTNING_COMPILER)
#if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
static const KernelMD* FindKernelMetadata(const CodeObjectMD* programMD, const std::string& name) {
for (const KernelMD& kernelMD : programMD->mKernels) {
if (kernelMD.mName == name) {
@@ -386,10 +386,10 @@ static const KernelMD* FindKernelMetadata(const CodeObjectMD* programMD, const s
}
return nullptr;
}
#endif // defined(WITH_LIGHTNING_COMPILER)
#endif // defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
bool LightningKernel::init(amd::hsa::loader::Symbol* symbol) {
#if defined(WITH_LIGHTNING_COMPILER)
#if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
flags_.internalKernel_ =
(compileOptions_.find("-cl-internal-kernel") != std::string::npos) ? true : false;
@@ -519,7 +519,7 @@ bool LightningKernel::init(amd::hsa::loader::Symbol* symbol) {
waveLimiter_.enable();
*/
#endif // defined(USE_COMGR_LIBRARY)
#endif // defined(WITH_LIGHTNING_COMPILER)
#endif // defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
return true;
}