P4 to Git Change 1725166 by gandryey@gera-w8 on 2019/01/02 15:41:59

SWDEV-79445 - OCL generic changes and code clean-up
	- Add dynamic switch between HSAIL and LC in ROCr path

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#108 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.cpp#48 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.hpp#26 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#95 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.hpp#42 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#71 edit
This commit is contained in:
foreman
2019-01-02 16:03:55 -05:00
parent 77c9dda5ba
commit 01710a66ac
6 ha cambiato i file con 40 aggiunte e 36 eliminazioni
+30 -18
Vedi File
@@ -19,9 +19,9 @@
#include "device/rocm/rocblit.hpp"
#include "device/rocm/rocvirtual.hpp"
#include "device/rocm/rocprogram.hpp"
#if defined(WITH_LIGHTNING_COMPILER)
#if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
#include "driver/AmdCompiler.h"
#endif // defined(WITH_LIGHTNING_COMPILER)
#endif // defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
#include "device/rocm/rocmemory.hpp"
#include "device/rocm/rocglinterop.hpp"
#ifdef WITH_AMDGPU_PRO
@@ -644,10 +644,11 @@ bool Device::create() {
const char* scheduler = nullptr;
#if defined(WITH_LIGHTNING_COMPILER)
std::string sch = SchedulerSourceCode;
scheduler = sch.c_str();
#if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
if (settings().useLightning_) {
std::string sch = SchedulerSourceCode;
scheduler = sch.c_str();
}
// create compilation object with cache support
int gfxipMajor = deviceInfo_.gfxipVersion_ / 100;
int gfxipMinor = deviceInfo_.gfxipVersion_ / 10 % 10;
@@ -744,22 +745,33 @@ bool Device::create() {
}
device::Program* NullDevice::createProgram(amd::option::Options* options) {
#if defined(WITH_COMPILER_LIB)
return new roc::HSAILProgram(*this);
#else // !defined(WITH_COMPILER_LIB)
return NULL;
#endif // !defined(WITH_COMPILER_LIB)
device::Program* program;
if (settings().useLightning_) {
program = new LightningProgram(*this);
} else {
program = new HSAILProgram(*this);
}
if (program == nullptr) {
LogError("Memory allocation has failed!");
}
return program;
}
device::Program* Device::createProgram(amd::option::Options* options) {
#if defined(WITH_LIGHTNING_COMPILER)
if (!compilerHandle_ || !options->oVariables->Legacy) {
return new roc::LightningProgram(*this);
device::Program* program;
if (settings().useLightning_) {
program = new LightningProgram(*this);
} else {
program = new HSAILProgram(*this);
}
#endif // defined(WITH_LIGHTNING_COMPILER)
#if defined(WITH_COMPILER_LIB)
return new roc::HSAILProgram(*this);
#endif // defined(WITH_COMPILER_LIB)
if (program == nullptr) {
LogError("Memory allocation has failed!");
}
return program;
}
hsa_status_t Device::iterateGpuMemoryPoolCallback(hsa_amd_memory_pool_t pool, void* data) {