Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
85c61b4
Move openmp patches to versioned directories
ggeorgakoudis Jan 25, 2026
fa94c9a
Ignore .cache clangd directories
ggeorgakoudis Jan 25, 2026
23db0c2
Make device 0 default for the examples hello-target.py
ggeorgakoudis Jan 25, 2026
2334bc2
Use LLVM_version env in setup.py to install openmp
ggeorgakoudis Jan 25, 2026
b4ebb05
Use LLVM_VERSION env var in setup-miniconda3.sh
ggeorgakoudis Jan 25, 2026
86aa199
Update init to import decorators and remove LLVM version check
ggeorgakoudis Jan 25, 2026
961221b
Replace cffi with ctypes to call LLVM openmp runtime symbols
ggeorgakoudis Jan 25, 2026
19246f2
Replace deprecated compile_isolated interface with njit
ggeorgakoudis Jan 25, 2026
43cddac
Add pointee type information in tags
ggeorgakoudis Jan 25, 2026
e08ff1a
Require LLVM_DIR env var and ensure LLVM is found only in it
ggeorgakoudis Jan 25, 2026
ee12197
Make OpenMPCUDACodegen a singleton
ggeorgakoudis Jan 25, 2026
3a56891
Update LLVM API and use pointee types from numba in the plugin pass
ggeorgakoudis Jan 25, 2026
4511a3f
Add patch for linking LLVM statically in openmp 16.0.6
ggeorgakoudis Jan 25, 2026
51285f3
Update tests
ggeorgakoudis Jan 25, 2026
6baa1ee
Add compatibility matrix in README
ggeorgakoudis Jan 25, 2026
d3fed9d
Fix typo setup.py
ggeorgakoudis Jan 25, 2026
214cee3
Fix comment in CGIntrinsicsOpenMP.cpp
ggeorgakoudis Jan 25, 2026
5d8cf84
Rename hasher in setup.py to avoid conflict with parameter
ggeorgakoudis Jan 25, 2026
b39740c
Remove unused output
ggeorgakoudis Jan 25, 2026
0497ef2
Move pointee type information at the right branch of arg_to_str
ggeorgakoudis Jan 26, 2026
64db1a5
Add compatibility matrix to README
ggeorgakoudis Jan 26, 2026
49b59bb
Use LLVM_VERSION env var in project.toml and setup-miniconda3.sh
ggeorgakoudis Jan 26, 2026
92f8959
Build wheels for numba 0.61 and harden github action
ggeorgakoudis Jan 26, 2026
32f4c9c
Add print message in pass CMakeLists
ggeorgakoudis Jan 26, 2026
91e93e8
Fix includes and order
ggeorgakoudis Jan 26, 2026
35b9d8f
Use one conda env and export absolute paths
ggeorgakoudis Jan 26, 2026
6786284
Use clang-tools and clang instead of clangdev in setup-miniconda3.sh
ggeorgakoudis Jan 26, 2026
d42b6d7
Update conda build files for numba 0.61 and use LLVM_VERSION
ggeorgakoudis Jan 26, 2026
4119d71
Make more robust the check for NVIDIA GPUs in conda build test
ggeorgakoudis Jan 26, 2026
472cde5
Work around assert in tests with python 3.10 and numba lowering
ggeorgakoudis Jan 26, 2026
c4b5bcf
Update file tests for LLVM 15 in conda meta.yaml
ggeorgakoudis Jan 26, 2026
f7e0c63
Update gitlab CI
ggeorgakoudis Jan 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-upload-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
matrix:
# TODO: Add windows.
os: [ubuntu-latest, macos-latest, ubuntu-24.04-arm]
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Determine conda label
run: |
Expand All @@ -45,7 +45,7 @@ jobs:
- name: Create and activate conda env
uses: conda-incubator/setup-miniconda@v3
with:
python-version: "3.10"
python-version: "3.12"
auto-update-conda: false
show-channel-urls: true

Expand Down
50 changes: 23 additions & 27 deletions .github/workflows/build-upload-wheels.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: pypi

permissions:
contents: read

on:
release:
types: [published]
Expand All @@ -22,37 +25,43 @@ jobs:
# TODO: Add windows.
os: [ubuntu-latest, macos-latest, ubuntu-24.04-arm]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
# Checkout the repo with history to get the commit hash for the build
# string.
with:
fetch-depth: 0

# Used to host cibuildwheel.
- uses: actions/setup-python@v5
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==3.1.4

- name: Build wheels
- name: Build wheels {{ matrix.os }}
# Set LLVM_VERSION for the host to forward to the cibuildwheel
# environment.
env:
LLVM_VERSION: "15.0.7"
run: python -m cibuildwheel --output-dir wheelhouse

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build-sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
fetch-depth: 0

