@@ -586,9 +586,11 @@ jobs:
586586 env :
587587 # SCCACHE_GHA_ENABLED: "on"
588588 ROCM_PATH : " /opt/rocm"
589+ RANDOMIZE_READDIR_LOG : " /tmp/readdir.log"
589590
590591 steps :
591- - uses : actions/checkout@v4
592+ - name : Clone repository
593+ uses : actions/checkout@v4
592594
593595 # I don't want to break the cache during testing. Will turn on after I
594596 # make sure it's working.
@@ -606,44 +608,69 @@ jobs:
606608 # script: |
607609 # core.exportVariable('ROCM_PATH', process.env.ROCM_PATH || '');
608610
611+ - name : Install dependencies
612+ shell : bash
613+ run : |
614+ ## Install dependencies
615+ sudo apt-get update
616+ sudo apt-get install -y cmake curl
617+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y
618+ echo "$HOME/.cargo/bin" >> $GITHUB_PATH
619+
620+ - name : Install rust
621+ uses : ./.github/actions/rust-toolchain
622+ with :
623+ toolchain : " stable"
624+
625+ - name : Build & setup librandomize_readdir
626+ run : |
627+ cargo build -p randomize_readdir
628+
609629 - uses : actions/download-artifact@v4
610630 with :
611631 name : integration-tests
612632 path : /home/runner/.cargo/bin/
613633 - name : Chmod for binary
614634 run : chmod +x ${SCCACHE_PATH}
615635
616- - name : Install dependencies
617- shell : bash
618- run : |
619- ## Install dependencies
620- sudo apt-get update
621- sudo apt-get install -y cmake
622-
623636 # Ensure that HIPCC isn't already borken
624637 - name : Sanity Check
625638 run : |
639+ export LD_PRELOAD=$PWD/target/debug/librandomize_readdir.so
626640 hipcc -o vectoradd_hip --offload-arch=gfx900 tests/cmake-hip/vectoradd_hip.cpp
627641
628642 - name : Test
629643 run : |
644+ export LD_PRELOAD=$PWD/target/debug/librandomize_readdir.so
645+ rm "$RANDOMIZE_READDIR_LOG".*
630646 cmake -B build -S tests/cmake-hip -DCMAKE_HIP_COMPILER_LAUNCHER=${SCCACHE_PATH} -DCMAKE_HIP_ARCHITECTURES=gfx900
631647 cmake --build build
648+ if ! grep -q bitcode "$RANDOMIZE_READDIR_LOG".*; then
649+ echo "amdgcn bitcode not accessed, is librandomize_readdir properly set up?"
650+ exit 1
651+ fi
632652
633653 - name : Output
634654 run : |
655+ export LD_PRELOAD=$PWD/target/debug/librandomize_readdir.so
635656 ${SCCACHE_PATH} --show-stats
636657
637658 - name : Test Twice for Cache Read
638659 run : |
660+ export LD_PRELOAD=$PWD/target/debug/librandomize_readdir.so
661+ rm "$RANDOMIZE_READDIR_LOG".*
639662 rm -rf build
640663 cmake -B build -S tests/cmake-hip -DCMAKE_HIP_COMPILER_LAUNCHER=${SCCACHE_PATH} -DCMAKE_HIP_ARCHITECTURES=gfx900
641664 cmake --build build
665+ if ! grep -q bitcode "$RANDOMIZE_READDIR_LOG".*; then
666+ echo "amdgcn bitcode not accessed, is librandomize_readdir properly set up?"
667+ exit 1
668+ fi
642669
643670 - name : Output
644671 run : |
672+ export LD_PRELOAD=$PWD/target/debug/librandomize_readdir.so
645673 ${SCCACHE_PATH} --show-stats
646-
647674 ${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"
648675
649676 gcc :
0 commit comments