Skip to content

Commit fa7f130

Browse files
committed
Merge remote-tracking branch 'origin/main' into add-exact-round-opt
2 parents ab1e5df + f9f71f1 commit fa7f130

File tree

78 files changed

+1300
-2165
lines changed

Some content is hidden

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

78 files changed

+1300
-2165
lines changed

.github/scripts/0001-travis-fix-travisci_build_coverity_scan.sh.patch

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/coverity.yml

Lines changed: 50 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,81 @@
1-
#
2-
# Copyright (C) 2023-2024 Intel Corporation
3-
#
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-
#
1+
# Coverity - static analysis build. It requires Coverity's token (set in CI's secret).
82
name: coverity-unified-runtime
9-
# It runs static analysis build - Coverity. It requires special token (set in CI's secret).
103

114
on:
125
workflow_dispatch:
136
schedule:
147
# Run every day at 22:00 UTC
158
- cron: '0 22 * * *'
169

17-
env:
18-
WORKDIR: ${{ github.workspace }}
19-
COVERITY_SCAN_NOTIFICATION_EMAIL: ${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }}
20-
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
21-
COVERITY_SCAN_PROJECT_NAME: ${{ github.repository }}
22-
COVERITY_SCAN_BUILD_COMMAND: "cmake --build ${{github.workspace}}/build"
23-
COVERITY_SCAN_BRANCH_PATTERN: "main"
24-
TRAVIS_BRANCH: ${{ github.ref_name }}
25-
2610
permissions:
2711
contents: read
2812

2913
jobs:
30-
linux:
14+
coverity:
3115
name: Coverity
32-
runs-on: coverity
16+
# run only on upstream; forks don't have token for upstream's cov project
17+
if: github.repository == 'oneapi-src/unified-memory-framework'
18+
runs-on: ubuntu-latest
3319

3420
steps:
35-
- name: Clone the git repo
21+
- name: Checkout repository
3622
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Install dependencies
27+
run: |
28+
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
29+
sudo dpkg -i cuda-keyring_1.1-1_all.deb
30+
sudo apt-get update
31+
sudo apt-get install -y libhwloc-dev libtbb-dev cuda-toolkit-12-6
3732
3833
- name: Install pip packages
3934
run: pip install -r third_party/requirements.txt
4035

