SWDEV-556684 - Remove HSAIL support (#1183)

Этот коммит содержится в:
Pengda Xie
2025-10-23 11:21:49 -07:00
коммит произвёл GitHub
родитель db949445c3
Коммит a4bbd73dc6
53 изменённых файлов: 410 добавлений и 5066 удалений
+6 -49
Просмотреть файл
@@ -55,6 +55,7 @@ Program::~Program() {
Program::Program(roc::NullDevice& device, amd::Program& owner) : device::Program(device, owner) {
hsaExecutable_.handle = 0;
hsaCodeObjectReader_.handle = 0;
isHIP_ = (owner.language() == amd::Program::HIP);
}
bool Program::initClBinary(char* binaryIn, size_t size) {
@@ -201,58 +202,16 @@ bool Program::createGlobalVarObj(amd::Memory** amd_mem_obj, void** device_pptr,
return true;
}
HSAILProgram::HSAILProgram(roc::NullDevice& device, amd::Program& owner)
: roc::Program(device, owner) {}
HSAILProgram::~HSAILProgram() {}
bool HSAILProgram::saveBinaryAndSetType(type_t type) { return true; }
bool HSAILProgram::setKernels(void* binary, size_t binSize, amd::Os::FileDesc fdesc, size_t foffset,
std::string uri) {
return true;
}
LightningProgram::LightningProgram(roc::NullDevice& device, amd::Program& owner)
: roc::Program(device, owner) {
isLC_ = true;
isHIP_ = (owner.language() == amd::Program::HIP);
}
bool LightningProgram::createBinary(amd::option::Options* options) {
#if defined(USE_COMGR_LIBRARY)
bool Program::createBinary(amd::option::Options* options) {
if (!clBinary()->createElfBinary(options->oVariables->BinEncrypt, type())) {
LogError("Failed to create ELF binary image!");
return false;
}
#endif // defined(USE_COMGR_LIBRARY)
return true;
}
bool LightningProgram::saveBinaryAndSetType(type_t type, void* rawBinary, size_t size) {
#if defined(USE_COMGR_LIBRARY)
// Write binary to memory
if (type == TYPE_EXECUTABLE) { // handle code object binary
assert(rawBinary != nullptr && size != 0 && "must pass in the binary");
} else { // handle LLVM binary
if (llvmBinary_.empty()) {
buildLog_ += "ERROR: Tried to save empty LLVM binary \n";
return false;
}
rawBinary = (void*)llvmBinary_.data();
size = llvmBinary_.size();
}
clBinary()->saveBIFBinary((char*)rawBinary, size);
// Set the type of binary
setType(type);
#endif // defined(USE_COMGR_LIBRARY)
return true;
}
bool LightningProgram::createKernels(void* binary, size_t binSize, bool useUniformWorkGroupSize,
bool internalKernel) {
bool Program::createKernels(void* binary, size_t binSize, bool useUniformWorkGroupSize,
bool internalKernel) {
// Find the size of global variables from the binary
if (!FindGlobalVarSize(binary, binSize)) {
buildLog_ += "Error: Cannot Find Global Var Sizes\n";
@@ -274,9 +233,8 @@ bool LightningProgram::createKernels(void* binary, size_t binSize, bool useUnifo
return true;
}
bool LightningProgram::setKernels(void* binary, size_t binSize, amd::Os::FileDesc fdesc,
size_t foffset, std::string uri) {
#if defined(USE_COMGR_LIBRARY)
bool Program::setKernels(void* binary, size_t binSize, amd::Os::FileDesc fdesc,
size_t foffset, std::string uri) {
// Stop compilation if it is an offline device - HSA runtime does not
// support ISA compiled offline
if (!device().isOnline()) {
@@ -330,7 +288,6 @@ bool LightningProgram::setKernels(void* binary, size_t binSize, amd::Os::FileDes
return false;
}
}
#endif // defined(USE_COMGR_LIBRARY)
return true;
}