Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/docker/ubuntu-20.04.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2024 Intel Corporation
# Copyright (C) 2024-2025 Intel Corporation
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

Expand Down
2 changes: 1 addition & 1 deletion .github/docker/ubuntu-22.04.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2024 Intel Corporation
# Copyright (C) 2024-2025 Intel Corporation
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/check_dll_flags.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2023-2024 Intel Corporation
# Copyright (C) 2023-2025 Intel Corporation
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/get_system_info.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (C) 2024 Intel Corporation
# Copyright (C) 2024-2025 Intel Corporation
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/install_hwloc.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (C) 2024 Intel Corporation
# Copyright (C) 2024-2025 Intel Corporation
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/run-codespell.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2024 Intel Corporation
Copyright (C) 2024-2025 Intel Corporation

Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Expand Down
42 changes: 6 additions & 36 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,14 @@ permissions:
contents: read

jobs:
build:
name: Build docs
runs-on: ${{ github.repository_owner == 'oneapi-src' && 'intel-ubuntu-22.04' || 'ubuntu-latest' }}

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Install doxygen
run: |
sudo apt-get update
sudo apt-get install -y doxygen

# Latest distros do not allow global pip installation
- name: Install Python requirements in venv
run: |
python3 -m venv .venv
. .venv/bin/activate
echo "$PATH" >> $GITHUB_PATH
python3 -m pip install -r third_party/requirements.txt

- name: Setup PATH for python
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Build the documentation
working-directory: scripts
run: python3 generate_docs.py

- name: Upload artifact
uses: actions/upload-pages-artifact@0252fc4ba7626f0298f0cf00902a25c6afc77fa8 # v3.0.0
with:
path: docs/html
DocsBuild:
uses: ./.github/workflows/reusable_docs_build.yml
with:
upload: true

deploy:
DocsDeploy:
name: Deploy docs to GitHub Pages
needs: build
needs: DocsBuild

