File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
sycl/test-e2e/IntermediateLib Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ using namespace sycl::ext::oneapi::experimental;
4242void *loadOsLibrary (const std::string &LibraryPath) {
4343 HMODULE h =
4444 LoadLibraryExA (LibraryPath.c_str (), NULL , LOAD_WITH_ALTERED_SEARCH_PATH);
45+ if (!h) {
46+ std::cout << " LoadLibraryExA(" << LibraryPath
47+ << " ) failed with error code " << GetLastError () << std::endl;
48+ }
4549 return (void *)h;
4650}
4751int unloadOsLibrary (void *Library) {
@@ -113,6 +117,10 @@ int main() {
113117
114118 void *lib_a = loadOsLibrary (path_to_lib_a);
115119 void *f = getOsLibraryFuncAddress (lib_a, " performIncrementation" );
120+ if (!f){
121+ std::cout << " Cannot get performIncremenation function from .so/.dll" << std::endl;
122+ return 1 ;
123+ }
116124 auto performIncrementationFuncA = reinterpret_cast <IncFuncT *>(f);
117125 performIncrementationFuncA (q, buf); // call the function from lib_a
118126 q.wait ();
You can’t perform that action at this time.
0 commit comments