Skip to content

Commit a81da22

Browse files
authored
Merge pull request #628 from pbalcer/disjoint-pool-gcc-7
[usm allocator] add linking with pthreads
2 parents 7871680 + 4136fbb commit a81da22

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

.github/workflows/cmake.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ jobs:
2424
build_type: Release
2525
compiler: {c: clang, cxx: clang++}
2626
libbacktrace: '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON'
27+
- os: 'ubuntu-20.04'
28+
build_type: Release
29+
compiler: {c: gcc-7, cxx: g++-7}
2730

2831
runs-on: ${{matrix.os}}
2932

@@ -35,6 +38,11 @@ jobs:
3538
sudo apt-get update
3639
sudo apt-get install -y doxygen ${{matrix.compiler.c}}
3740
41+
- name: Install g++-7
42+
if: matrix.compiler.cxx == 'g++-7'
43+
run: |
44+
sudo apt-get install -y ${{matrix.compiler.cxx}}
45+
3846
- name: Install pip packages
3947
run: pip install -r third_party/requirements.txt
4048

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,16 @@ if(UR_ENABLE_TRACING)
9696
set(XPTI_SOURCE_DIR ${xpti_SOURCE_DIR})
9797
set(XPTI_DIR ${xpti_SOURCE_DIR})
9898
set(XPTI_ENABLE_TESTS OFF CACHE INTERNAL "Turn off xptifw tests")
99+
99100
FetchContentSparse_Declare(xptifw https://github.com/intel/llvm.git "sycl-nightly/20230304" "xptifw")
101+
100102
FetchContent_MakeAvailable(xptifw)
103+
104+
check_cxx_compiler_flag("-Wno-error=maybe-uninitialized" HAS_MAYBE_UNINIT)
105+
if (HAS_MAYBE_UNINIT)
106+
target_compile_options(xptifw PRIVATE -Wno-error=maybe-uninitialized)
107+
endif()
108+
101109
set_target_properties(xptifw PROPERTIES
102110
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
103111
)

source/common/uma_pools/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,11 @@ target_link_libraries(disjoint_pool PRIVATE
1414
unified_memory_allocation
1515
${PROJECT_NAME}::headers)
1616

17+
if (UNIX)
18+
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
19+
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
20+
find_package(Threads REQUIRED)
21+
target_link_libraries(disjoint_pool PRIVATE Threads::Threads)
22+
endif()
23+
1724
target_include_directories(disjoint_pool PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

test/unified_memory_allocation/memoryPool.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ TEST_P(umaMultiPoolTest, memoryTracking) {
117117
ASSERT_EQ(pool, expectedPool);
118118
}
119119

120-
for (auto [ptr, _1, _2] : ptrs) {
121-
umaFree(ptr);
120+
for (auto p : ptrs) {
121+
umaFree(std::get<0>(p));
122122
}
123123
}
124124

0 commit comments

Comments
 (0)