summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuo Yejun <yejun.guo@intel.com>2016-06-17 03:27:48 +0800
committerYang Rong <rong.r.yang@intel.com>2016-06-22 15:23:27 +0800
commit631db4a17a9982ca4a80a92dc09d4db7950a0918 (patch)
tree3c2fb3f8ceec78f247dff2dd281270726f0a97be
parent1b076ec070fea9e564a07c293320280fb7bd7f87 (diff)
downloadbeignet-631db4a17a9982ca4a80a92dc09d4db7950a0918.tar.gz
output message instead of assert when .bc file does not exist
it is possible that .bc file is missing in the system, provide end users with detail message. Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
-rw-r--r--backend/src/llvm/llvm_bitcode_link.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/backend/src/llvm/llvm_bitcode_link.cpp b/backend/src/llvm/llvm_bitcode_link.cpp
index 990babde..748a7fe5 100644
--- a/backend/src/llvm/llvm_bitcode_link.cpp
+++ b/backend/src/llvm/llvm_bitcode_link.cpp
@@ -50,7 +50,10 @@ namespace gbe
break;
}
}
- assert(findBC);
+ if (!findBC) {
+ printf("Fatal Error: ocl lib %s does not exist\n", bitCodeFiles.c_str());
+ return NULL;
+ }
#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR <= 5
oclLib = getLazyIRFileModule(FilePath, Err, ctx);
@@ -138,7 +141,8 @@ namespace gbe
std::set<std::string> materializedFuncs;
std::vector<GlobalValue *> Gvs;
Module* clonedLib = createOclBitCodeModule(ctx, strictMath);
- assert(clonedLib && "Can not create the beignet bitcode\n");
+ if (clonedLib == NULL)
+ return NULL;
std::vector<const char *> kernels;
std::vector<const char *> builtinFuncs;