P4 to Git Change 1613522 by gandryey@gera-ocl-lc on 2018/10/02 11:44:38
SWDEV-79445 - OCL generic changes and code clean-up Program compilation clean-up. Step#7: - Introduce a new key to control the compilation path dynamically - InitBuild/finiBuild clean-up Affected files ... ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_device.cpp#73 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#231 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#321 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.cpp#9 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.hpp#7 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#245 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.hpp#78 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#111 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#67 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.hpp#25 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#80 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.hpp#36 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#58 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.cpp#43 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#93 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.hpp#41 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.cpp#37 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#96 edit ... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#299 edit
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
//
|
||||
// Copyright (c) 2008 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
#ifndef WITHOUT_HSA_BACKEND
|
||||
|
||||
#include "rocprogram.hpp"
|
||||
@@ -14,8 +12,8 @@
|
||||
#include "driver/AmdCompiler.h"
|
||||
#include "libraries.amdgcn.inc"
|
||||
#endif // defined(WITH_LIGHTNING_COMPILER)
|
||||
#include "utils/bif_section_labels.hpp"
|
||||
|
||||
#include "utils/bif_section_labels.hpp"
|
||||
#include "amd_hsa_kernel_code.h"
|
||||
|
||||
#include <string>
|
||||
@@ -113,49 +111,6 @@ bool Program::initClBinary(char* binaryIn, size_t size) {
|
||||
return clBinary()->setBinary(bin, sz, (decryptedBin != nullptr));
|
||||
}
|
||||
|
||||
|
||||
bool Program::initBuild(amd::option::Options* options) {
|
||||
compileOptions_ = options->origOptionStr;
|
||||
|
||||
if (!device::Program::initBuild(options)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const char* devName = dev().deviceInfo().machineTarget_;
|
||||
options->setPerBuildInfo((devName && (devName[0] != '\0')) ? devName : "gpu",
|
||||
clBinary()->getEncryptCode(), true);
|
||||
|
||||
// Elf Binary setup
|
||||
std::string outFileName;
|
||||
|
||||
// true means hsail required
|
||||
clBinary()->init(options, true);
|
||||
if (options->isDumpFlagSet(amd::option::DUMP_BIF)) {
|
||||
outFileName = options->getDumpFileName(".bin");
|
||||
}
|
||||
|
||||
bool useELF64 = getCompilerOptions()->oVariables->EnableGpuElf64;
|
||||
if (!clBinary()->setElfOut(useELF64 ? ELFCLASS64 : ELFCLASS32,
|
||||
(outFileName.size() > 0) ? outFileName.c_str() : nullptr)) {
|
||||
LogError("Setup elf out for gpu failed");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// ! post-compile setup for GPU
|
||||
bool Program::finiBuild(bool isBuildGood) {
|
||||
clBinary()->resetElfOut();
|
||||
clBinary()->resetElfIn();
|
||||
|
||||
if (!isBuildGood) {
|
||||
// Prevent the encrypted binary form leaking out
|
||||
clBinary()->setBinary(nullptr, 0);
|
||||
}
|
||||
|
||||
return device::Program::finiBuild(isBuildGood);
|
||||
}
|
||||
|
||||
#if defined(WITH_COMPILER_LIB)
|
||||
HSAILProgram::HSAILProgram(roc::NullDevice& device) : roc::Program(device) {
|
||||
xnackEnabled_ = dev().deviceInfo().xnackEnabled_;
|
||||
|
||||
Reference in New Issue
Block a user