permissions:
pages: write
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable_basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ jobs:
-B ${{env.BUILD_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
-DUMF_BUILD_SHARED_LIBRARY=ON
-DUMF_BUILD_EXAMPLES=OFF
-DUMF_BUILD_EXAMPLES=ON
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
Expand Down Expand Up @@ -376,7 +376,7 @@ jobs:
-B ${{env.BUILD_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
-DUMF_BUILD_SHARED_LIBRARY=OFF
-DUMF_BUILD_EXAMPLES=OFF
-DUMF_BUILD_EXAMPLES=ON
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/reusable_checks.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Basic checks on the code, incl. coding style, spelling, bandit analysis.
# TODO: add license check
name: Basic checks

on: workflow_call
Expand Down Expand Up @@ -52,6 +51,14 @@ jobs:
- name: Check Python formatting
run: cmake --build build --target black-format-check

- name: Run check-license
run: |
bash ./check_license/check-headers.sh . "Apache-2.0 WITH LLVM-exception" -v

- name: Run copyright-format
run: |
bash ./check_license/check-headers.sh . "Apache-2.0 WITH LLVM-exception" -d

- name: Run a spell check
uses: crate-ci/typos@b63f421581dce830bda2f597a678cb7776b41877 # v1.18.2
with:
Expand Down
24 changes: 21 additions & 3 deletions .github/workflows/reusable_docs_build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Docs build

on: workflow_call
on:
workflow_call:
inputs:
upload:
description: Should HTML documentation be uploaded as artifact?
type: boolean
default: false

permissions:
contents: read
Expand Down Expand Up @@ -30,5 +36,17 @@ jobs:
python3 -m pip install -r third_party/requirements.txt

- name: Build the documentation
working-directory: scripts
run: python3 generate_docs.py
run: |
cmake -B build \
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF \
-DUMF_BUILD_CUDA_PROVIDER=OFF \
-DUMF_BUILD_TESTS=OFF \
-DUMF_BUILD_EXAMPLES=OFF \
-DUMF_DISABLE_HWLOC=ON
cmake --build build --target docs

- name: Upload artifact
if: ${{ inputs.upload == true }}
uses: actions/upload-pages-artifact@0252fc4ba7626f0298f0cf00902a25c6afc77fa8 # v3.0.0
with:
path: build/docs_build/generated/html
142 changes: 142 additions & 0 deletions .github/workflows/sanitizers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Check code with compilers' sanitizers
name: Sanitizers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh, this file shouldn't be here


on: workflow_call

env:
BUILD_DIR : "${{github.workspace}}/build"
INSTL_DIR : "${{github.workspace}}/../install-dir"

permissions:
contents: read

jobs:
ubuntu-build:
name: Ubuntu
strategy:
matrix:
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}, {c: icx, cxx: icpx}]
# TSAN is mutually exclusive with other sanitizers
sanitizers: [{asan: ON, ubsan: ON, tsan: OFF}, {asan: OFF, ubsan: OFF, tsan: ON}]
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install -y clang cmake libhwloc-dev libnuma-dev libjemalloc-dev libtbb-dev
- name: Install oneAPI basekit
if: matrix.compiler.cxx == 'icpx'
run: |
sudo apt-get install -y gpg-agent wget
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
sudo apt-get install -y intel-oneapi-ippcp-devel intel-oneapi-ipp-devel intel-oneapi-common-oneapi-vars intel-oneapi-compiler-dpcpp-cpp
- name: Set ptrace value for IPC test
run: sudo bash -c "echo 0 > /proc/sys/kernel/yama/ptrace_scope"

- name: Configure build
run: >
${{ matrix.compiler.cxx == 'icpx' && '. /opt/intel/oneapi/setvars.sh &&' || ''}}
cmake
-B ${{env.BUILD_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
-DCMAKE_BUILD_TYPE=Debug
-DUMF_BUILD_SHARED_LIBRARY=OFF
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
-DUMF_USE_ASAN=${{matrix.sanitizers.asan}}
-DUMF_USE_UBSAN=${{matrix.sanitizers.ubsan}}
-DUMF_USE_TSAN=${{matrix.sanitizers.tsan}}
-DUMF_BUILD_EXAMPLES=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
- name: Build UMF
run: |
${{ matrix.compiler.cxx == 'icpx' && '. /opt/intel/oneapi/setvars.sh' || true }}
cmake --build ${{env.BUILD_DIR}} -j $(nproc)
- name: Run tests
working-directory: ${{env.BUILD_DIR}}
run: >
${{ matrix.compiler.cxx == 'icpx' && '. /opt/intel/oneapi/setvars.sh &&' || ''}}
ctest --output-on-failure
windows-build:
name: cl and clang-cl on Windows
env:
VCPKG_PATH: "${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows"
strategy:
matrix:
compiler: [{c: cl, cxx: cl}, {c: clang-cl, cxx: clang-cl}]
# Only ASAN is supported
sanitizers: [{asan: ON}]
runs-on: windows-2022

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

# Use the latest MSVC toolset available, when compiling UMF with ASan.
# Running binaries compiled with older toolsets results in a
# 'STATUS_DLL_INIT_FAILED' error despite being linked with ASan from
# the same toolset as the compiler being used.
# https://github.com/actions/runner-images/issues/8891
- name: Setup MSVC dev command prompt
if: matrix.sanitizers.asan == 'ON'
uses: TheMrMilchmann/setup-msvc-dev@48edcef51a12c80d7e62ace57aae1417795e511c # v3.0.0
with:
arch: x64
toolset: '14'

- name: Initialize vcpkg
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
with:
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
vcpkgJsonGlob: '**/vcpkg.json'

- name: Install dependencies
run: vcpkg install
shell: pwsh # Specifies PowerShell as the shell for running the script.

# TODO enable level zero provider
- name: Configure build
run: >
cmake
-B ${{env.BUILD_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
-DUMF_BUILD_SHARED_LIBRARY=OFF
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
-DUMF_USE_ASAN=${{matrix.sanitizers.asan}}
-DUMF_BUILD_EXAMPLES=ON
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
-DUMF_TESTS_FAIL_ON_SKIP=ON
- name: Build UMF
run: cmake --build ${{env.BUILD_DIR}} --config Debug -j $Env:NUMBER_OF_PROCESSORS

- name: Run tests
working-directory: ${{env.BUILD_DIR}}
run: ctest -C Debug --output-on-failure
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ __pycache__/
*.py[cod]

# Generated docs
docs/
docs_build/

# Build files
/build*/
Expand Down
18 changes: 15 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022-2024 Intel Corporation
# Copyright (C) 2022-2025 Intel Corporation
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

Expand Down Expand Up @@ -184,6 +184,7 @@ else()

add_custom_target(jemalloc_prod
DEPENDS ${jemalloc_targ_BINARY_DIR}/lib/libjemalloc.a)

add_library(jemalloc INTERFACE)
target_link_libraries(
jemalloc INTERFACE ${jemalloc_targ_BINARY_DIR}/lib/libjemalloc.a)
Expand Down Expand Up @@ -251,8 +252,8 @@ else()

set(LIBHWLOC_INCLUDE_DIRS
${hwloc_targ_SOURCE_DIR}/include;${hwloc_targ_BINARY_DIR}/include)
set(LIBHWLOC_LIBRARY_DIRS
${hwloc_targ_BINARY_DIR}/Release;${hwloc_targ_BINARY_DIR}/Debug)
set(LIBHWLOC_LIBRARY_DIRS ${hwloc_targ_BINARY_DIR}/$<CONFIG>)
set(LIBHWLOC_LIBRARIES ${hwloc_targ_BINARY_DIR}/$<CONFIG>/hwloc.lib)
else()
include(FetchContent)
message(
Expand Down Expand Up @@ -760,6 +761,17 @@ if(UMF_FORMAT_CODE_STYLE)
endif()
endif()

find_package(Python3 3.8)
if(Python3_FOUND)
message(STATUS "Adding 'docs' target for creating a documentation.")
add_custom_target(
docs
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${Python3_EXECUTABLE}
${UMF_CMAKE_SOURCE_DIR}/docs/generate_docs.py
COMMENT "Generate HTML documentation using Doxygen")
endif()

# --------------------------------------------------------------------------- #
# Configure make install/uninstall and packages
# --------------------------------------------------------------------------- #
Expand Down
Loading
Loading