Skip to content

Commit 3d9c399

Browse files
committed
Merge remote-tracking branch 'origin/main' into sean/rename-interop-to-external
2 parents 2987e19 + a985a81 commit 3d9c399

31 files changed

+188
-68
lines changed

.github/docker/ubuntu-22.04.Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ ARG BASE_DEPS="\
3232
ARG UR_DEPS="\
3333
doxygen \
3434
python3 \
35-
python3-pip"
35+
python3-pip \
36+
libhwloc-dev"
3637

3738
# Unified Runtime's dependencies (installed via pip)
3839
ARG UR_PYTHON_DEPS="\

.github/scripts/install_hwloc.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (C) 2024 Intel Corporation
4+
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
5+
# See LICENSE.TXT
6+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
8+
# install_hwloc.sh - Script for building and installing HWLOC library from source code
9+
10+
set -e
11+
12+
git clone -b hwloc-2.3.0 https://github.com/open-mpi/hwloc.git
13+
pushd hwloc
14+
./autogen.sh
15+
./configure
16+
make -j$(nproc)
17+
sudo make install -j$(nproc)
18+
popd

.github/workflows/build-hw-reusable.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
required: false
1212
type: string
1313
default: ""
14+
static_loader:
15+
required: false
16+
type: string
17+
default: OFF
1418

1519
permissions:
1620
contents: read
@@ -29,14 +33,19 @@ jobs:
2933
strategy:
3034
matrix:
3135
adapter: [
32-
{name: "${{inputs.name}}", platform: "${{inputs.platform}}"},
36+
{name: "${{inputs.name}}", platform: "${{inputs.platform}}", static_Loader: "${{inputs.static_loader}}"},
3337
]
3438
build_type: [Debug, Release]
3539
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}]
3640
# TODO: The latest L0 loader segfaults when built with clang.
3741
exclude:
3842
- adapter: {name: L0, platform: ""}
3943
compiler: {c: clang, cxx: clang++}
44+
# Exclude these configurations to avoid overloading the runners.
45+
- adapter: {static_Loader: ON}
46+
build_type: Release
47+
- adapter: {static_Loader: ON}
48+
compiler: {c: clang, cxx: clang++}
4049

4150
runs-on: ${{matrix.adapter.name}}
4251

@@ -63,6 +72,7 @@ jobs:
6372
-DUR_DEVELOPER_MODE=ON
6473
-DUR_BUILD_TESTS=ON
6574
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
75+
-DUR_STATIC_LOADER=${{matrix.adapter.static_Loader}}
6676
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
6777
-DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib
6878
${{ matrix.adapter.name == 'HIP' && '-DUR_CONFORMANCE_AMD_ARCH=gfx1030' || '' }}

.github/workflows/cmake.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ jobs:
4747
sudo apt-get update
4848
sudo apt-get install -y doxygen ${{matrix.compiler.c}}
4949
50+
- name: Install libhwloc
51+
run: .github/scripts/install_hwloc.sh
52+
5053
- name: Install g++-7
5154
if: matrix.compiler.cxx == 'g++-7'
5255
run: |
@@ -121,13 +124,20 @@ jobs:
121124
uses: ./.github/workflows/build-fuzz-reusable.yml
122125
with:
123126
test_label: "fuzz-short"
124-
127+
125128
level-zero:
126129
name: Level Zero
127130
uses: ./.github/workflows/build-hw-reusable.yml
128131
with:
129132
name: L0
130133

