P4 to Git Change 2045900 by gandryey@gera-win10 on 2019/12/13 17:41:59
SWDEV-197836 - Drop the use of llvm header files in opencl runtime - Eliminate LC driver path from runtime Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#248 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#345 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devkernel.cpp#31 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devkernel.hpp#20 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.cpp#74 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.hpp#39 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#179 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#85 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.cpp#30 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#101 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#146 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.cpp#54 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#109 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#93 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#107 edit
Dieser Commit ist enthalten in:
1 Ursprung
c7dc9892dd
Commit
b4d64363f6
15 Dateien geändert
+53
-1421
Keine Dateien entsprechen Ihrer Suche
@@ -10,11 +10,11 @@
|
||||
#include "utils/options.hpp"
|
||||
#include "acl.h"
|
||||
|
||||
#if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
|
||||
#if defined(USE_COMGR_LIBRARY)
|
||||
#include "llvm/Support/AMDGPUMetadata.h"
|
||||
|
||||
typedef llvm::AMDGPU::HSAMD::Kernel::Metadata KernelMD;
|
||||
#endif // defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
|
||||
#endif // defined(USE_COMGR_LIBRARY)
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
@@ -413,7 +413,7 @@ const LightningProgram& LightningKernel::prog() const {
|
||||
return reinterpret_cast<const LightningProgram&>(prog_);
|
||||
}
|
||||
|
||||
#if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
|
||||
#if 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) {
|
||||
@@ -422,9 +422,7 @@ static const KernelMD* FindKernelMetadata(const CodeObjectMD* programMD, const s
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
#endif // defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
|
||||
|
||||
#if defined(USE_COMGR_LIBRARY)
|
||||
bool LightningKernel::init() {
|
||||
flags_.internalKernel_ =
|
||||
(compileOptions_.find("-cl-internal-kernel") != std::string::npos) ? true : false;
|
||||
@@ -508,87 +506,4 @@ bool LightningKernel::init() {
|
||||
}
|
||||
#endif // defined(USE_COMGR_LIBRARY)
|
||||
|
||||
bool LightningKernel::init(amd::hsa::loader::Symbol* symbol) {
|
||||
#if defined(WITH_LIGHTNING_COMPILER) && !defined(USE_COMGR_LIBRARY)
|
||||
flags_.internalKernel_ =
|
||||
(compileOptions_.find("-cl-internal-kernel") != std::string::npos) ? true : false;
|
||||
|
||||
aqlCreateHWInfo(symbol);
|
||||
|
||||
const CodeObjectMD* programMD = prog().metadata();
|
||||
assert(programMD != nullptr);
|
||||
|
||||
const KernelMD* kernelMD = FindKernelMetadata(programMD, name());
|
||||
|
||||
if (kernelMD == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set the argList
|
||||
InitParameters(*kernelMD, argsBufferSize());
|
||||
|
||||
if (!kernelMD->mAttrs.mReqdWorkGroupSize.empty()) {
|
||||
const auto& requiredWorkgroupSize = kernelMD->mAttrs.mReqdWorkGroupSize;
|
||||
workGroupInfo_.compileSize_[0] = requiredWorkgroupSize[0];
|
||||
workGroupInfo_.compileSize_[1] = requiredWorkgroupSize[1];
|
||||
workGroupInfo_.compileSize_[2] = requiredWorkgroupSize[2];
|
||||
}
|
||||
|
||||
if (!kernelMD->mAttrs.mWorkGroupSizeHint.empty()) {
|
||||
const auto& workgroupSizeHint = kernelMD->mAttrs.mWorkGroupSizeHint;
|
||||
workGroupInfo_.compileSizeHint_[0] = workgroupSizeHint[0];
|
||||
workGroupInfo_.compileSizeHint_[1] = workgroupSizeHint[1];
|
||||
workGroupInfo_.compileSizeHint_[2] = workgroupSizeHint[2];
|
||||
}
|
||||
|
||||
if (!kernelMD->mAttrs.mVecTypeHint.empty()) {
|
||||
workGroupInfo_.compileVecTypeHint_ = kernelMD->mAttrs.mVecTypeHint.c_str();
|
||||
}
|
||||
|
||||
if (!kernelMD->mAttrs.mRuntimeHandle.empty()) {
|
||||
hsa_agent_t agent;
|
||||
agent.handle = 1;
|
||||
amd::hsa::loader::Symbol* rth_symbol;
|
||||
|
||||
// Get the runtime handle symbol GPU address
|
||||
rth_symbol = prog().GetSymbol(const_cast<char*>(kernelMD->mAttrs.mRuntimeHandle.c_str()),
|
||||
const_cast<hsa_agent_t*>(&agent));
|
||||
uint64_t symbol_address;
|
||||
rth_symbol->GetInfo(HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_ADDRESS, &symbol_address);
|
||||
|
||||
// Copy the kernel_object pointer to the runtime handle symbol GPU address
|
||||
const Memory& codeSegGpu = prog().codeSegGpu();
|
||||
uint64_t offset = symbol_address - codeSegGpu.vmAddress();
|
||||
VirtualGPU* gpu = codeSegGpu.dev().xferQueue();
|
||||
|
||||
const struct RuntimeHandle runtime_handle = {gpuAqlCode(), spillSegSize(), ldsSize()};
|
||||
|
||||
codeSegGpu.writeRawData(*gpu, offset, sizeof(runtime_handle), &runtime_handle, true);
|
||||
}
|
||||
|
||||
// Copy wavefront size
|
||||
workGroupInfo_.wavefrontSize_ = dev().info().wavefrontWidth_;
|
||||
|
||||
workGroupInfo_.size_ = kernelMD->mCodeProps.mMaxFlatWorkGroupSize;
|
||||
if (workGroupInfo_.size_ == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
InitPrintf(programMD->mPrintf);
|
||||
|
||||
/*FIXME_lmoriche:
|
||||
size_t sizeOfWavesPerSimdHint = sizeof(workGroupInfo_.wavesPerSimdHint_);
|
||||
error = aclQueryInfo(dev().compiler(), prog().binaryElf(),
|
||||
RT_WAVES_PER_SIMD_HINT, openClKernelName.c_str(),
|
||||
&workGroupInfo_.wavesPerSimdHint_, &sizeOfWavesPerSimdHint);
|
||||
if (error != ACL_SUCCESS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
waveLimiter_.enable();
|
||||
*/
|
||||
#endif // defined(WITH_LIGHTNING_COMPILER) && ! defined(USE_COMGR_LIBRARY)
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace pal
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren