SWDEV-229840 - Improve Error Codes. RocKernel and RocProgram

Change-Id: I8f785308e0562a50924f8bdd02e88c92a759f01a
This commit is contained in:
kjayapra-amd
2020-04-02 22:13:26 -04:00
parent 55fad9b929
commit cd7de89fc3
2 changed files with 61 additions and 21 deletions
+8
View File
@@ -104,6 +104,8 @@ bool Program::initClBinary(char* binaryIn, size_t size) {
char* decryptedBin;
size_t decryptedSize;
if (!clBinary()->decryptElf(binaryIn, size, &decryptedBin, &decryptedSize, &encryptCode)) {
buildLog_ += "Decrypting ELF Failed ";
buildLog_ += "\n";
return false;
}
if (decryptedBin != nullptr) {
@@ -118,6 +120,8 @@ bool Program::initClBinary(char* binaryIn, size_t size) {
if (decryptedBin != nullptr) {
delete[] decryptedBin;
}
buildLog_ += "Elf Magic failed";
buildLog_ += "\n";
return false;
}
@@ -419,6 +423,8 @@ bool HSAILProgram::setKernels(amd::option::Options* options, void* binary, size_
workitemPrivateSegmentByteSize,
kernargSegmentByteSize, kernargSegmentAlignment);
if (!aKernel->init()) {
buildLog_ += "Error: Kernel Init Failed ";
buildLog_ += "\n";
return false;
}
aKernel->setUniformWorkGroupSize(options->oVariables->UniformWorkGroupSize);
@@ -476,6 +482,8 @@ bool LightningProgram::setKernels(amd::option::Options* options, void* binary, s
#if defined(USE_COMGR_LIBRARY)
// Find the size of global variables from the binary
if (!FindGlobalVarSize(binary, binSize)) {
buildLog_ += "Error: Cannot Global Var Sizes ";
buildLog_ += "\n";
return false;
}