134+
level-zero-static:
135+
name: Level Zero static
136+
uses: ./.github/workflows/build-hw-reusable.yml
137+
with:
138+
name: L0
139+
static_loader: ON
140+
131141
opencl:
132142
name: OpenCL
133143
uses: ./.github/workflows/build-hw-reusable.yml
@@ -217,11 +227,17 @@ jobs:
217227
Expand-Archive -Path "$WorkingDir\doxygen.zip"
218228
Add-Content $env:GITHUB_PATH "$WorkingDir\doxygen"
219229
230+
- name: Install hwloc
231+
run: vcpkg install hwloc:x64-windows
232+
220233
- name: Configure CMake
234+
env:
235+
VCPKG_PATH: "C:/vcpkg/packages/hwloc_x64-windows"
221236
run: >
222237
cmake
223238
-B${{github.workspace}}/build
224239
${{matrix.toolset}}
240+
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
225241
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
226242
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
227243
-DCMAKE_POLICY_DEFAULT_CMP0094=NEW
@@ -260,6 +276,9 @@ jobs:
260276
- name: Install prerequisites
261277
run: python3 -m pip install -r third_party/requirements.txt
262278

279+
- name: Install hwloc
280+
run: brew install hwloc
281+
263282
- name: Configure CMake
264283
run: >
265284
cmake

.github/workflows/codeql.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ jobs:
3131
- name: Install pip packages
3232
run: pip install -r third_party/requirements.txt
3333

34+
- name: Install apt packages
35+
run: |
36+
sudo apt-get update
37+
sudo apt-get install -y libhwloc-dev
38+
3439
- name: Configure CMake
3540
run: cmake -B ${{github.workspace}}/build -DUR_DEVELOPER_MODE=ON -DUR_BUILD_TESTS=ON -DUR_ENABLE_TRACING=ON -DUR_BUILD_TOOLS=ON -DUMF_ENABLE_POOL_TRACKING=ON
3641

@@ -61,8 +66,13 @@ jobs:
6166
- name: Install pip packages
6267
run: python3 -m pip install -r third_party/requirements.txt
6368

69+
- name: Install hwloc
70+
run: vcpkg install hwloc:x64-windows
71+
6472
- name: Configure CMake
65-
run: cmake -B ${{github.workspace}}/build -DCMAKE_POLICY_DEFAULT_CMP0094=NEW -DUR_DEVELOPER_MODE=ON -DUR_BUILD_TESTS=ON -DUR_ENABLE_TRACING=ON -DUR_BUILD_TOOLS=ON -DUMF_ENABLE_POOL_TRACKING=ON
73+
env:
74+
VCPKG_PATH: "C:/vcpkg/packages/hwloc_x64-windows"
75+
run: cmake -B ${{github.workspace}}/build -DCMAKE_POLICY_DEFAULT_CMP0094=NEW -DUR_DEVELOPER_MODE=ON -DUR_BUILD_TESTS=ON -DUR_ENABLE_TRACING=ON -DUR_BUILD_TOOLS=ON -DUMF_ENABLE_POOL_TRACKING=ON -DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
6676

6777
- name: Build
6878
run: cmake --build ${{github.workspace}}/build -j $(nproc) --config Release

.github/workflows/coverity.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ jobs:
3838
- name: Install pip packages
3939
run: pip install -r third_party/requirements.txt
4040

41+
- name: Install apt packages
42+
run: |
43+
sudo apt-get update
44+
sudo apt-get install -y libhwloc-dev
45+
4146
- name: Configure CMake
4247
run: >
4348
cmake

