SWDEV-280473 - Remove HSAIL support from the ROCm backend

In adition to removing the HSAIL logic from the ROCm backend, guard all
of the HSAIL includes in the common layer behind the WITH_COMPILER_LIB
define. This is to avoid including HSAIL headers when building with
no support for it.

In common logic replace the use of the aclType enum with the new
Program::file_type_t enum. This is essentially a local copy of the HSAIL
enum to avoid including any HSAIL headers.

Change-Id: Ica0651d1b29dfccc255cc584eb82a5cb35e1b520
Этот коммит содержится в:
Vladislav Sytchenko
2021-04-12 14:55:06 -04:00
родитель 2b133ed3de
Коммит cbeb372e46
17 изменённых файлов: 126 добавлений и 405 удалений
+12
Просмотреть файл
@@ -56,9 +56,11 @@ extern void DeviceUnload();
#include "blowfish/oclcrypt.hpp"
#endif
#if defined(WITH_COMPILER_LIB)
#include "utils/bif_section_labels.hpp"
#include "utils/libUtils.h"
#include "spirv/spirvUtils.h"
#endif
#include <vector>
#include <string>
@@ -757,6 +759,7 @@ bool ClBinary::setElfTarget() {
return true;
}
#if defined(WITH_COMPILER_LIB)
std::string ClBinary::getBIFSymbol(unsigned int symbolID) const {
size_t nSymbols = 0;
// Due to PRE & POST defines in bif_section_labels.hpp conflict with
@@ -791,6 +794,7 @@ std::string ClBinary::getBIFSymbol(unsigned int symbolID) const {
}
return "";
}
#endif
void ClBinary::init(amd::option::Options* optionsObj) {
// option has higher priority than environment variable.
@@ -1089,6 +1093,7 @@ bool ClBinary::loadCompileOptions(std::string& compileOptions) const {
char* options = nullptr;
size_t sz;
compileOptions.clear();
#if defined(WITH_COMPILER_LIB)
if (elfIn_->getSymbol(amd::Elf::COMMENT, getBIFSymbol(symOpenclCompilerOptions).c_str(),
&options, &sz)) {
if (sz > 0) {
@@ -1096,6 +1101,7 @@ bool ClBinary::loadCompileOptions(std::string& compileOptions) const {
}
return true;
}
#endif
return false;
}
@@ -1103,6 +1109,7 @@ bool ClBinary::loadLinkOptions(std::string& linkOptions) const {
char* options = nullptr;
size_t sz;
linkOptions.clear();
#if defined(WITH_COMPILER_LIB)
if (elfIn_->getSymbol(amd::Elf::COMMENT, getBIFSymbol(symOpenclLinkerOptions).c_str(),
&options, &sz)) {
if (sz > 0) {
@@ -1110,17 +1117,22 @@ bool ClBinary::loadLinkOptions(std::string& linkOptions) const {
}
return true;
}
#endif
return false;
}
void ClBinary::storeCompileOptions(const std::string& compileOptions) {
#if defined(WITH_COMPILER_LIB)
elfOut()->addSymbol(amd::Elf::COMMENT, getBIFSymbol(symOpenclCompilerOptions).c_str(),
compileOptions.c_str(), compileOptions.length());
#endif
}
void ClBinary::storeLinkOptions(const std::string& linkOptions) {
#if defined(WITH_COMPILER_LIB)
elfOut()->addSymbol(amd::Elf::COMMENT, getBIFSymbol(symOpenclLinkerOptions).c_str(),
linkOptions.c_str(), linkOptions.length());
#endif
}
bool ClBinary::isSPIR() const {