From 00ef7b92ae58dc4ea22e67e83da2dddbb48d0fa8 Mon Sep 17 00:00:00 2001 From: Piotr Balcer Date: Fri, 16 Jun 2023 14:15:32 +0200 Subject: [PATCH 1/2] [uma] remove unused variables from a tuple --- test/unified_memory_allocation/memoryPool.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unified_memory_allocation/memoryPool.hpp b/test/unified_memory_allocation/memoryPool.hpp index eb870d0bea..c242419ba1 100644 --- a/test/unified_memory_allocation/memoryPool.hpp +++ b/test/unified_memory_allocation/memoryPool.hpp @@ -117,8 +117,8 @@ TEST_P(umaMultiPoolTest, memoryTracking) { ASSERT_EQ(pool, expectedPool); } - for (auto [ptr, _1, _2] : ptrs) { - umaFree(ptr); + for (auto p : ptrs) { + umaFree(std::get<0>(p)); } } From 4136fbb19c37a8aa9d368559a738e2e7cc35033e Mon Sep 17 00:00:00 2001 From: Piotr Balcer Date: Fri, 16 Jun 2023 14:19:03 +0200 Subject: [PATCH 2/2] [usm allocator] add linking with pthreads ... and add gcc-7 build to avoid breaking it in the future. --- .github/workflows/cmake.yml | 8 ++++++++ CMakeLists.txt | 8 ++++++++ source/common/uma_pools/CMakeLists.txt | 7 +++++++ 3 files changed, 23 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 75f1de272d..0e6bfadc3c 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -24,6 +24,9 @@ jobs: build_type: Release compiler: {c: clang, cxx: clang++} libbacktrace: '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON' + - os: 'ubuntu-20.04' + build_type: Release + compiler: {c: gcc-7, cxx: g++-7} runs-on: ${{matrix.os}} @@ -35,6 +38,11 @@ jobs: sudo apt-get update sudo apt-get install -y doxygen ${{matrix.compiler.c}} + - name: Install g++-7 + if: matrix.compiler.cxx == 'g++-7' + run: | + sudo apt-get install -y ${{matrix.compiler.cxx}} + - name: Install pip packages run: pip install -r third_party/requirements.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 943ceff2c0..b830166600 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,8 +96,16 @@ if(UR_ENABLE_TRACING) set(XPTI_SOURCE_DIR ${xpti_SOURCE_DIR}) set(XPTI_DIR ${xpti_SOURCE_DIR}) set(XPTI_ENABLE_TESTS OFF CACHE INTERNAL "Turn off xptifw tests") + FetchContentSparse_Declare(xptifw https://github.com/intel/llvm.git "sycl-nightly/20230304" "xptifw") + FetchContent_MakeAvailable(xptifw) + + check_cxx_compiler_flag("-Wno-error=maybe-uninitialized" HAS_MAYBE_UNINIT) + if (HAS_MAYBE_UNINIT) + target_compile_options(xptifw PRIVATE -Wno-error=maybe-uninitialized) + endif() + set_target_properties(xptifw PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} ) diff --git a/source/common/uma_pools/CMakeLists.txt b/source/common/uma_pools/CMakeLists.txt index 1e4197270e..cd93cad0a9 100644 --- a/source/common/uma_pools/CMakeLists.txt +++ b/source/common/uma_pools/CMakeLists.txt @@ -14,4 +14,11 @@ target_link_libraries(disjoint_pool PRIVATE unified_memory_allocation ${PROJECT_NAME}::headers) +if (UNIX) + set(CMAKE_THREAD_PREFER_PTHREAD TRUE) + set(THREADS_PREFER_PTHREAD_FLAG TRUE) + find_package(Threads REQUIRED) + target_link_libraries(disjoint_pool PRIVATE Threads::Threads) +endif() + target_include_directories(disjoint_pool PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})