Skip to content

Commit 0e5fbce

Browse files
authored
Merge branch 'main' into yc/1218-libcxx-mess
2 parents 491e8ef + 6dc48da commit 0e5fbce

File tree

291 files changed

+14456
-3223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+14456
-3223
lines changed

.github/docker/install_dpcpp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ if [ "${SKIP_DPCPP_BUILD}" ]; then
1616
fi
1717

1818
mkdir -p ${DPCPP_PATH}/dpcpp_compiler
19-
wget -O ${DPCPP_PATH}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-09-27/sycl_linux.tar.gz
19+
wget -O ${DPCPP_PATH}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
2020
tar -xvf ${DPCPP_PATH}/dpcpp_compiler.tar.gz -C ${DPCPP_PATH}/dpcpp_compiler

.github/workflows/benchmarks-reusable.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,49 @@ jobs:
156156
- name: Install UR
157157
run: cmake --install ${{github.workspace}}/ur_build
158158

159+
- name: Checkout UMF
160+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
161+
with:
162+
repository: oneapi-src/unified-memory-framework
163+
ref: main
164+
path: umf-repo
165+
fetch-depth: 1
166+
fetch-tags: false
167+
168+
- name: Configure UMF
169+
run: >
170+
cmake -DCMAKE_BUILD_TYPE=Release
171+
-S${{github.workspace}}/umf-repo
172+
-B${{github.workspace}}/umf_build
173+
-DUMF_BUILD_BENCHMARKS=ON
174+
-DUMF_TESTS_FAIL_ON_SKIP=ON
175+
176+
- name: Build UMF
177+
run: cmake --build ${{github.workspace}}/umf_build -j $(nproc)
178+
179+
- name: Compute core range
180+
run: |
181+
# Compute the core range for the first NUMA node, skipping the first 4 cores.
182+
# This is to avoid the first cores that the kernel is likely to schedule more work on.
183+
CORES=$(lscpu | awk '
184+
/NUMA node0 CPU|On-line CPU/ {line=$0}
185+
END {
186+
split(line, a, " ")
187+
split(a[4], b, ",")
188+
sub(/^0/, "4", b[1])
189+
print b[1]
190+
}')
191+
echo "CORES=$CORES" >> $GITHUB_ENV
192+
159193
- name: Run benchmarks
160194
working-directory: ${{ github.workspace }}/ur-repo/
161195
id: benchmarks
162196
run: >
163-
numactl -N 0 ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
197+
taskset -c ${{ env.CORES }} ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
164198
~/bench_workdir
165199
--sycl ${{ github.workspace }}/sycl_build
166200
--ur ${{ github.workspace }}/ur_install
201+
--umf ${{ github.workspace }}/umf_build
167202
--adapter ${{ matrix.adapter.str_name }}
168203
${{ inputs.upload_report && '--output-html' || '' }}
169204
${{ inputs.bench_script_params }}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535

3636
- name: Download DPC++
3737
run: |
38-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
38+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
3939
mkdir dpcpp_compiler
4040
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
4141

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777

7878
- name: Download DPC++
7979
run: |
80-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
80+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
8181
mkdir dpcpp_compiler
8282
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
8383

.github/workflows/cmake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
if: matrix.os == 'ubuntu-22.04'
7777
run: |
7878
sudo apt install libncurses5
79-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-09-27/sycl_linux.tar.gz
79+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
8080
mkdir -p ${{github.workspace}}/dpcpp_compiler
8181
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C ${{github.workspace}}/dpcpp_compiler
8282

.github/workflows/multi_device.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
- name: Download DPC++
3535
run: |
36-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
36+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
3737
mkdir dpcpp_compiler
3838
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
3939
@@ -58,8 +58,7 @@ jobs:
5858

5959
- name: Test adapter specific
6060
working-directory: ${{github.workspace}}/build
61-
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" -E "test-adapter-level_zero_multi_queue" --timeout 180
62-
# TODO: investigate why test-adapter-level_zero_multi_queue fails on newer driver
61+
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180
6362

6463
- name: Test adapters
6564
working-directory: ${{github.workspace}}/build

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

66
cmake_minimum_required(VERSION 3.20.0 FATAL_ERROR)
7-
project(unified-runtime VERSION 0.11.0)
7+
project(unified-runtime VERSION 0.12.0)
88

99
# Check if unified runtime is built as a standalone project.
1010
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR UR_STANDALONE_BUILD)
@@ -27,7 +27,7 @@ option(UR_USE_ASAN "enable AddressSanitizer" OFF)
2727
option(UR_USE_UBSAN "enable UndefinedBehaviorSanitizer" OFF)
2828
option(UR_USE_MSAN "enable MemorySanitizer" OFF)
2929
option(UR_USE_TSAN "enable ThreadSanitizer" OFF)
30-
option(UR_USE_CFI "enable Control Flow Integrity checks (requires clang and implies -flto)" ON)
30+
option(UR_USE_CFI "enable Control Flow Integrity checks (requires clang and implies -flto)" OFF)
3131
option(UR_ENABLE_TRACING "enable api tracing through xpti" OFF)
3232
option(UR_ENABLE_SANITIZER "enable device sanitizer" ON)
3333
option(UR_ENABLE_SYMBOLIZER "enable symoblizer for sanitizer" OFF)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ List of options provided by CMake:
130130
| UR_USE_TSAN | Enable ThreadSanitizer | ON/OFF | OFF |
131131
| UR_USE_UBSAN | Enable UndefinedBehavior Sanitizer | ON/OFF | OFF |
132132
| UR_USE_MSAN | Enable MemorySanitizer (clang only) | ON/OFF | OFF |
133-
| UR_USE_CFI | Enable Control Flow Integrity checks (clang only, also enables lto) | ON/OFF | ON |
133+
| UR_USE_CFI | Enable Control Flow Integrity checks (clang only, also enables lto) | ON/OFF | OFF |
134134
| UR_ENABLE_TRACING | Enable XPTI-based tracing layer | ON/OFF | OFF |
135135
| UR_ENABLE_SANITIZER | Enable device sanitizer layer | ON/OFF | ON |
136136
| UR_CONFORMANCE_TARGET_TRIPLES | SYCL triples to build CTS device binaries for | Comma-separated list | spir64 |

