Repository navigation
Enable AdaptiveCpp builds #2384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+1,506
−129
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
4c3042a
Enable building with AdaptiveCpp
ndgrigorian a8ee5ee
Make test suite pass for AdaptiveCpp
ndgrigorian 2123a3a
Update examples for AdaptiveCpp
ndgrigorian c308261
Add AdaptiveCpp workflow
ndgrigorian e2ecabc
Add build option for AdaptiveCpp
ndgrigorian edbbdf8
Fix broken test for acpp
ndgrigorian dbc3940
drop unhandled async errors under AdaptiveCpp
ndgrigorian 160fc19
show native errors in AdaptiveCpp test runs
ndgrigorian 53ceaf1
document building with AdaptiveCpp
ndgrigorian ea5ce64
pin hip-runtime-amd to 6.x in AdaptiveCpp workflow
ndgrigorian b038ef4
drop DPCTL_VERBOSITY from AdaptiveCpp test runs
ndgrigorian 2a52b9d
make submit_barrier wait for prior work under AdaptiveCpp
ndgrigorian 5cb7112
fix AdaptiveCpp component devices, can_compile and peer access
ndgrigorian 7f1b907
fix CMake provider options and ACPP_TARGETS handling
ndgrigorian 979b639
limit AdaptiveCpp test skips to AdaptiveCpp builds
ndgrigorian 54aad90
add changelog entries, provider gtest and include cleanups
ndgrigorian 73d9e78
warm up the barrier kernel in submit_barrier test
ndgrigorian e7890da
skip new SPIR-V and OpenCL source submit tests on AdaptiveCpp
ndgrigorian 01c3c41
report unsupported aspects as false without an error
ndgrigorian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,172 @@ | ||
| name: Build with AdaptiveCpp | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| CHANNELS: "-c conda-forge --override-channels" | ||
| # examples that AdaptiveCpp can build | ||
| SYCL_EXAMPLES: "cython/sycl_buffer cython/use_dpctl_sycl pybind11/external_usm_allocation pybind11/use_dpctl_sycl_queue" | ||
| C_EXAMPLES: "c/py_sycl_ls" | ||
|
|
||
| jobs: | ||
| test_linux: | ||
| name: Build and test with AdaptiveCpp, Python ${{ matrix.python }} | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 120 | ||
| defaults: | ||
| run: | ||
| shell: bash -el {0} | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - python: '3.14' | ||
| python_spec: '3.14.*=*_cp314' | ||
| - python: '3.14t' | ||
| python_spec: '3.14.*=*_cp314t' | ||
|
|
||
| steps: | ||
| - name: Checkout dpctl repo | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| # the package version comes from git describe | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Cache conda packages | ||
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | ||
| env: | ||
| CACHE_NUMBER: 0 # Increase to reset cache | ||
| with: | ||
| # the package directory that setup-miniconda configures | ||
| path: ~/conda_pkgs_dir | ||
| key: | ||
| ${{ runner.os }}-conda-acpp-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{ hashFiles('.github/workflows/adaptivecpp-build.yml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-conda-acpp-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}- | ||
| ${{ runner.os }}-conda-acpp-${{ env.CACHE_NUMBER }}- | ||
|
|
||
| - uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1 | ||
| with: | ||
| auto-update-conda: true | ||
| miniforge-version: latest | ||
| activate-environment: acpp | ||
| channels: conda-forge | ||
| conda-remove-defaults: true | ||
|
|
||
| - name: Install AdaptiveCpp and build dependencies | ||
| run: | | ||
| # the Python build string selects the GIL or the free-threaded variant, | ||
| # clang must come from the LLVM that adaptivecpp was built against, and | ||
| # intel-opencl-rt provides the OpenCL CPU device to run on; the HIP | ||
| # backend plugin links libamdhip64.so.6, which ROCm 7 does not provide | ||
| conda install -y ${{ env.CHANNELS }} \ | ||
| "python=${{ matrix.python_spec }}" \ | ||
| "adaptivecpp=*=cpu_llvm19*" "clang=19.*" "clangxx=19.*" \ | ||
| "hip-runtime-amd=6.*" \ | ||
| intel-opencl-rt \ | ||
| cmake cython ninja numpy pybind11 pytest scikit-build "setuptools<80" versioneer | ||
|
|
||
| - name: Report the environment | ||
| run: | | ||
| conda list | ||
| python -VV | ||
| acpp-info -l | ||
|
|
||
| - name: Build dpctl | ||
| run: | | ||
| python scripts/build_locally.py --sycl-provider=AdaptiveCpp | ||
|
|
||
| - name: List platforms | ||
| run: | | ||
| python -m dpctl -f | ||
| python -c "from dpctl._diagnostics import sycl_provider; assert sycl_provider() == 'AdaptiveCpp'" | ||
|
|
||
| - name: Run dpctl/tests on the OpenMP device | ||
| env: | ||
| ACPP_VISIBILITY_MASK: omp | ||
| run: | | ||
| python -m pytest -q --capture=sys dpctl/tests | ||
|
|
||
| - name: Run dpctl/tests on the OpenCL CPU device | ||
| env: | ||
| ACPP_VISIBILITY_MASK: ocl | ||
| run: | | ||
| python -m pytest -q --capture=sys dpctl/tests | ||
|
|
||
| - name: Build examples of extensions | ||
| env: | ||
| PYTHONPATH: ${{ github.workspace }} | ||
| run: | | ||
| for d in ${SYCL_EXAMPLES}; do | ||
| pushd "examples/${d}" > /dev/null | ||
| CC="${CONDA_PREFIX}/bin/clang" CXX="${CONDA_PREFIX}/bin/acpp" \ | ||
| python setup.py build_ext --inplace -G Ninja -- \ | ||
| -DDPCTL_SYCL_PROVIDER=AdaptiveCpp \ | ||
| -DDpctl_DIR="${GITHUB_WORKSPACE}/cmake" | ||
| popd > /dev/null | ||
| done | ||
| for d in ${C_EXAMPLES}; do | ||
| pushd "examples/${d}" > /dev/null | ||
| python setup.py build_ext --inplace | ||
| popd > /dev/null | ||
| done | ||
|
|
||
| - name: Run examples of extensions on the OpenMP device | ||
| env: | ||
| ACPP_VISIBILITY_MASK: omp | ||
| PYTHONPATH: ${{ github.workspace }} | ||
| run: | | ||
| for d in ${SYCL_EXAMPLES} ${C_EXAMPLES}; do | ||
| # the OpenMP backend allocates plain host memory, so every USM kind | ||
| # reports usm_type "host" and this example's checks cannot hold | ||
| if [ "${d}" = "pybind11/external_usm_allocation" ]; then | ||
| continue | ||
| fi | ||
| pushd "examples/${d}" > /dev/null | ||
| python -m pytest -q tests | ||
| popd > /dev/null | ||
| done | ||
|
|
||
| - name: Run examples of extensions on the OpenCL CPU device | ||
| env: | ||
| ACPP_VISIBILITY_MASK: ocl | ||
| PYTHONPATH: ${{ github.workspace }} | ||
| run: | | ||
| for d in ${SYCL_EXAMPLES} ${C_EXAMPLES}; do | ||
| pushd "examples/${d}" > /dev/null | ||
| python -m pytest -q tests | ||
| popd > /dev/null | ||
| done | ||
|
|
||
| - name: Run Python examples on the OpenMP device | ||
| working-directory: examples/python | ||
| env: | ||
| ACPP_VISIBILITY_MASK: omp | ||
| run: | | ||
| while IFS= read -r script; do | ||
| echo "Executing ${script}" | ||
| python "${script}" --run all | ||
| done < <(find . \( -not -name "_*" -and -name "*.py" \)) | ||
|
|
||
| - name: Run Python examples on the OpenCL CPU device | ||
| working-directory: examples/python | ||
| env: | ||
| ACPP_VISIBILITY_MASK: ocl | ||
| run: | | ||
| while IFS= read -r script; do | ||
| echo "Executing ${script}" | ||
| python "${script}" --run all | ||
| done < <(find . \( -not -name "_*" -and -name "*.py" \)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.