Skip to content

Commit 428e1d2

Browse files
authored
Merge branch 'main' into fabio/fix_cuda_intermittent
2 parents 61b3ef9 + c311fe8 commit 428e1d2

File tree

147 files changed

+3992
-6497
lines changed

Some content is hidden

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

147 files changed

+3992
-6497
lines changed

.github/workflows/cmake.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110

111111
- name: Test
112112
working-directory: ${{github.workspace}}/build
113-
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "python|umf|loader|validation|tracing|unit|urtrace"
113+
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace"
114114

115115
fuzztest-build:
116116
name: Build and run quick fuzztest scenarios
@@ -346,7 +346,7 @@ jobs:
346346

347347
- name: Test
348348
working-directory: ${{github.workspace}}/build
349-
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "python|umf|loader|validation|tracing|unit|urtrace"
349+
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace"
350350

351351

352352
macos-build:

.github/workflows/coverage.yml

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

6666
- name: Test
6767
working-directory: ${{github.workspace}}/build
68-
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "python|umf|loader|validation|tracing|unit|urtrace"
68+
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace"
6969

7070
- name: Quick Coverage Info
7171
working-directory: ${{github.workspace}}/build

.github/workflows/coverity.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ name: coverity-unified-runtime
99
# It runs static analysis build - Coverity. It requires special token (set in CI's secret).
1010

1111
on:
12-
push:
13-
branches: ["main"]
1412
workflow_dispatch:
13+
schedule:
14+
# Run every day at 22:00 UTC
15+
- cron: '0 22 * * *'
1516

1617
env:
1718
WORKDIR: ${{ github.workspace }}
@@ -22,10 +23,11 @@ env:
2223
COVERITY_SCAN_BRANCH_PATTERN: "main"
2324
TRAVIS_BRANCH: ${{ github.ref_name }}
2425

26+
2527
jobs:
2628
linux:
2729
name: Coverity
28-
runs-on: ubuntu-latest
30+
runs-on: coverity
2931

3032
steps:
3133
- name: Clone the git repo
@@ -35,7 +37,20 @@ jobs:
3537
run: pip install -r third_party/requirements.txt
3638

3739
- name: Configure CMake
38-
run: cmake -B $WORKDIR/build -DUR_ENABLE_TRACING=ON -DUR_DEVELOPER_MODE=ON -DUR_BUILD_TESTS=ON -DUMF_ENABLE_POOL_TRACKING=ON
40+
run: >
41+
cmake
42+
-B $WORKDIR/build
43+
-DUR_ENABLE_TRACING=ON
44+
-DUR_DEVELOPER_MODE=ON
45+
-DUR_BUILD_TESTS=ON
46+
-DUMF_ENABLE_POOL_TRACKING=ON
47+
-DUR_FORMAT_CPP_STYLE=ON
48+
-DCMAKE_BUILD_TYPE=Debug
49+
-DUR_BUILD_ADAPTER_L0=ON
50+
-DUR_BUILD_ADAPTER_CUDA=ON
51+
-DCUDA_CUDA_LIBRARY=/usr/local/cuda/lib64/stubs/libcuda.so
52+
-DUR_BUILD_ADAPTER_NATIVE_CPU=ON
53+
-DUR_BUILD_ADAPTER_HIP=ON
3954
4055
- name: Run Coverity
4156
run: |

.github/workflows/e2e_nightly.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ jobs:
1111
strategy:
1212
matrix:
1313
adapter: [
14-
{name: CUDA}
14+
{name: CUDA, str_name: cuda, prefix: "ext_oneapi_", config: "--cuda --hip", unit: "gpu"},
15+
{name: OPENCL, str_name: opencl, prefix: "", config: "", unit: "cpu"}
1516
]
1617
build_type: [Release]
1718
compiler: [{c: clang, cxx: clang++}]
@@ -30,7 +31,6 @@ jobs:
3031
- name: Checkout UR
3132
uses: actions/checkout@v4
3233
with:
33-
ref: adapters
3434
path: ur-repo
3535

3636
- name: Checkout SYCL
@@ -60,12 +60,18 @@ jobs:
6060
run: LD_LIBRARY_PATH=${{github.workspace}}/dpcpp_compiler/lib
6161
cmake --build ${{github.workspace}}/ur-repo/build -j $(nproc)
6262

