P4 to Git Change 1303140 by lmoriche@lmoriche_opencl_dev on 2016/08/15 17:04:37

SWDEV-94610 - Code provided by Wilkin - Implement the roc Program Manager to call the Lightning Compiler instead of the compiler library.
	- Embed and use the pre-compiled header generated by the built-in library build
	- If LLVM_BIN is not set, try to find Clang from the libamdocl path

	Testing: http://ocltc.amd.com:8111/viewModification.html?modId=75068&personal=true&buildTypeId=&tab=vcsModificationBuilds&show_all_builds=true

Affected files ...

... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/elf/elf.cpp#35 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/elf/elf.hpp#24 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/blitcl.cpp#9 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#200 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/build/Makefile.oclrocm#7 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roccompiler.cpp#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#7 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.cpp#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.hpp#4 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmetadata.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmetadata.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#7 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.hpp#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#8 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#81 edit
This commit is contained in:
foreman
2016-08-15 18:51:49 -04:00
parent 7aebeaacb2
commit e682abb47e
14 changed files with 1924 additions and 135 deletions
+19 -3
View File
@@ -37,6 +37,11 @@
#include <algorithm>
#endif // WITHOUT_HSA_BACKEND
#if defined(ATI_OS_LINUX)
#include <dlfcn.h>
#include <libgen.h>
#endif // defined(ATI_OS_LINUX)
#define OPENCL_VERSION_STR XSTR(OPENCL_MAJOR) "." XSTR(OPENCL_MINOR)
#ifndef WITHOUT_HSA_BACKEND
@@ -232,7 +237,20 @@ Device::~Device()
bool NullDevice::initCompiler(bool isOffline) {
#if defined(WITH_LIGHTNING_COMPILER)
if (!compilerHandle_) {
const std::string llvmbin(amd::Os::getEnvironment("LLVM_BIN"));
std::string llvmbin = amd::Os::getEnvironment("LLVM_BIN");
#if defined(ATI_OS_LINUX)
// FIXME_Wilkin: When no LLVM_BIN defined, use the default path
if (llvmbin.empty()) {
Dl_info info;
if (dladdr((const void*)&roc::NullDevice::initCompiler, &info)) {
llvmbin = dirname(strdup(info.dli_fname));
size_t pos = llvmbin.rfind("lib");
if (pos != std::string::npos) {
llvmbin.replace(pos, 3, "bin");
}
}
}
#endif // defined(ATI_OS_LINUX)
compilerHandle_ = amd::opencl_driver::CompilerFactory()
.CreateAMDGPUCompiler(llvmbin);
if (!compilerHandle_) {
@@ -436,7 +454,6 @@ Device::create()
return false;
}
#if !defined(WITH_LIGHTNING_COMPILER) // FIXME_Wilkin
blitProgram_ = new BlitProgram(context_);
// Create blit programs
if (blitProgram_ == NULL || !blitProgram_->create(this)) {
@@ -445,7 +462,6 @@ Device::create()
LogError("Couldn't create blit kernels!");
return false;
}
#endif // !defined(WITH_LIGHTNING_COMPILER)
mapCacheOps_ = new amd::Monitor("Map Cache Lock", true);
if (NULL == mapCacheOps_) {