.github/workflows/e2e_core.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
with:
6666
files: |
6767
source/adapters/${{inputs.str_name}}/**
68+
source/loader/**
6869
6970
e2e-build-hw:
7071
# We want to run the job only if there are changes in the specific adapter

CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ option(UR_USE_MSAN "enable MemorySanitizer" OFF)
3737
option(UR_USE_TSAN "enable ThreadSanitizer" OFF)
3838
option(UR_ENABLE_TRACING "enable api tracing through xpti" OFF)
3939
option(UR_ENABLE_SANITIZER "enable device sanitizer" ON)
40-
option(UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF)
40+
option(UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" ON)
4141
option(UMF_ENABLE_POOL_TRACKING "Build UMF with pool tracking" ON)
4242
option(UR_BUILD_ADAPTER_L0 "Build the Level-Zero adapter" OFF)
4343
option(UR_BUILD_ADAPTER_OPENCL "Build the OpenCL adapter" OFF)
@@ -49,6 +49,7 @@ option(UR_BUILD_EXAMPLE_CODEGEN "Build the codegen example." OFF)
4949
option(VAL_USE_LIBBACKTRACE_BACKTRACE "enable libbacktrace validation backtrace for linux" OFF)
5050
option(UR_ENABLE_ASSERTIONS "Enable assertions for all build types" OFF)
5151
option(UR_BUILD_XPTI_LIBS "Build the XPTI libraries when tracing is enabled" ON)
52+
option(UR_STATIC_LOADER "Build loader as a static library" OFF)
5253
set(UR_DPCXX "" CACHE FILEPATH "Path of the DPC++ compiler executable")
5354
set(UR_DPCXX_BUILD_FLAGS "" CACHE STRING "Build flags to pass to DPC++ when compiling device programs")
5455
set(UR_SYCL_LIBRARY_DIR "" CACHE PATH
@@ -134,6 +135,15 @@ if(UR_ENABLE_TRACING)
134135
set_target_properties(xptifw PROPERTIES
135136
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
136137
)
138+
139+
if (UR_STATIC_LOADER)
140+
install(TARGETS xpti xptifw
141+
EXPORT ${PROJECT_NAME}-targets
142+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
143+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
144+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
145+
)
146+
endif()
137147
endif()
138148

139149
if (MSVC)
@@ -179,7 +189,7 @@ endif()
179189
if(UR_FORMAT_CPP_STYLE)
180190
find_program(CLANG_FORMAT NAMES clang-format-15 clang-format-15.0 clang-format)
181191

182-
if(CLANG_FORMAT)
192+
if(CLANG_FORMAT)
183193
get_program_version_major_minor(${CLANG_FORMAT} CLANG_FORMAT_VERSION)
184194
message(STATUS "Found clang-format: ${CLANG_FORMAT} (version: ${CLANG_FORMAT_VERSION})")
185195

source/adapters/cuda/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ endif()
114114
target_link_libraries(${TARGET_NAME} PRIVATE
115115
${PROJECT_NAME}::headers
116116
${PROJECT_NAME}::common
117+
${PROJECT_NAME}::umf
117118
Threads::Threads
118119
cudadrv
119120
${EXTRA_LIBS}

source/adapters/cuda/usm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context,
398398

399399
HostMemPool =
400400
umf::poolMakeUniqueFromOps(
401-
&UMF_DISJOINT_POOL_OPS, std::move(MemProvider),
401+
umfDisjointPoolOps(), std::move(MemProvider),
402402
&this->DisjointPoolConfigs.Configs[usm::DisjointPoolMemType::Host])
403403
.second;
404404

@@ -407,15 +407,15 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context,
407407
umf::memoryProviderMakeUnique<USMDeviceMemoryProvider>(Context, Device)
408408
.second;
409409
DeviceMemPool = umf::poolMakeUniqueFromOps(
410-
&UMF_DISJOINT_POOL_OPS, std::move(MemProvider),
410+
umfDisjointPoolOps(), std::move(MemProvider),
411411
&this->DisjointPoolConfigs
412412
.Configs[usm::DisjointPoolMemType::Device])
413413
.second;
414414
MemProvider =
415415
umf::memoryProviderMakeUnique<USMSharedMemoryProvider>(Context, Device)
416416
.second;
417417
SharedMemPool = umf::poolMakeUniqueFromOps(
418-
&UMF_DISJOINT_POOL_OPS, std::move(MemProvider),
418+
umfDisjointPoolOps(), std::move(MemProvider),
419419
&this->DisjointPoolConfigs
420420
.Configs[usm::DisjointPoolMemType::Shared])
421421
.second;

0 commit comments

Comments
 (0)