36+
- name: Download Coverity
37+
run: |
38+
wget -O coverity_tool.tgz -nv https://scan.coverity.com/download/linux64 \
39+
--post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=oneapi-src%2Funified-runtime"
40+
41+
- name: Extract Coverity
42+
run: tar xzf coverity_tool.tgz
43+
44+
# TODO: enable HIP adapter as well (requires proper package(s) installation)
4145
- name: Configure CMake
4246
run: >
4347
cmake
44-
-B $WORKDIR/build
48+
-B ${{github.workspace}}/build
49+
-DCMAKE_BUILD_TYPE=Release
50+
-DUR_DEVELOPER_MODE=OFF
51+
-DUR_FORMAT_CPP_STYLE=ON
4552
-DUR_ENABLE_TRACING=ON
46-
-DUR_DEVELOPER_MODE=ON
4753
-DUR_BUILD_TESTS=ON
48-
-DUMF_ENABLE_POOL_TRACKING=ON
49-
-DUR_FORMAT_CPP_STYLE=ON
50-
-DCMAKE_BUILD_TYPE=Debug
5154
-DUR_BUILD_ADAPTER_L0=ON
5255
-DUR_BUILD_ADAPTER_CUDA=ON
53-
-DCUDA_CUDA_LIBRARY=/usr/local/cuda/lib64/stubs/libcuda.so
56+
-DCUDA_CUDA_LIBRARY=/usr/local/cuda-12.6/targets/x86_64-linux/lib/stubs/libcuda.so
5457
-DUR_BUILD_ADAPTER_NATIVE_CPU=ON
55-
-DUR_BUILD_ADAPTER_HIP=ON
58+
-DUR_BUILD_ADAPTER_HIP=OFF
5659
-DUR_BUILD_ADAPTER_OPENCL=ON
5760
58-
- name: Run Coverity
61+
- name: Build
62+
run: |
63+
export COVERITY_DIR=$(find . -maxdepth 1 -type d -name "cov-analysis-linux64-*" | head -n 1)
64+
if [ -n "$COVERITY_DIR" ]; then
65+
export PATH="$PATH:$COVERITY_DIR/bin"
66+
fi
67+
cov-build --dir ${{github.workspace}}/coverity-files cmake --build ${{github.workspace}}/build --config Release -j$(nproc)
68+
69+
- name: Create tarball to analyze
70+
run: tar czvf ur-coverity-files.tgz coverity-files
71+
72+
- name: Push tarball to scan
5973
run: |
60-
cd $WORKDIR/build
61-
wget https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh
62-
patch < "../.github/scripts/0001-travis-fix-travisci_build_coverity_scan.sh.patch"
63-
bash ./travisci_build_coverity_scan.sh
74+
BRANCH_NAME=$(echo ${GITHUB_REF_NAME})
75+
COMMIT_ID=$(echo $GITHUB_SHA)
76+
curl --form token=${{ secrets.COVERITY_SCAN_TOKEN }} \
77+
--form email=bb-ur@intel.com \
78+
--form file=@ur-coverity-files.tgz \
79+
--form version="$COMMIT_ID" \
80+
--form description="$BRANCH_NAME:$COMMIT_ID" \
81+
https://scan.coverity.com/builds\?project\=oneapi-src%2Funified-runtime

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
[![Build and test](https://github.com/oneapi-src/unified-runtime/actions/workflows/cmake.yml/badge.svg)](https://github.com/oneapi-src/unified-runtime/actions/workflows/cmake.yml)
44
[![Bandit](https://github.com/oneapi-src/unified-runtime/actions/workflows/bandit.yml/badge.svg)](https://github.com/oneapi-src/unified-runtime/actions/workflows/bandit.yml)
55
[![CodeQL](https://github.com/oneapi-src/unified-runtime/actions/workflows/codeql.yml/badge.svg)](https://github.com/oneapi-src/unified-runtime/actions/workflows/codeql.yml)
6-
[![Coverity](https://scan.coverity.com/projects/28213/badge.svg)](https://scan.coverity.com/projects/oneapi-src-unified-runtime)
6+
[![Coverity build](https://github.com/oneapi-src/unified-runtime/actions/workflows/coverity.yml/badge.svg?branch=main)](https://github.com/oneapi-src/unified-runtime/actions/workflows/coverity.yml)
7+
[![Coverity report](https://scan.coverity.com/projects/28213/badge.svg)](https://scan.coverity.com/projects/oneapi-src-unified-runtime)
78
[![Nightly](https://github.com/oneapi-src/unified-runtime/actions/workflows/nightly.yml/badge.svg)](https://github.com/oneapi-src/unified-runtime/actions/workflows/nightly.yml)
89
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/oneapi-src/unified-runtime/badge)](https://securityscorecards.dev/viewer/?uri=github.com/oneapi-src/unified-runtime)
910
[![Trivy](https://github.com/oneapi-src/unified-runtime/actions/workflows/trivy.yml/badge.svg)](https://github.com/oneapi-src/unified-runtime/actions/workflows/trivy.yml)

scripts/benchmarks/benches/base.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from pathlib import Path
99
from .result import Result
1010
from .options import options
11-
from utils.utils import run
11+
from utils.utils import download, run
1212
import urllib.request
1313
import tarfile
1414

@@ -26,7 +26,7 @@ def get_adapter_full_path():
2626
assert False, \
2727
f"could not find adapter file {adapter_path} (and in similar lib paths)"
2828

29-
def run_bench(self, command, env_vars):
29+
def run_bench(self, command, env_vars, ld_library=[]):
3030
env_vars_with_forced_adapter = env_vars.copy()
3131
if options.ur is not None:
3232
env_vars_with_forced_adapter.update(
@@ -36,7 +36,8 @@ def run_bench(self, command, env_vars):
3636
command=command,
3737
env_vars=env_vars_with_forced_adapter,
3838
add_sycl=True,
39-
cwd=options.benchmark_cwd
39+
cwd=options.benchmark_cwd,
40+
ld_library=ld_library
4041
).stdout.decode()
4142

4243
def create_data_path(self, name):
@@ -49,17 +50,9 @@ def create_data_path(self, name):
4950

5051
return data_path
5152

52-
def download_untar(self, name, url, file):
53+
def download(self, name, url, file, untar = False):
5354
self.data_path = self.create_data_path(name)
54-
data_file = os.path.join(self.data_path, file)
55-
if not Path(data_file).exists():
56-
print(f"{data_file} does not exist, downloading")
57-
urllib.request.urlretrieve(url, data_file)
58-
file = tarfile.open(data_file)
59-
file.extractall(self.data_path)
60-
file.close()
61-
else:
62-
print(f"{data_file} exists, skipping...")
55+
return download(self.data_path, url, file, True)
6356

6457
def name(self):
6558
raise NotImplementedError()
@@ -79,6 +72,9 @@ def run(self, env_vars) -> list[Result]:
7972
def teardown(self):
8073
raise NotImplementedError()
8174

75+
def ignore_iterations(self):
76+
return False
77+
8278
class Suite:
8379
def benchmarks(self) -> list[Benchmark]:
8480
raise NotImplementedError()

0 commit comments

Comments
 (0)