@@ -2,18 +2,71 @@ name: "GPU AT2 gcc 12.3 cuda 12.1"
22
33on :
44 workflow_call
5+ inputs :
6+ precision :
7+ required : false
8+ type : string
9+ build_type :
10+ required : false
11+ type : string
512
613jobs :
14+ # this is more work than I'd expect, but this is how you pass info after
15+ # operating on it in a job/step
16+ # TODO: factor this out into an action?
17+ # parse the inputs from the workflow call that'll be used by strategy.matrix
18+ define_matrix :
19+ runs-on : ubuntu-22.04
20+ # define the outputs that will come from the steps below
21+ outputs :
22+ build_type : ${{ steps.build_type.outputs.build_type }}
23+ precision : ${{ steps.precision.outputs.precision }}
24+ steps :
25+ - name : Define build_type
26+ id : build_type
27+ env :
28+ # if empty (i.e., triggered by PR) make ALL default
29+ btype : ${{ inputs.build_type || 'ALL' }}
30+ # this is a little over-cautious, since the 'else' should never happen
31+ run : |
32+ case ${{ env.btype }} in
33+ "Debug")
34+ echo 'build_type=["Debug"]' >> "$GITHUB_OUTPUT" ;;
35+ "Release")
36+ echo 'build_type=["Release"]' >> "$GITHUB_OUTPUT" ;;
37+ "ALL")
38+ echo 'build_type=["Debug", "Release"]' >> "$GITHUB_OUTPUT" ;;
39+ *)
40+ echo 'build_type=["Debug", "Release"]' >> "$GITHUB_OUTPUT" ;;
41+ esac
42+ - name : Define precision
43+ id : precision
44+ env :
45+ prec : ${{ inputs.precision || 'ALL' }}
46+ run : |
47+ case ${{ env.prec }} in
48+ "Debug")
49+ echo 'precision=["single"]' >> "$GITHUB_OUTPUT" ;;
50+ "Release")
51+ echo 'precision=["double"]' >> "$GITHUB_OUTPUT" ;;
52+ "ALL")
53+ echo 'precision=["single", "double"]' >> "$GITHUB_OUTPUT" ;;
54+ *)
55+ echo 'precision=["single", "double"]' >> "$GITHUB_OUTPUT" ;;
56+ esac
757 gcc-cuda :
858 runs-on : [self-hosted, m4xci-snl-cuda, cuda, gcc]
959 # will run other tests in the matrix even if one fails
1060 # NOTE: prioritizes extra info over speed, so consider whether this makes sense
1161 continue-on-error : false
62+ needs : define_matrix
63+ # A build matrix storing all desired configurations.
1264 strategy :
1365 fail-fast : true
1466 matrix :
15- build-type : [Debug, Release]
16- fp-precision : [single, double]
67+ # to get the array instead of a string, need the fromJSON()
68+ build-type : ${{ fromJSON(needs.define_matrix.outputs.build_type) }}
69+ fp-precision : ${{ fromJSON(needs.define_matrix.outputs.precision) }}
1770 name : gcc-cuda / ${{ matrix.build-type }} - ${{ matrix.fp-precision }}
1871 steps :
1972 - name : Check out the repository
0 commit comments