Skip to content

file list

file list #14

Workflow file for this run

name: Check Vectorization by Compiler
on: [push, pull_request]
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build:
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {
os: ubuntu-latest,
compiler: gcc,
flags: "-O3 -ftree-vectorize -fopt-info-vec-optimized",
}
- {
os: macOS-latest,
compiler: clang,
flags: "-O3 -Rpass=loop-vectorize",
}
- { os: windows-latest, compiler: cl, flags: "/O2 /Qvec-report:2" }
files:
- ["src/util/sample.cpp", "src/util/sample.h"]
steps:
- name: "Check out repository"
uses: actions/[email protected]
with:
# This is necessary for making `git describe` work.
fetch-depth: 0
- name: "Ensure that all tags are fetched"
# Works around an issue where not the latest tag is not fetched when the
# workflow is triggered by a tag push event.
# Possibly related: actions/checkout#290
run: git fetch origin --force --tags
- name: Set up compiler
run: |
if [ "${{ matrix.config.compiler }}" = "gcc" ]; then
sudo apt-get install -y ${{ matrix.config.compiler }}
fi
- name: Compile and check vectorization
id: check
shell: bash
run: |
for FILE in "${{ matrix.files }}"; do
if [[ "${{ runner.os }}" == "Windows" ]]; then
OUTPUT=$(pwsh -c "& '${{ matrix.compiler }}' ${{matrix.flags}} '$FILE'")
echo "result=$OUTPUT" >> $GITHUB_ENV
else
OUTPUT=$("${{ matrix.compiler }}" ${{matrix.flags}} "$FILE")
echo "result=$OUTPUT" >> $GITHUB_ENV
fi
done
- name: Print vectorization results
id: evaluate
shell: bash
run: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
echo "result=$OUTPUT" >> $GITHUB_ENV
else
echo "result=$OUTPUT" >> $GITHUB_ENV
fi
- name: Print result
run: echo "${{ env.result }}"
report:
needs: build
runs-on: ubuntu-latest
steps:
- name: Create report
run: |
echo "OS, Compiler, Function, Vectorized"
echo "${{ needs.build.outputs.result }}"