Skip to content

Commit

Permalink
Update CMake for SYCL
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Sep 22, 2024
1 parent ebdb56b commit a1bed56
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 2 deletions.
60 changes: 58 additions & 2 deletions .github/workflows/sycl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ concurrency:
cancel-in-progress: true

jobs:
Tests:
name: SYCL Tests
Tests-gmake:
name: SYCL Tests & GNU Make
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -27,3 +27,59 @@ jobs:
cd Tests/GPU
make -j4 USE_SYCL=TRUE
Tests-cmake:
name: SYCL Tests & CMake
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Dependencies
run: |
.github/workflows/dependencies/dependencies_dpcpp.sh
- name: Tests
run: |
set +e
source /opt/intel/oneapi/setvars.sh
set -e
mkdir build
cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX=../sycl_installdir \
-DENABLE_SYCL=ON \
-DCMAKE_CXX_COMPILER=icpx \
-DENABLE_TESTS=ON
make -j4 VERBOSE=ON
make install
Tutorials-cmake:
name: SYCL Tutorials & CMake
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Dependencies
run: |
.github/workflows/dependencies/dependencies_dpcpp.sh
- name: Tests
run: |
set +e
source /opt/intel/oneapi/setvars.sh
set -e
mkdir build
cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX=../sycl_installdir \
-DENABLE_SYCL=ON \
-DCMAKE_CXX_COMPILER=icpx
make -j4 VERBOSE=ON
make install
cd ../Tutorials/libamrexpr
mkdir build
cd build
cmake .. \
-DCMAKE_PREFIX_PATH=$(realpath ../../../sycl_installdir) \
-DENABLE_SYCL=ON \
-DCMAKE_CXX_COMPILER=icpx
make -j4 VERBOSE=ON
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ endif()

if (ENABLE_SYCL)
target_compile_options(amrexpr PUBLIC -fsycl)
target_link_options(amrexpr PUBLIC -fsycl -fsycl-device-lib=libc,libm-fp32,libm-fp64)
endif()

install(TARGETS amrexpr EXPORT amrexprTargets)
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ $ cmake -S . -B build -DCMAKE_INSTALL_PREFIX=<installation_direction> \
# AMD MI250X GPU, gfx90a architecture
$ cmake -S . -B build -DCMAKE_INSTALL_PREFIX=<installation_direction> \
-DENABLE_HIP=ON -DCMAKE_HIP_ARCHITECTURES=gfx908

# Intel GPU
$ cmake -S . -B build -DCMAKE_INSTALL_PREFIX=<installation_direction> \
-DENABLE_SYCL=ON -DCMAKE_CXX_COMPILER=icpx
```

## Copyright Notice
Expand Down

0 comments on commit a1bed56

Please sign in to comment.