cmake/FetchLevelZero.cmake

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ if (UR_COMPUTE_RUNTIME_TAG STREQUAL "")
104104
set(UR_COMPUTE_RUNTIME_TAG 24.39.31294.12)
105105
endif()
106106
include(FetchContent)
107-
# Sparse fetch only the dir with level zero headers to avoid pulling in the entire compute-runtime.
108-
FetchContentSparse_Declare(compute-runtime-level-zero-headers ${UR_COMPUTE_RUNTIME_REPO} "${UR_COMPUTE_RUNTIME_TAG}" "level_zero/include")
109-
FetchContent_GetProperties(compute-runtime-level-zero-headers)
110-
if(NOT compute-runtime-level-zero-headers_POPULATED)
111-
FetchContent_Populate(compute-runtime-level-zero-headers)
107+
# Sparse fetch only the dir with level zero headers for experimental features to avoid pulling in the entire compute-runtime.
108+
FetchContentSparse_Declare(exp-headers ${UR_COMPUTE_RUNTIME_REPO} "${UR_COMPUTE_RUNTIME_TAG}" "level_zero/include")
109+
FetchContent_GetProperties(exp-headers)
110+
if(NOT exp-headers_POPULATED)
111+
FetchContent_Populate(exp-headers)
112112
endif()
113113
add_library(ComputeRuntimeLevelZero-Headers INTERFACE)
114-
set(COMPUTE_RUNTIME_LEVEL_ZERO_INCLUDE "${compute-runtime-level-zero-headers_SOURCE_DIR}/../..")
114+
set(COMPUTE_RUNTIME_LEVEL_ZERO_INCLUDE "${exp-headers_SOURCE_DIR}/../..")
115115
message(STATUS "Level Zero Adapter: Using Level Zero headers from ${COMPUTE_RUNTIME_LEVEL_ZERO_INCLUDE}")
116116
target_include_directories(ComputeRuntimeLevelZero-Headers
117117
INTERFACE "$<BUILD_INTERFACE:${COMPUTE_RUNTIME_LEVEL_ZERO_INCLUDE}>"

cmake/FindRocmAgentEnumerator.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# rocm_agent_enumerator is found.
1010
#
1111

12-
find_program(ROCM_AGENT_ENUMERATOR NAMES rocm_agent_enumerator)
12+
find_program(ROCM_AGENT_ENUMERATOR NAMES rocm_agent_enumerator PATHS /opt/rocm/bin)
1313

1414
if(ROCM_AGENT_ENUMERATOR)
1515
set(ROCM_AGENT_ENUMERATOR_FOUND TRUE)

cmake/helpers.cmake

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ else()
7979
set(CXX_HAS_CFI_SANITIZE OFF)
8080
endif()
8181

82+
set(CFI_FLAGS "")
83+
if (CFI_HAS_CFI_SANITIZE)
84+
# cfi-icall requires called functions in shared libraries to also be built with cfi-icall, which we can't
85+
# guarantee. -fsanitize=cfi depends on -flto
86+
set(CFI_FLAGS "-flto -fsanitize=cfi -fno-sanitize=cfi-icall -fsanitize-ignorelist=${CMAKE_SOURCE_DIR}/sanitizer-ignorelist.txt")
87+
endif()
88+
8289
function(add_ur_target_compile_options name)
8390
if(NOT MSVC)
8491
target_compile_definitions(${name} PRIVATE -D_FORTIFY_SOURCE=2)
@@ -95,9 +102,8 @@ function(add_ur_target_compile_options name)
95102
-fPIC
96103
-fstack-protector-strong
97104
-fvisibility=hidden
98-
# cfi-icall requires called functions in shared libraries to also be built with cfi-icall, which we can't
99-
# guarantee. -fsanitize=cfi depends on -flto
100-
$<$<BOOL:${CXX_HAS_CFI_SANITIZE}>:-flto -fsanitize=cfi -fno-sanitize=cfi-icall>
105+
106+
${CFI_FLAGS}
101107
$<$<BOOL:${CXX_HAS_FCF_PROTECTION_FULL}>:-fcf-protection=full>
102108
$<$<BOOL:${CXX_HAS_FSTACK_CLASH_PROTECTION}>:-fstack-clash-protection>
103109

@@ -114,18 +120,28 @@ function(add_ur_target_compile_options name)
114120
elseif(MSVC)
115121
target_compile_options(${name} PRIVATE
116122
$<$<CXX_COMPILER_ID:MSVC>:/MP> # clang-cl.exe does not support /MP
117-
/W3
118123
/MD$<$<CONFIG:Debug>:d>
119-
/GS
120-
/DWIN32_LEAN_AND_MEAN
121-
/DNOMINMAX
124+
125+
/W3
126+
/GS # Enable: Buffer security check
127+
/Gy # Enable: Function-level linking
128+
129+
$<$<CONFIG:Release>:/sdl> # Enable: Additional SDL checks
130+
$<$<CXX_COMPILER_ID:MSVC>:/Qspectre> # Enable: Mitigate Spectre variant 1 vulnerabilities
131+
132+
/wd4267 # Disable: 'var' : conversion from 'size_t' to 'type', possible loss of data
133+
/wd6244 # Disable: local declaration of 'variable' hides previous declaration
134+
/wd6246 # Disable: local declaration of 'variable' hides declaration of same name in outer scope
135+
)
136+
137+
target_compile_definitions(${name} PRIVATE
138+
WIN32_LEAN_AND_MEAN NOMINMAX # Cajole Windows.h to define fewer symbols
139+
_CRT_SECURE_NO_WARNINGS # Slience warnings about getenv
122140
)
123141

124142
if(UR_DEVELOPER_MODE)
125-
# _CRT_SECURE_NO_WARNINGS used mainly because of getenv
126-
# C4267: The compiler detected a conversion from size_t to a smaller type.
127143
target_compile_options(${name} PRIVATE
128-
/WX /GS /D_CRT_SECURE_NO_WARNINGS /wd4267
144+
/WX # Enable: Treat all warnings as errors
129145
)
130146
endif()
131147
endif()
@@ -135,7 +151,7 @@ function(add_ur_target_link_options name)
135151
if(NOT MSVC)
136152
if (NOT APPLE)
137153
target_link_options(${name} PRIVATE
138-
$<$<BOOL:${CXX_HAS_CFI_SANITIZE}>:-flto -fsanitize=cfi -fno-sanitize=cfi-icall>
154+
${CFI_FLAGS}
139155
"LINKER:-z,relro,-z,now,-z,noexecstack"
140156
)
141157
if (UR_DEVELOPER_MODE)
@@ -149,9 +165,12 @@ function(add_ur_target_link_options name)
149165
endif()
150166
elseif(MSVC)
151167
target_link_options(${name} PRIVATE
152-
LINKER:/DYNAMICBASE
153-
LINKER:/HIGHENTROPYVA
154-
LINKER:/NXCOMPAT
168+
LINKER:/DYNAMICBASE # Enable: Modify header to indicate ASLR should be use
169+
LINKER:/HIGHENTROPYVA # Enable: High-entropy address space layout randomization (ASLR)
170+
$<$<CONFIG:Release>:
171+
LINKER:/NXCOMPAT # Enable: Data Execution Prevention
172+
LINKER:/LTCG # Enable: Link-time code generation
173+
>
155174
)
156175
endif()
157176
endfunction()

0 commit comments

Comments
 (0)