Skip to content

cleanup include ze_api.h #525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ if(UMF_BUILD_GPU_EXAMPLES
LIBS disjoint_pool ze_loader umf)

target_include_directories(
${EXAMPLE_NAME}
PRIVATE ${LEVEL_ZERO_INCLUDE_DIRS} ${UMF_CMAKE_SOURCE_DIR}/src/utils
${UMF_CMAKE_SOURCE_DIR}/include)
${EXAMPLE_NAME} PRIVATE ${UMF_CMAKE_SOURCE_DIR}/src/utils
${UMF_CMAKE_SOURCE_DIR}/include)

target_link_directories(${EXAMPLE_NAME} PRIVATE ${LIBHWLOC_LIBRARY_DIRS})

Expand Down
2 changes: 2 additions & 0 deletions examples/basic/utils_level_zero.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <stdio.h>
#include <stdlib.h>

// To use the Level Zero API, the Level Zero SDK has to be installed
// on the system
#ifdef _WIN32
#include <ze_api.h>
#else
Expand Down
4 changes: 1 addition & 3 deletions src/provider/provider_level_zero.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
#include <stddef.h>
#include <string.h>

// Level Zero API
#include <ze_api.h>

#include <umf.h>
#include <umf/memory_provider_ops.h>
#include <umf/providers/provider_level_zero.h>
Expand All @@ -24,6 +21,7 @@
#include "utils_load_library.h"
#include "utils_log.h"
#include "utils_sanitizers.h"
#include "ze_api.h"

typedef struct ze_memory_provider_t {
ze_context_handle_t context;
Expand Down
4 changes: 4 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,17 @@ if(UMF_BUILD_GPU_TESTS AND UMF_BUILD_LEVEL_ZERO_PROVIDER)
NAME provider_level_zero
SRCS providers/provider_level_zero.cpp
LIBS ${UMF_UTILS_FOR_TEST} ze_loader)
target_include_directories(umf_test-provider_level_zero
PRIVATE ${LEVEL_ZERO_INCLUDE_DIRS})

add_umf_test(
NAME provider_level_zero_dlopen
SRCS providers/provider_level_zero.cpp
LIBS ${UMF_UTILS_FOR_TEST})
target_compile_definitions(umf_test-provider_level_zero_dlopen
PUBLIC USE_DLOPEN=1)
target_include_directories(umf_test-provider_level_zero_dlopen
PRIVATE ${LEVEL_ZERO_INCLUDE_DIRS})
endif()

if(UMF_BUILD_SHARED_LIBRARY)
Expand Down
12 changes: 6 additions & 6 deletions test/providers/provider_level_zero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
#ifdef _WIN32
//workaround for std::numeric_limits on windows
#define NOMINMAX
#include <ze_api.h>
#else
#include <level_zero/ze_api.h>
#endif

#include <mutex>

#include <umf/providers/provider_level_zero.h>

#include "ipcFixtures.hpp"
#include "pool.hpp"
#include "umf/providers/provider_level_zero.h"
#include "utils_load_library.h"

#include <mutex>
#include "ze_api.h"

using umf_test::test;
using namespace umf_test;
Expand Down