Skip to content

Commit

Permalink
Merge branch 'oneapi-src:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
omalyshe authored Nov 18, 2024
2 parents 905cdb9 + d1d43ad commit f6955a1
Show file tree
Hide file tree
Showing 148 changed files with 5,976 additions and 1,089 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.1.1
7.2.1
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
28 changes: 14 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
runs-on: [ubuntu-20.04]
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run scan
run: |
sudo apt update && sudo apt install -y codespell
Expand All @@ -47,7 +47,7 @@ jobs:
runs-on: [ubuntu-20.04]
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run scan
run: |
command -v clang-format-10
Expand All @@ -62,7 +62,7 @@ jobs:
runs-on: [ubuntu-22.04]
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install prerequisites
run: |
pip3 install -U Jinja2
Expand All @@ -75,7 +75,7 @@ jobs:
export BUILD_TYPE=${BUILD_TYPE} && sphinx-build doc html
tar -czvf html.tar.gz html/
- name: Save docs
uses: actions/upload-artifact@v2.2.1
uses: actions/upload-artifact@v4
with:
name: oneTBB-html-docs-${{ env.GITHUB_SHA_SHORT }}
path: html.tar.gz
Expand All @@ -90,14 +90,14 @@ jobs:
needs: [documentation]
steps:
- name: Checkout gh-pages
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
- name: Set env
run: echo GITHUB_SHA_SHORT=${GITHUB_SHA::8} >> $GITHUB_ENV
- name: Download documetation
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: oneTBB-html-docs-${{ env.GITHUB_SHA_SHORT }}
- name: Publish to github pages
Expand All @@ -117,7 +117,7 @@ jobs:
if: ${{ github.ref != 'refs/heads/master' }}
runs-on: [ubuntu-20.04]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run check
Expand All @@ -137,7 +137,7 @@ jobs:
runs-on: [ubuntu-latest]
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run testing
run: |
mkdir build && cd build
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:
preview: 'ON'
cmake_static: -DBUILD_SHARED_LIBS=OFF
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run testing
shell: bash
run: |
Expand Down Expand Up @@ -212,7 +212,7 @@ jobs:
preview: 'ON'
cmake_static: -DBUILD_SHARED_LIBS=OFF
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run testing
shell: bash
run: |
Expand Down Expand Up @@ -257,7 +257,7 @@ jobs:
preview: 'OFF'
job_name: windows_cl2022_cxx17_relwithdebinfo_preview=OFF
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run testing
run: |
mkdir build
Expand Down Expand Up @@ -295,7 +295,7 @@ jobs:
build_type: debug
preview: 'ON'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run testing
shell: bash
run: |
Expand All @@ -321,7 +321,7 @@ jobs:
build_type: relwithdebinfo
preview: 'ON'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run testing
shell: bash
run: |
Expand Down Expand Up @@ -357,7 +357,7 @@ jobs:
preview: 'OFF'
job_name: examples_windows_cl2022_cxx17_relwithdebinfo_preview=OFF
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run testing
run: |
mkdir build
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Copyright (c) 2024 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: '0 0 * * 1'

permissions:
contents: read

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
# timeout-minutes:
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
language: ["cpp", "python"]

steps:
- name: Harden Runner
uses: step-security/harden-runner@v2.10.1
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3.24.10

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# Command-line programs to run using the OS shell.
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
#- if: matrix.build-mode == 'manual'
# shell: bash
# run: |
# echo 'If you are using a "manual" build mode for one or more of the' \
# 'languages you are analyzing, replace this with the commands to build' \
# 'your code, for example:'
# echo ' make bootstrap'
# echo ' make release'
# exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
3 changes: 1 addition & 2 deletions .github/workflows/issue_labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ jobs:
issues: write
contents: read
steps:
- uses: github/issue-labeler@v3.2 #May not be the latest version
- uses: github/issue-labeler@v3.4 #May not be the latest version
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/issue_labeler.yml
enable-versioned-regex: 0
sync-labels: 1
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@v5

83 changes: 83 additions & 0 deletions .github/workflows/ossf-scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Copyright (c) 2024 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: OSSF Scorecard
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '00 02 * * *'
push:
branches: [ "master" ]

# Declare default permissions as read only.
permissions: read-all

jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
# Uncomment the permissions below if installing in a private repository.
# contents: read
# actions: read

steps:
- name: "Checkout code"
uses: actions/checkout@v4.1.1
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@v2.4.0
with:
results_file: results.sarif
results_format: sarif
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecard on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}

# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
#- name: "Upload artifact"
# uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20
# with:
# name: SARIF file
# path: results.sarif
# retention-days: 5

# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
#- name: "Upload to code-scanning"
# uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
# with:
# sarif_file: results.sarif
41 changes: 41 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,47 @@ cc_library(
],
)

cc_test(
name = "test_mutex",
srcs = [
"test/tbb/test_mutex.cpp",
"test/tbb/test_mutex.h"
] + glob([
"test/common/*.h",
]),
includes = ["test"],
deps = [
":tbb",
],
)

cc_test(
name = "test_parallel_for",
srcs = [
"test/tbb/test_parallel_for.cpp",
"test/tbb/test_partitioner.h"
] + glob([
"test/common/*.h",
]),
includes = ["test"],
deps = [
":tbb",
],
)

cc_test(
name = "test_parallel_reduce",
srcs = [
"test/tbb/test_parallel_reduce.cpp",
] + glob([
"test/common/*.h",
]),
includes = ["test"],
deps = [
":tbb",
],
)

cc_test(
name = "test_task",
srcs = [
Expand Down
12 changes: 12 additions & 0 deletions Bazel.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ The standard Bazel approach to handling third-party libraries is static linking.

## Using oneTBB as a dependency

### Traditional WORKSPACE approach

This example demonstrates how to use oneTBB as a dependency within a Bazel project.

The following file structure is assumed:
Expand Down Expand Up @@ -78,6 +80,16 @@ The expected output of this program is the current version of oneTBB.

Switch to the folder with the files created earlier and run the binary with `bazel run //:Demo`.

### Bzlmod

If you use Bzlmod, you can fetch oneTBB with the [Bazel Central Registry](https://registry.bazel.build/).

Add the following line to your `MODULE.bazel` file:

```bazel
bazel_dep(name = "onetbb", version = "2021.13.0")
```

## Build oneTBB using Bazel

Run ```bazel build //...``` in the oneTBB root directory.
Expand Down
Loading

0 comments on commit f6955a1

Please sign in to comment.