diff --git a/level_zero/CMakeLists.txt b/level_zero/CMakeLists.txt index 69daab12e5..4c21a9643e 100644 --- a/level_zero/CMakeLists.txt +++ b/level_zero/CMakeLists.txt @@ -391,6 +391,16 @@ if(BUILD_WITH_L0) target_include_directories(${LIB_NAME} PUBLIC ${WDK_INCLUDE_PATHS}) endif() + if(WIN32) + target_include_directories(${LIB_NAME} PUBLIC + ${NEO_SHARED_DIRECTORY}/os_interface/windows + ) + else() + target_include_directories(${LIB_NAME} PUBLIC + ${NEO_SHARED_DIRECTORY}/os_interface/linux + ) + endif() + create_project_source_tree(${LIB_NAME}) endfunction() diff --git a/shared/source/CMakeLists.txt b/shared/source/CMakeLists.txt index 74e76c98a8..8ac503d9bf 100644 --- a/shared/source/CMakeLists.txt +++ b/shared/source/CMakeLists.txt @@ -146,6 +146,7 @@ append_sources_from_properties(CORE_SOURCES if(WIN32) append_sources_from_properties(CORE_SOURCES + NEO_CORE_COMPILER_INTERFACE_WINDOWS NEO_CORE_GMM_HELPER_WINDOWS NEO_CORE_HELPERS_GMM_CALLBACKS_WINDOWS NEO_CORE_DIRECT_SUBMISSION_WINDOWS @@ -161,6 +162,7 @@ if(WIN32) ) else() append_sources_from_properties(CORE_SOURCES + NEO_CORE_COMPILER_INTERFACE_LINUX NEO_CORE_DIRECT_SUBMISSION_LINUX NEO_CORE_OS_INTERFACE_LINUX NEO_CORE_PAGE_FAULT_MANAGER_LINUX diff --git a/shared/source/compiler_interface/CMakeLists.txt b/shared/source/compiler_interface/CMakeLists.txt index dd1749f464..45440281ac 100644 --- a/shared/source/compiler_interface/CMakeLists.txt +++ b/shared/source/compiler_interface/CMakeLists.txt @@ -27,17 +27,5 @@ set(NEO_CORE_COMPILER_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/tokenized_string.h ) -if(WIN32) - list(APPEND NEO_CORE_COMPILER_INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}/windows/compiler_cache_windows.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/windows/os_compiler_cache_helper.cpp - ) -else() - list(APPEND NEO_CORE_COMPILER_INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}/linux/compiler_cache_linux.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/linux/os_compiler_cache_helper.cpp - ) -endif() - set_property(GLOBAL PROPERTY NEO_CORE_COMPILER_INTERFACE ${NEO_CORE_COMPILER_INTERFACE}) add_subdirectories() diff --git a/shared/source/compiler_interface/compiler_cache.h b/shared/source/compiler_interface/compiler_cache.h index 28351fc703..a1defdeba1 100644 --- a/shared/source/compiler_interface/compiler_cache.h +++ b/shared/source/compiler_interface/compiler_cache.h @@ -9,6 +9,8 @@ #include "shared/source/utilities/arrayref.h" +#include "os_handle.h" + #include #include #include @@ -16,12 +18,6 @@ #include namespace NEO { -#ifdef _WIN32 -using HandleType = void *; -#else -using HandleType = int; -#endif // _WIN32 - struct HardwareInfo; struct CompilerCacheConfig { diff --git a/shared/source/compiler_interface/linux/CMakeLists.txt b/shared/source/compiler_interface/linux/CMakeLists.txt new file mode 100644 index 0000000000..f721254f4a --- /dev/null +++ b/shared/source/compiler_interface/linux/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright (C) 2023 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +set(NEO_CORE_COMPILER_INTERFACE_LINUX + ${CMAKE_CURRENT_SOURCE_DIR}/compiler_cache_linux.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/os_compiler_cache_helper.cpp +) + +set_property(GLOBAL PROPERTY NEO_CORE_COMPILER_INTERFACE_LINUX ${NEO_CORE_COMPILER_INTERFACE_LINUX}) diff --git a/shared/source/compiler_interface/linux/compiler_cache_linux.cpp b/shared/source/compiler_interface/linux/compiler_cache_linux.cpp index 2760334d2b..d4e72ca64b 100644 --- a/shared/source/compiler_interface/linux/compiler_cache_linux.cpp +++ b/shared/source/compiler_interface/linux/compiler_cache_linux.cpp @@ -14,6 +14,7 @@ #include "shared/source/os_interface/linux/sys_calls.h" #include "shared/source/utilities/io_functions.h" +#include "os_handle.h" #include "os_inc.h" #include diff --git a/shared/source/compiler_interface/windows/CMakeLists.txt b/shared/source/compiler_interface/windows/CMakeLists.txt new file mode 100644 index 0000000000..489d70e9a7 --- /dev/null +++ b/shared/source/compiler_interface/windows/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright (C) 2023 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +set(NEO_CORE_COMPILER_INTERFACE_WINDOWS + ${CMAKE_CURRENT_SOURCE_DIR}/compiler_cache_windows.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/os_compiler_cache_helper.cpp +) + +set_property(GLOBAL PROPERTY NEO_CORE_COMPILER_INTERFACE_WINDOWS ${NEO_CORE_COMPILER_INTERFACE_WINDOWS}) diff --git a/shared/source/os_interface/linux/CMakeLists.txt b/shared/source/os_interface/linux/CMakeLists.txt index 4b82c4e597..bc20dfe13e 100644 --- a/shared/source/os_interface/linux/CMakeLists.txt +++ b/shared/source/os_interface/linux/CMakeLists.txt @@ -62,6 +62,7 @@ set(NEO_CORE_OS_INTERFACE_LINUX ${CMAKE_CURRENT_SOURCE_DIR}/memory_info.cpp ${CMAKE_CURRENT_SOURCE_DIR}/os_context_linux.cpp ${CMAKE_CURRENT_SOURCE_DIR}/os_context_linux.h + ${CMAKE_CURRENT_SOURCE_DIR}/os_handle.h ${CMAKE_CURRENT_SOURCE_DIR}/os_inc.h ${CMAKE_CURRENT_SOURCE_DIR}/os_interface_linux.cpp ${CMAKE_CURRENT_SOURCE_DIR}/os_interface_linux.h diff --git a/shared/source/os_interface/linux/os_handle.h b/shared/source/os_interface/linux/os_handle.h new file mode 100644 index 0000000000..cc97702463 --- /dev/null +++ b/shared/source/os_interface/linux/os_handle.h @@ -0,0 +1,12 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once + +namespace NEO { +using HandleType = int; +}; // namespace NEO diff --git a/shared/source/os_interface/windows/CMakeLists.txt b/shared/source/os_interface/windows/CMakeLists.txt index af00f09b28..4aad61a3b5 100644 --- a/shared/source/os_interface/windows/CMakeLists.txt +++ b/shared/source/os_interface/windows/CMakeLists.txt @@ -21,6 +21,7 @@ set(NEO_CORE_OS_INTERFACE_WINDOWS ${CMAKE_CURRENT_SOURCE_DIR}/environment_variables.h ${CMAKE_CURRENT_SOURCE_DIR}/product_helper_drm_stub.cpp ${CMAKE_CURRENT_SOURCE_DIR}/kmd_notify_properties_windows.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/os_handle.h ${CMAKE_CURRENT_SOURCE_DIR}/os_inc.h ${CMAKE_CURRENT_SOURCE_DIR}/os_interface_win.cpp ${CMAKE_CURRENT_SOURCE_DIR}/os_library_win.cpp diff --git a/shared/source/os_interface/windows/os_handle.h b/shared/source/os_interface/windows/os_handle.h new file mode 100644 index 0000000000..c300f26afd --- /dev/null +++ b/shared/source/os_interface/windows/os_handle.h @@ -0,0 +1,12 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once + +namespace NEO { +using HandleType = void *; +}; // namespace NEO