- name: Build sdist
env:
LLVM_VERSION: "15.0.7"
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: cibw-sdist
path: dist/*.tar.gz
Expand All @@ -64,31 +73,18 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, ubuntu-24.04-arm]
python-version: ['3.9', '3.10', '3.11', '3.12']
numba-version: ['0.57.0', '0.57.1', '0.58.0', '0.58.1', '0.59.0', '0.59.1', '0.60.0']
exclude:
# Known incompatibilities based on numba's official support
# Numba 0.57 supports Python 3.8-3.11
- python-version: '3.12'
numba-version: '0.57.0'
- python-version: '3.12'
numba-version: '0.57.1'

# Numba 0.58 supports Python 3.8-3.11
- python-version: '3.12'
numba-version: '0.58.0'
- python-version: '3.12'
numba-version: '0.58.1'
python-version: ['3.10', '3.11', '3.12', '3.13']
numba-version: ['0.61.0', '0.61.2']
steps:
- name: Download built wheels
uses: actions/download-artifact@v5
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
pattern: cibw-*
path: dist
merge-multiple: true

- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -117,14 +113,14 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v5
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
pattern: cibw-*
path: dist
merge-multiple: true

- name: Publish testpypi
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
with:
repository-url: https://test.pypi.org/legacy/
verbose: true
Expand All @@ -138,13 +134,13 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v5
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
pattern: cibw-*
path: dist
merge-multiple: true

- name: Publish pypi
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
with:
verbose: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
docs/build*
*.egg-info
.vscode
.cache
__pycache__
*.a
*.so
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/jobs/tioga.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ variables:
parallel:
matrix:
- PYOMP_CI_PYTHON_VERSION:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"

build-and-test-tioga:
extends: [.base-job, .python-variants]
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ compiler based on LLVM, which is competitive with equivalent C/C++ implementatio

PyOMP is developed and distributed as an *extension* to Numba, so it uses
Numba as a dependency.
It is currently tested with Numba versions 0.57.x, 0.58.x, 0.59.x, 0.60.x on the
following architecture and operating system combinations: linux-64 (x86_64),
osx-arm64 (mac), linux-arm64, and linux-ppc64le.
It is currently tested with several Numba versions on the following
architecture and operating system combinations: linux-64 (x86_64), osx-arm64
(mac), and linux-arm64.
The [compatibility matrix](#compatibility-matrix) with Numba versions records
the possible combinations.

Installation is possible through `pip` or `conda`, detailed in the next section.

As PyOMP builds on top of the LLVM OpenMP infrastructure, it also inherits its
limitations: GPU support is only available on Linux.
Also, PyOMP currently supports only NVIDIA GPUs with AMD GPU support planned for.
Also, PyOMP currently supports only NVIDIA GPUs with AMD GPU support in development.

## Installation

Expand All @@ -38,6 +41,13 @@ PyOMP is also distributed through Conda, installable using the following command
conda install -c python-for-hpc -c conda-forge pyomp
```

### Compatibility matrix

| PyOMP | Numba |
| ----- | --------------- |
| 0.4.x | 0.61.x |
| 0.3.x | 0.57.x - 0.60.x |

Besides a standard installation, we also provide the following options to
quickly try out PyOMP online or through a container.

Expand Down
16 changes: 9 additions & 7 deletions buildscripts/cibuildwheel/setup-miniconda3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

set -euxo pipefail

# Read LLVM_VERSION from environment and error if not set
if [ -z "${LLVM_VERSION:-}" ]; then
echo "Error: LLVM_VERSION environment variable is not set." >&2
exit 1
fi

if [ "$(uname)" = "Darwin" ]; then
OS_NAME="MacOSX"
else
Expand All @@ -17,10 +23,6 @@ echo "Miniconda installed"
source "_stage/miniconda3/bin/activate" base
export CONDA_PLUGINS_AUTO_ACCEPT_TOS=true

# Create llvmdev environment and install llvmdev 14.0.6.
echo "Installing manylinux llvmdev 14.0.6..."
conda create -n llvmdev -c conda-forge -y llvmdev=14.0.6

# Create clang14 environment and install clang 14.0.6.
echo "Installing clang 14.0.6..."
conda create -n clang14 -c conda-forge -y clang=14.0.6
# Create clangdev ${LLVM_VERSION}
echo "Installing manylinux llvmdev ${LLVM_VERSION}..."
conda create -n llvmdev-${LLVM_VERSION} -c conda-forge -q -y clang=${LLVM_VERSION} clang-tools=${LLVM_VERSION} llvmdev=${LLVM_VERSION}
62 changes: 33 additions & 29 deletions buildscripts/conda-recipes/pyomp/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0').lstrip('v') %}
{% set LLVM_VERSION = environ.get('LLVM_VERSION', '15.0.7') %}

package:
name: pyomp
Expand All @@ -12,6 +13,8 @@ build:
script_env:
- PY_VCRUNTIME_REDIST # [win]
script:
- export LLVM_VERSION={{ LLVM_VERSION }}
- export LLVM_DIR=${PREFIX}
- export VERBOSE=1
- export CPPFLAGS="-mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET} -isystem ${PREFIX}/include -D_FORTIFY_SOURCE=2" # [osx]
- rm -rf build dist src/*.egg-info
Expand All @@ -30,48 +33,49 @@ requirements:
- pip
- setuptools
- setuptools_scm
- numba >=0.57, <0.61
- clang 14.*
- llvmdev 14.*
- numba >=0.61, <0.62
- clang {{ LLVM_VERSION }}
- clang-tools {{ LLVM_VERSION }}
- llvmdev {{ LLVM_VERSION }}
- zlib
- elfutils # [linux]
- libffi # [linux]
run:
- python
- setuptools
- numba >=0.57, <0.61
- numba >=0.61, <0.62
- lark
- cffi

test:
commands:
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomp.dylib # [osx]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomp.so # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx1010.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx1030.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx1031.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx700.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx701.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx801.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx803.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx900.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx902.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx906.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx908.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx90a.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_35.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_37.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_50.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_52.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_53.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_60.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_61.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_62.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_70.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_72.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_75.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_80.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_86.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx1010.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx1030.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx1031.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx700.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx701.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx801.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx803.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx900.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx902.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx906.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx908.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx90a.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_35.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_37.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_50.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_52.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_53.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_60.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_61.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_62.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_70.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_72.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_75.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_80.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_86.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget.rtl.amdgpu.so # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget.rtl.cuda.so # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget.rtl.ppc64.so # [linux and ppc64le]
Expand Down
13 changes: 9 additions & 4 deletions buildscripts/conda-recipes/pyomp/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ TEST_DEVICES=0 RUN_TARGET=0 $SEGVCATCH python -m numba.runtests -v -- numba.open
echo "=> Run OpenMP offloading tests on CPU (device 1)"
echo "=> Running: TEST_DEVICES=1 RUN_TARGET=1 $SEGVCATCH python -m numba.runtests -v -- numba.openmp.tests.test_openmp.TestOpenmpTarget"
OMP_TARGET_OFFLOAD=mandatory TEST_DEVICES=1 RUN_TARGET=1 $SEGVCATCH python -m numba.runtests -v -- numba.openmp.tests.test_openmp.TestOpenmpTarget 2>&1
if nvidia-smi --list-gpus; then
echo "=> Found NVIDIA GPU, Run OpenMP offloading tests on GPU (device 0)"
echo "=> Running: TEST_DEVICES=0 RUN_TARGET=1 $SEGVCATCH python -m numba.runtests -v -- numba.openmp.tests.test_openmp.TestOpenmpTarget"
OMP_TARGET_OFFLOAD=mandatory TEST_DEVICES=0 RUN_TARGET=1 $SEGVCATCH python -m numba.runtests -v -- numba.openmp.tests.test_openmp.TestOpenmpTarget 2>&1
# Check if NVIDIA GPU is present.
if command -v nvidia-smi >/dev/null 2>&1; then
# `nvidia-smi --list-gpus` exits non-zero when no GPUs are present; run
# it in a conditional so `set -e` does not cause the script to exit.
if nvidia-smi --list-gpus >/dev/null 2>&1; then
echo "=> Found NVIDIA GPU, Run OpenMP offloading tests on GPU (device 0)"
echo "=> Running: TEST_DEVICES=0 RUN_TARGET=1 $SEGVCATCH python -m numba.runtests -v -- numba.openmp.tests.test_openmp.TestOpenmpTarget"
OMP_TARGET_OFFLOAD=mandatory TEST_DEVICES=0 RUN_TARGET=1 $SEGVCATCH python -m numba.runtests -v -- numba.openmp.tests.test_openmp.TestOpenmpTarget 2>&1
fi
fi
9 changes: 6 additions & 3 deletions buildscripts/gitlab/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ TMPDIR=/tmp/pyomp/${CI_JOB_ID}
mkdir -p ${TMPDIR}
pushd ${TMPDIR}

# Set the LLVM_VERSION to use.
export LLVM_VERSION="15.0.7"

# Set the envs directory under the temporary directory.
export CONDA_ENVS_DIRS="${TMPDIR}/_stage/miniconda3/envs"

# Install miniconda and llvmdev, clang14 environments.
# Install miniconda and llvmdev environment.
source ${CI_PROJECT_DIR}/buildscripts/cibuildwheel/setup-miniconda3.sh

# Export environment variables for building and testing.
export LLVM_DIR="${CONDA_ENVS_DIRS}/llvmdev"
export CLANG_TOOL="${CONDA_ENVS_DIRS}/clang14/bin/clang"
export LLVM_DIR="${CONDA_ENVS_DIRS}/llvmdev-${LLVM_VERSION}"
export PATH="${CONDA_ENVS_DIRS}/llvmdev-${LLVM_VERSION}/bin:${PATH}"
export USE_CXX11_ABI="1"
export PIP_NO_INPUT="1"

Expand Down
6 changes: 4 additions & 2 deletions examples/hello-target.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
from numba.openmp import openmp_context as openmp
from numba.openmp import omp_get_num_threads, omp_get_thread_num


@njit
def hello():
with openmp("target device(1)"):
print("hello thread", omp_get_thread_num(),"of", omp_get_num_threads())
with openmp("target device(0)"):
print("hello thread", omp_get_thread_num(), "of", omp_get_num_threads())


hello()
Loading
Loading