Skip to content

Commit

Permalink
Update examples for new api (#355)
Browse files Browse the repository at this point in the history
## Describe the changes

Make sure the examples comply with new API
  • Loading branch information
svpolonsky authored and jeremyfelder committed Jan 31, 2024
2 parents 1874ade + 759b7b2 commit aaa3808
Show file tree
Hide file tree
Showing 23 changed files with 307 additions and 522 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This workflow is a demo of how to run all examples in the Icicle repository.
# For each language directory (c++, Rust, etc.) the workflow
# (1) loops over all examples (msm, ntt, etc.) and
# (2) runs ./compile.sh and ./run.sh in each directory.
# The script ./compile.sh should compile the example and ./run.sh should run it.
# Each script should return 0 for success and 1 otherwise.

name: Examples

on:
pull_request:
branches:
- main
- dev
push:
branches:
- main
- dev

jobs:
test-examples:
runs-on: [self-hosted, Linux, X64, icicle] # ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: c++ examples
working-directory: ./examples/c++
run: |
# loop over all directories in the current directory
for dir in $(find . -mindepth 1 -maxdepth 1 -type d); do
if [ -d "$dir" ]; then
echo "Running command in $dir"
cd $dir
./compile.sh
./run.sh
cd -
fi
done
- name: Rust examples
working-directory: ./examples/rust
run: |
# loop over all directories in the current directory
for dir in $(find . -mindepth 1 -maxdepth 1 -type d); do
if [ -d "$dir" ]; then
echo "Running command in $dir"
cd $dir
cargo run --release
cd -
fi
done
40 changes: 0 additions & 40 deletions examples/c++/Poseidon-hash/.devcontainer/Dockerfile

This file was deleted.

21 changes: 0 additions & 21 deletions examples/c++/Poseidon-hash/.devcontainer/devcontainer.json

This file was deleted.

26 changes: 0 additions & 26 deletions examples/c++/Poseidon-hash/CMakeLists.txt

This file was deleted.

85 changes: 0 additions & 85 deletions examples/c++/Poseidon-hash/README.md

This file was deleted.

150 changes: 0 additions & 150 deletions examples/c++/Poseidon-hash/example.cu

This file was deleted.

3 changes: 1 addition & 2 deletions examples/c++/msm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-relaxed-constexpr")
set(CMAKE_CUDA_FLAGS_RELEASE "")
set(CMAKE_CUDA_FLAGS_DEBUG "${CMAKE_CUDA_FLAGS_DEBUG} -g -G -O0")
# change the path to your Icicle location
include_directories("../../.." "/icicle" "/opt/icicle")
include_directories("../../../icicle")
add_executable(
example
example.cu
Expand All @@ -23,4 +23,3 @@ add_executable(
find_library(NVML_LIBRARY nvidia-ml PATHS /usr/local/cuda-12.0/targets/x86_64-linux/lib/stubs/ )
target_link_libraries(example ${NVML_LIBRARY})
set_target_properties(example PROPERTIES CUDA_SEPARABLE_COMPILATION ON)

Loading

0 comments on commit aaa3808

Please sign in to comment.