Skip to content

Commit

Permalink
Update Subspace with CUDA support
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Sep 17, 2024
1 parent a1bc095 commit db10ab2
Show file tree
Hide file tree
Showing 5 changed files with 221 additions and 98 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ jobs:
run: brew install libtool
if: runner.os == 'macOS'

- name: CUDA toolchain
uses: Jimver/cuda-toolkit@9b295696791d75d658d8de64c4a85097ad8abeaf # v0.2.16
with:
cuda: '12.4.1'
method: network
sub-packages: '["nvcc", "cudart"]'
if: runner.os == 'Linux' || runner.os == 'Windows'

- name: Install Protoc
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
with:
Expand Down Expand Up @@ -134,26 +142,33 @@ jobs:
restore-keys: |
${{ runner.os }}-cargo-
- name: Build app (Linux or macOS, modern)
- name: Build app (Linux, modern, CUDA)
env:
RUSTFLAGS: ${{ matrix.build.modern-rustflags }}
run: |
cargo -Zgitoxide -Zgit build --locked -Z build-std --target ${{ matrix.build.target }} --profile production
cargo -Zgitoxide -Zgit build --locked -Z build-std --target ${{ matrix.build.target }} --profile production --features cuda
mv target/${{ matrix.build.target }}/production/space-acres target/${{ matrix.build.target }}/production/space-acres-modern
if: (runner.os == 'Linux' || runner.os == 'macOS') && matrix.build.modern-rustflags
if: runner.os == 'Linux' && matrix.build.modern-rustflags

- name: Build app (Windows, modern)
- name: Build app (Windows, modern, CUDA)
env:
RUSTFLAGS: ${{ matrix.build.modern-rustflags }}
run: |
cargo -Zgitoxide -Zgit build --locked -Z build-std --target ${{ matrix.build.target }} --profile production
cargo -Zgitoxide -Zgit build --locked -Z build-std --target ${{ matrix.build.target }} --profile production --features cuda
Move-Item -Path target\${{ matrix.build.target }}\production\space-acres.exe -Destination target\${{ matrix.build.target }}\production\space-acres-modern.exe
if: runner.os == 'Windows' && matrix.build.modern-rustflags

- name: Build app (normal)
- name: Build app (macOS, normal)
env:
RUSTFLAGS: ${{ matrix.build.rustflags }}
run: cargo -Zgitoxide -Zgit build --locked -Z build-std --target ${{ matrix.build.target }} --profile production
if: runner.os == 'macOS'

- name: Build app (Linux or Windows, normal, CUDA)
env:
RUSTFLAGS: ${{ matrix.build.rustflags }}
run: cargo -Zgitoxide -Zgit build --locked -Z build-std --target ${{ matrix.build.target }} --profile production --features cuda
if: runner.os == 'Linux' || runner.os == 'Windows'

- name: Create bundle (macOS)
run: |
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ jobs:
run: brew install libtool
if: runner.os == 'macOS'

- name: CUDA toolchain
uses: Jimver/cuda-toolkit@9b295696791d75d658d8de64c4a85097ad8abeaf # v0.2.16
with:
cuda: '12.4.1'
method: network
sub-packages: '["nvcc", "cudart"]'
if: runner.os == 'Linux' || runner.os == 'Windows'

- name: Install Protoc
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
with:
Expand Down Expand Up @@ -150,6 +158,11 @@ jobs:
- name: cargo clippy
run: cargo -Zgitoxide -Zgit clippy --locked --all-targets -- -D warnings
if: runner.os == 'macOS'

- name: cargo clippy
run: cargo -Zgitoxide -Zgit clippy --locked --all-targets --features cuda -- -D warnings
if: runner.os == 'Linux' || runner.os == 'Windows'

cargo-test:
strategy:
Expand Down
Loading

0 comments on commit db10ab2

Please sign in to comment.