Skip to content

Commit

Permalink
Add success test guard around LoaderDriverCheck() (oneapi-src#134)
Browse files Browse the repository at this point in the history
Signed-off-by: davidoli <[email protected]>
  • Loading branch information
dmichaelo1 authored and Jemale committed Jun 17, 2024
1 parent 4339454 commit 766975c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions source/lib/ze_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace ze_lib

if( NULL == loader )
return ZE_RESULT_ERROR_UNINITIALIZED;

typedef ze_result_t (ZE_APICALL *loaderInit_t)();
auto loaderInit = reinterpret_cast<loaderInit_t>(
GET_FUNCTION_PTR(loader, "zeLoaderInit") );
Expand All @@ -60,7 +60,7 @@ namespace ze_lib
if( ZE_RESULT_SUCCESS == result ) {
tracing_lib = zeLoaderGetTracingHandle();
}

#endif

if( ZE_RESULT_SUCCESS == result )
Expand All @@ -76,14 +76,17 @@ namespace ze_lib
if( ZE_RESULT_SUCCESS == result )
{
result = zesInit();
}
}

if( ZE_RESULT_SUCCESS == result )
{
result = zelTracingInit();
}

result = zelLoaderDriverCheck(flags);
if( ZE_RESULT_SUCCESS == result )
{
result = zelLoaderDriverCheck(flags);
}

return result;
}
Expand All @@ -95,7 +98,7 @@ extern "C" {

ze_result_t ZE_APICALL
zelLoaderGetVersions(
size_t *num_elems, //Pointer to num versions to get.
size_t *num_elems, //Pointer to num versions to get.
zel_component_version_t *versions) //Pointer to array of versions. If set to NULL, num_elems is returned
{
#ifdef DYNAMIC_LOAD_LOADER
Expand All @@ -114,8 +117,8 @@ zelLoaderGetVersions(
ze_result_t ZE_APICALL
zelLoaderTranslateHandle(
zel_handle_type_t handleType,
void *handleIn,
void **handleOut)
void *handleIn,
void **handleOut)

{
return zelLoaderTranslateHandleInternal(handleType, handleIn, handleOut);
Expand Down

0 comments on commit 766975c

Please sign in to comment.