63-
- name: Set env vars & pre setup
63+
- name: Set prefer UR
64+
run: echo "SYCL_PREFER_UR=1" >> $GITHUB_ENV
65+
66+
- name: Set CUDA env vars
67+
if: matrix.adapter.name == 'CUDA'
6468
run: |
65-
echo "SYCL_PREFER_UR=1" >> $GITHUB_ENV
6669
echo "CUDA_LIB_PATH=/usr/local/cuda/lib64/stubs" >> $GITHUB_ENV
6770
echo "LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
68-
source /opt/intel/oneapi/setvars.sh
71+
72+
- name: Run pre setup
73+
run: |
74+
source /opt/intel/oneapi/setvars.sh --force
6975
sycl-ls
7076
7177
- name: Configure SYCL
@@ -74,7 +80,7 @@ jobs:
7480
-t ${{matrix.build_type}}
7581
-o ${{github.workspace}}/sycl_build
7682
--cmake-gen "Unix Makefiles"
77-
--ci-defaults --cuda --hip
83+
--ci-defaults ${{matrix.adapter.config}}
7884
--cmake-opt="-DLLVM_INSTALL_UTILS=ON"
7985
--cmake-opt="-DSYCL_PI_TESTS=OFF"
8086
--cmake-opt=-DCMAKE_C_COMPILER_LAUNCHER=ccache
@@ -92,7 +98,7 @@ jobs:
9298
- name: Swap UR loader and adapters
9399
run: |
94100
cp ${{github.workspace}}/ur-repo/build/lib/libur_loader.so* ${{github.workspace}}/sycl_build/lib/
95-
cp ${{github.workspace}}/ur-repo/build/lib/libur_adapter_cuda.so* ${{github.workspace}}/sycl_build/lib/
101+
cp ${{github.workspace}}/ur-repo/build/lib/libur_adapter_${{matrix.adapter.str_name}}.so* ${{github.workspace}}/sycl_build/lib/
96102
97103
- name: Set additional env. vars
98104
run: |
@@ -111,7 +117,7 @@ jobs:
111117
-GNinja
112118
-B ${{github.workspace}}/build-e2e/
113119
-S ${{github.workspace}}/sycl-repo/sycl/test-e2e/
114-
-DSYCL_TEST_E2E_TARGETS="ext_oneapi_cuda:gpu"
120+
-DSYCL_TEST_E2E_TARGETS="${{matrix.adapter.prefix}}${{matrix.adapter.str_name}}:${{matrix.adapter.unit}}"
115121
-DCMAKE_CXX_COMPILER="$(which clang++)"
116122
-DLLVM_LIT="${{github.workspace}}/sycl-repo/llvm/utils/lit/lit.py"
117123

.github/workflows/nightly.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v3
20-
# with-ref part to be removed after merging 'adapters' branch with 'main'
21-
with:
22-
ref: adapters
2320

2421
- name: Install pip packages
2522
run: pip install -r third_party/requirements.txt

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ option(UR_USE_MSAN "enable MemorySanitizer" OFF)
3535
option(UR_USE_TSAN "enable ThreadSanitizer" OFF)
3636
option(UR_ENABLE_TRACING "enable api tracing through xpti" OFF)
3737
option(UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF)
38-
option(UMF_ENABLE_POOL_TRACKING "Build UMF with pool tracking" OFF)
38+
option(UMF_ENABLE_POOL_TRACKING "Build UMF with pool tracking" ON)
3939
option(UR_BUILD_ADAPTER_L0 "Build the Level-Zero adapter" OFF)
4040
option(UR_BUILD_ADAPTER_OPENCL "Build the OpenCL adapter" OFF)
4141
option(UR_BUILD_ADAPTER_CUDA "Build the CUDA adapter" OFF)
@@ -47,6 +47,9 @@ option(VAL_USE_LIBBACKTRACE_BACKTRACE "enable libbacktrace validation backtrace
4747
set(UR_DPCXX "" CACHE FILEPATH "Path of the DPC++ compiler executable")
4848
set(UR_SYCL_LIBRARY_DIR "" CACHE PATH
4949
"Path of the SYCL runtime library directory")
50+
option(UR_ENABLE_ASSERTIONS "Enable assertions for all build types" OFF)
51+
52+
include(Assertions)
5053

5154
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
5255
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
[![Coverity](https://scan.coverity.com/projects/28213/badge.svg)](https://scan.coverity.com/projects/oneapi-src-unified-runtime)
77
[![codecov.io](https://codecov.io/github/oneapi-src/unified-runtime/coverage.svg?branch=main)](https://codecov.io/github/oneapi-src/unified-runtime?branch=master)
88

9-
## Adapters
10-
Adapter implementations for Unified Runtime currently reside in the [SYCL repository](https://github.com/intel/llvm/tree/sycl/sycl/plugins/unified_runtime/ur). This branch contains scripts to automatically
11-
fetch and build them directly in the UR tree. The adapters are disabled by default,
12-
see cmake options for details.
13-
149
<!-- TODO: add general description and purpose of the project -->
1510

1611
## Table of contents

cmake/Assertions.cmake

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# From the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2+
# See https://llvm.org/LICENSE.txt for license information.
3+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
5+
# This is lifted from llvm's LLVM_ENABLE_ASSERTIONS implementation
6+
# https://github.com/llvm/llvm-project/blob/6be0e979896f7dd610abf263f845c532f1be3762/llvm/cmake/modules/HandleLLVMOptions.cmake#L89
7+
if(UR_ENABLE_ASSERTIONS)
8+
# MSVC doesn't like _DEBUG on release builds
9+
if( NOT MSVC )
10+
add_compile_definitions(_DEBUG)
11+
endif()
12+
# On non-Debug builds cmake automatically defines NDEBUG, so we
13+
# explicitly undefine it:
14+
if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
15+
add_compile_options($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:-UNDEBUG>)
16+
if (MSVC)
17+
# Also remove /D NDEBUG to avoid MSVC warnings about conflicting defines.
18+
foreach (flags_var_to_scrub
19+
CMAKE_CXX_FLAGS_RELEASE
20+
CMAKE_CXX_FLAGS_RELWITHDEBINFO
21+
CMAKE_CXX_FLAGS_MINSIZEREL
22+
CMAKE_C_FLAGS_RELEASE
23+
CMAKE_C_FLAGS_RELWITHDEBINFO
24+
CMAKE_C_FLAGS_MINSIZEREL)
25+
string (REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " "
26+
"${flags_var_to_scrub}" "${${flags_var_to_scrub}}")
27+
endforeach()
28+
endif()
29+
endif()
30+
endif()

0 commit comments

Comments
 (0)