Skip to content

Commit 62596b3

Browse files
ggeorgakoudisCopilotDrTodd13
authored
Support numba 0.61 (#37)
* Move openmp patches to versioned directories - Add patches for 15.0.7, 16.0.6 * Ignore .cache clangd directories * Make device 0 default for the examples hello-target.py * Use LLVM_version env in setup.py to install openmp * Use LLVM_VERSION env var in setup-miniconda3.sh * Update init to import decorators and remove LLVM version check * Replace cffi with ctypes to call LLVM openmp runtime symbols - Avoid ffi dlopen namespace issues with initialization * Replace deprecated compile_isolated interface with njit * Add pointee type information in tags - Recent versions of LLVM use opaque pointers. The numba frontend must communicate the pointee types to the LLVM plugin pass for lowering * Require LLVM_DIR env var and ensure LLVM is found only in it - Avoids using other installation directories of LLVM in the path * Make OpenMPCUDACodegen a singleton - Ensure CUDA context is initalized once * Update LLVM API and use pointee types from numba in the plugin pass * Add patch for linking LLVM statically in openmp 16.0.6 * Update tests - Fix single tests to nest in parallel (as it must) - Skip target data tests that are problematic if no target region executes - Clean up * Add compatibility matrix in README * Fix typo setup.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix comment in CGIntrinsicsOpenMP.cpp Co-authored-by: Todd A. Anderson <drtodd13@comcast.net> * Rename hasher in setup.py to avoid conflict with parameter * Remove unused output * Move pointee type information at the right branch of arg_to_str - Append when x is a str - Cleanup dead code in arg_to_str * Add compatibility matrix to README * Use LLVM_VERSION env var in project.toml and setup-miniconda3.sh * Build wheels for numba 0.61 and harden github action - Use LLVM 15 for building to be compatible with numba 0.61 - Pin all actions to the commit ref - Add least permissions at the workflow level * Add print message in pass CMakeLists * Fix includes and order * Use one conda env and export absolute paths * Use clang-tools and clang instead of clangdev in setup-miniconda3.sh * Update conda build files for numba 0.61 and use LLVM_VERSION * Make more robust the check for NVIDIA GPUs in conda build test - Use command to check if nvidia-smi exists * Work around assert in tests with python 3.10 and numba lowering * Update file tests for LLVM 15 in conda meta.yaml * Update gitlab CI --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Todd A. Anderson <drtodd13@comcast.net>
1 parent e419dc8 commit 62596b3

33 files changed

+1350
-778
lines changed

.github/workflows/build-upload-conda.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
matrix:
2525
# TODO: Add windows.
2626
os: [ubuntu-latest, macos-latest, ubuntu-24.04-arm]
27-
python-version: ["3.9", "3.10", "3.11", "3.12"]
27+
python-version: ["3.10", "3.11", "3.12", "3.13"]
2828
steps:
2929
- name: Determine conda label
3030
run: |
@@ -45,7 +45,7 @@ jobs:
4545
- name: Create and activate conda env
4646
uses: conda-incubator/setup-miniconda@v3
4747
with:
48-
python-version: "3.10"
48+
python-version: "3.12"
4949
auto-update-conda: false
5050
show-channel-urls: true
5151

.github/workflows/build-upload-wheels.yml

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: pypi
22

3+
permissions:
4+
contents: read
5+
36
on:
47
release:
58
types: [published]
@@ -22,37 +25,43 @@ jobs:
2225
# TODO: Add windows.
2326
os: [ubuntu-latest, macos-latest, ubuntu-24.04-arm]
2427
steps:
25-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
2629
# Checkout the repo with history to get the commit hash for the build
2730
# string.
2831
with:
2932
fetch-depth: 0
3033

3134
# Used to host cibuildwheel.
32-
- uses: actions/setup-python@v5
35+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
3336

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

37-
- name: Build wheels
40+
- name: Build wheels {{ matrix.os }}
41+
# Set LLVM_VERSION for the host to forward to the cibuildwheel
42+
# environment.
43+
env:
44+
LLVM_VERSION: "15.0.7"
3845
run: python -m cibuildwheel --output-dir wheelhouse
3946

40-
- uses: actions/upload-artifact@v4
47+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
4148
with:
4249
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
4350
path: ./wheelhouse/*.whl
4451

4552
build-sdist:
4653
runs-on: ubuntu-latest
4754
steps:
48-
- uses: actions/checkout@v4
55+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
4956
with:
5057
fetch-depth: 0
5158

5259
- name: Build sdist
60+
env:
61+
LLVM_VERSION: "15.0.7"
5362
run: pipx run build --sdist
5463

55-
- uses: actions/upload-artifact@v4
64+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
5665
with:
5766
name: cibw-sdist
5867
path: dist/*.tar.gz
@@ -64,31 +73,18 @@ jobs:
6473
strategy:
6574
matrix:
6675
os: [ubuntu-latest, macos-latest, ubuntu-24.04-arm]
67-
python-version: ['3.9', '3.10', '3.11', '3.12']
68-
numba-version: ['0.57.0', '0.57.1', '0.58.0', '0.58.1', '0.59.0', '0.59.1', '0.60.0']
69-
exclude:
70-
# Known incompatibilities based on numba's official support
71-
# Numba 0.57 supports Python 3.8-3.11
72-
- python-version: '3.12'
73-
numba-version: '0.57.0'
74-
- python-version: '3.12'
75-
numba-version: '0.57.1'
76-
77-
# Numba 0.58 supports Python 3.8-3.11
78-
- python-version: '3.12'
79-
numba-version: '0.58.0'
80-
- python-version: '3.12'
81-
numba-version: '0.58.1'
76+
python-version: ['3.10', '3.11', '3.12', '3.13']
77+
numba-version: ['0.61.0', '0.61.2']
8278
steps:
8379
- name: Download built wheels
84-
uses: actions/download-artifact@v5
80+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
8581
with:
8682
pattern: cibw-*
8783
path: dist
8884
merge-multiple: true
8985

9086
- name: Setup Python
91-
uses: actions/setup-python@v5
87+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
9288
with:
9389
python-version: ${{ matrix.python-version }}
9490

@@ -117,14 +113,14 @@ jobs:
117113
permissions:
118114
id-token: write
119115
steps:
120-
- uses: actions/download-artifact@v5
116+
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
121117
with:
122118
pattern: cibw-*
123119
path: dist
124120
merge-multiple: true
125121

126122
- name: Publish testpypi
127-
uses: pypa/gh-action-pypi-publish@release/v1
123+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
128124
with:
129125
repository-url: https://test.pypi.org/legacy/
130126
verbose: true
@@ -138,13 +134,13 @@ jobs:
138134
permissions:
139135
id-token: write
140136
steps:
141-
- uses: actions/download-artifact@v5
137+
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
142138
with:
143139
pattern: cibw-*
144140
path: dist
145141
merge-multiple: true
146142

147143
- name: Publish pypi
148-
uses: pypa/gh-action-pypi-publish@release/v1
144+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
149145
with:
150146
verbose: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
docs/build*
44
*.egg-info
55
.vscode
6+
.cache
67
__pycache__
78
*.a
89
*.so

.gitlab/jobs/tioga.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ variables:
5252
parallel:
5353
matrix:
5454
- PYOMP_CI_PYTHON_VERSION:
55-
- "3.9"
5655
- "3.10"
5756
- "3.11"
5857
- "3.12"
58+
- "3.13"
5959

6060
build-and-test-tioga:
6161
extends: [.base-job, .python-variants]

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@ compiler based on LLVM, which is competitive with equivalent C/C++ implementatio
1313

1414
PyOMP is developed and distributed as an *extension* to Numba, so it uses
1515
Numba as a dependency.
16-
It is currently tested with Numba versions 0.57.x, 0.58.x, 0.59.x, 0.60.x on the
17-
following architecture and operating system combinations: linux-64 (x86_64),
18-
osx-arm64 (mac), linux-arm64, and linux-ppc64le.
16+
It is currently tested with several Numba versions on the following
17+
architecture and operating system combinations: linux-64 (x86_64), osx-arm64
18+
(mac), and linux-arm64.
19+
The [compatibility matrix](#compatibility-matrix) with Numba versions records
20+
the possible combinations.
21+
1922
Installation is possible through `pip` or `conda`, detailed in the next section.
2023

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

2528
## Installation
2629

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

44+
### Compatibility matrix
45+
46+
| PyOMP | Numba |
47+
| ----- | --------------- |
48+
| 0.4.x | 0.61.x |
49+
| 0.3.x | 0.57.x - 0.60.x |
50+
4151
Besides a standard installation, we also provide the following options to
4252
quickly try out PyOMP online or through a container.
4353

buildscripts/cibuildwheel/setup-miniconda3.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
set -euxo pipefail
44

5+
# Read LLVM_VERSION from environment and error if not set
6+
if [ -z "${LLVM_VERSION:-}" ]; then
7+
echo "Error: LLVM_VERSION environment variable is not set." >&2
8+
exit 1
9+
fi
10+
511
if [ "$(uname)" = "Darwin" ]; then
612
OS_NAME="MacOSX"
713
else
@@ -17,10 +23,6 @@ echo "Miniconda installed"
1723
source "_stage/miniconda3/bin/activate" base
1824
export CONDA_PLUGINS_AUTO_ACCEPT_TOS=true
1925

20-
# Create llvmdev environment and install llvmdev 14.0.6.
21-
echo "Installing manylinux llvmdev 14.0.6..."
22-
conda create -n llvmdev -c conda-forge -y llvmdev=14.0.6
23-
24-
# Create clang14 environment and install clang 14.0.6.
25-
echo "Installing clang 14.0.6..."
26-
conda create -n clang14 -c conda-forge -y clang=14.0.6
26+
# Create clangdev ${LLVM_VERSION}
27+
echo "Installing manylinux llvmdev ${LLVM_VERSION}..."
28+
conda create -n llvmdev-${LLVM_VERSION} -c conda-forge -q -y clang=${LLVM_VERSION} clang-tools=${LLVM_VERSION} llvmdev=${LLVM_VERSION}

buildscripts/conda-recipes/pyomp/meta.yaml

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0').lstrip('v') %}
2+
{% set LLVM_VERSION = environ.get('LLVM_VERSION', '15.0.7') %}
23

34
package:
45
name: pyomp
@@ -12,6 +13,8 @@ build:
1213
script_env:
1314
- PY_VCRUNTIME_REDIST # [win]
1415
script:
16+
- export LLVM_VERSION={{ LLVM_VERSION }}
17+
- export LLVM_DIR=${PREFIX}
1518
- export VERBOSE=1
1619
- export CPPFLAGS="-mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET} -isystem ${PREFIX}/include -D_FORTIFY_SOURCE=2" # [osx]
1720
- rm -rf build dist src/*.egg-info
@@ -30,48 +33,49 @@ requirements:
3033
- pip
3134
- setuptools
3235
- setuptools_scm
33-
- numba >=0.57, <0.61
34-
- clang 14.*
35-
- llvmdev 14.*
36+
- numba >=0.61, <0.62
37+
- clang {{ LLVM_VERSION }}
38+
- clang-tools {{ LLVM_VERSION }}
39+
- llvmdev {{ LLVM_VERSION }}
3640
- zlib
3741
- elfutils # [linux]
3842
- libffi # [linux]
3943
run:
4044
- python
4145
- setuptools
42-
- numba >=0.57, <0.61
46+
- numba >=0.61, <0.62
4347
- lark
4448
- cffi
4549

4650
test:
4751
commands:
4852
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomp.dylib # [osx]
4953
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomp.so # [linux]
50-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx1010.bc # [linux]
51-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx1030.bc # [linux]
52-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx1031.bc # [linux]
53-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx700.bc # [linux]
54-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx701.bc # [linux]
55-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx801.bc # [linux]
56-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx803.bc # [linux]
57-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx900.bc # [linux]
58-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx902.bc # [linux]
59-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx906.bc # [linux]
60-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx908.bc # [linux]
61-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-amdgpu-gfx90a.bc # [linux]
62-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_35.bc # [linux]
63-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_37.bc # [linux]
64-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_50.bc # [linux]
65-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_52.bc # [linux]
66-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_53.bc # [linux]
67-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_60.bc # [linux]
68-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_61.bc # [linux]
69-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_62.bc # [linux]
70-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_70.bc # [linux]
71-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_72.bc # [linux]
72-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_75.bc # [linux]
73-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_80.bc # [linux]
74-
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-new-nvptx-sm_86.bc # [linux]
54+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx1010.bc # [linux]
55+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx1030.bc # [linux]
56+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx1031.bc # [linux]
57+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx700.bc # [linux]
58+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx701.bc # [linux]
59+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx801.bc # [linux]
60+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx803.bc # [linux]
61+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx900.bc # [linux]
62+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx902.bc # [linux]
63+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx906.bc # [linux]
64+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx908.bc # [linux]
65+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx90a.bc # [linux]
66+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_35.bc # [linux]
67+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_37.bc # [linux]
68+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_50.bc # [linux]
69+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_52.bc # [linux]
70+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_53.bc # [linux]
71+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_60.bc # [linux]
72+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_61.bc # [linux]
73+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_62.bc # [linux]
74+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_70.bc # [linux]
75+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_72.bc # [linux]
76+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_75.bc # [linux]
77+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_80.bc # [linux]
78+
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_86.bc # [linux]
7579
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget.rtl.amdgpu.so # [linux]
7680
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget.rtl.cuda.so # [linux]
7781
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget.rtl.ppc64.so # [linux and ppc64le]

buildscripts/conda-recipes/pyomp/run_test.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,13 @@ TEST_DEVICES=0 RUN_TARGET=0 $SEGVCATCH python -m numba.runtests -v -- numba.open
5454
echo "=> Run OpenMP offloading tests on CPU (device 1)"
5555
echo "=> Running: TEST_DEVICES=1 RUN_TARGET=1 $SEGVCATCH python -m numba.runtests -v -- numba.openmp.tests.test_openmp.TestOpenmpTarget"
5656
OMP_TARGET_OFFLOAD=mandatory TEST_DEVICES=1 RUN_TARGET=1 $SEGVCATCH python -m numba.runtests -v -- numba.openmp.tests.test_openmp.TestOpenmpTarget 2>&1
57-
if nvidia-smi --list-gpus; then
58-
echo "=> Found NVIDIA GPU, Run OpenMP offloading tests on GPU (device 0)"
59-
echo "=> Running: TEST_DEVICES=0 RUN_TARGET=1 $SEGVCATCH python -m numba.runtests -v -- numba.openmp.tests.test_openmp.TestOpenmpTarget"
60-
OMP_TARGET_OFFLOAD=mandatory TEST_DEVICES=0 RUN_TARGET=1 $SEGVCATCH python -m numba.runtests -v -- numba.openmp.tests.test_openmp.TestOpenmpTarget 2>&1
57+
# Check if NVIDIA GPU is present.
58+
if command -v nvidia-smi >/dev/null 2>&1; then
59+
# `nvidia-smi --list-gpus` exits non-zero when no GPUs are present; run
60+
# it in a conditional so `set -e` does not cause the script to exit.
61+
if nvidia-smi --list-gpus >/dev/null 2>&1; then
62+
echo "=> Found NVIDIA GPU, Run OpenMP offloading tests on GPU (device 0)"
63+
echo "=> Running: TEST_DEVICES=0 RUN_TARGET=1 $SEGVCATCH python -m numba.runtests -v -- numba.openmp.tests.test_openmp.TestOpenmpTarget"
64+
OMP_TARGET_OFFLOAD=mandatory TEST_DEVICES=0 RUN_TARGET=1 $SEGVCATCH python -m numba.runtests -v -- numba.openmp.tests.test_openmp.TestOpenmpTarget 2>&1
65+
fi
6166
fi

buildscripts/gitlab/build-and-test.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@ TMPDIR=/tmp/pyomp/${CI_JOB_ID}
77
mkdir -p ${TMPDIR}
88
pushd ${TMPDIR}
99

10+
# Set the LLVM_VERSION to use.
11+
export LLVM_VERSION="15.0.7"
12+
1013
# Set the envs directory under the temporary directory.
1114
export CONDA_ENVS_DIRS="${TMPDIR}/_stage/miniconda3/envs"
1215

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

1619
# Export environment variables for building and testing.
17-
export LLVM_DIR="${CONDA_ENVS_DIRS}/llvmdev"
18-
export CLANG_TOOL="${CONDA_ENVS_DIRS}/clang14/bin/clang"
20+
export LLVM_DIR="${CONDA_ENVS_DIRS}/llvmdev-${LLVM_VERSION}"
21+
export PATH="${CONDA_ENVS_DIRS}/llvmdev-${LLVM_VERSION}/bin:${PATH}"
1922
export USE_CXX11_ABI="1"
2023
export PIP_NO_INPUT="1"
2124

examples/hello-target.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
from numba.openmp import openmp_context as openmp
33
from numba.openmp import omp_get_num_threads, omp_get_thread_num
44

5+
56
@njit
67
def hello():
7-
with openmp("target device(1)"):
8-
print("hello thread", omp_get_thread_num(),"of", omp_get_num_threads())
8+
with openmp("target device(0)"):
9+
print("hello thread", omp_get_thread_num(), "of", omp_get_num_threads())
10+
911

1012
hello()

0 commit comments

Comments
 (0)