From 1e45ac74e07223dfe433b57bd9bad1214e388940 Mon Sep 17 00:00:00 2001 From: Roy Shilkrot Date: Sat, 21 Sep 2024 21:31:20 -0400 Subject: [PATCH] refactor: Update acceleration option in build and package scripts --- .github/actions/build-plugin/action.yaml | 6 +++--- .github/actions/package-plugin/action.yaml | 6 +++--- .github/scripts/Package-Windows.ps1 | 12 ++---------- .github/workflows/build-project.yaml | 8 ++++---- 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/.github/actions/build-plugin/action.yaml b/.github/actions/build-plugin/action.yaml index 75c8af7..127f933 100644 --- a/.github/actions/build-plugin/action.yaml +++ b/.github/actions/build-plugin/action.yaml @@ -8,8 +8,8 @@ inputs: description: 'Build configuration' required: false default: 'RelWithDebInfo' - cublas: - description: 'Enable cuBLAS' + acceleration: + description: 'Enable acceleration' required: false default: 'cpu' codesign: @@ -86,7 +86,7 @@ runs: .github/scripts/Build-Windows.ps1 @BuildArgs env: - CPU_OR_CUDA: ${{ inputs.cublas }} + ACCELERATION: ${{ inputs.acceleration }} - name: Create Summary 📊 if: contains(fromJSON('["Linux", "macOS"]'),runner.os) diff --git a/.github/actions/package-plugin/action.yaml b/.github/actions/package-plugin/action.yaml index d955c37..2827bb3 100644 --- a/.github/actions/package-plugin/action.yaml +++ b/.github/actions/package-plugin/action.yaml @@ -8,8 +8,8 @@ inputs: description: 'Build configuration' required: false default: 'RelWithDebInfo' - cublas: - description: 'Enable cuBLAS' + acceleration: + description: 'Enable acceleration' required: false default: 'cpu' codesign: @@ -112,7 +112,7 @@ runs: $PackageArgs = @{ Target = '${{ inputs.target }}' Configuration = '${{ inputs.config }}' - Cublas = '${{ inputs.cublas }}' + acceleration = '${{ inputs.acceleration }}' } if ( '${{ inputs.package }}' -eq 'true' ) { diff --git a/.github/scripts/Package-Windows.ps1 b/.github/scripts/Package-Windows.ps1 index ed1af21..63c34ab 100644 --- a/.github/scripts/Package-Windows.ps1 +++ b/.github/scripts/Package-Windows.ps1 @@ -5,7 +5,7 @@ param( [ValidateSet('Debug', 'RelWithDebInfo', 'Release', 'MinSizeRel')] [string] $Configuration = 'RelWithDebInfo', [ValidateSet('cpu', 'cuda', 'hipblas')] - [string] $Cublas = 'cpu', + [string] $acceleration = 'cpu', [switch] $BuildInstaller, [switch] $SkipDeps ) @@ -49,16 +49,8 @@ function Package { $BuildSpec = Get-Content -Path ${BuildSpecFile} -Raw | ConvertFrom-Json $ProductName = $BuildSpec.name $ProductVersion = $BuildSpec.version - # Check if $cublas is cpu or cuda - if ( $Cublas -eq 'cpu' ) { - $CudaName = 'cpu' - } elseif ( $Cublas -eq 'clblast' ) { - $CudaName = 'clblast' - } else { - $CudaName = "cuda${Cublas}" - } - $OutputName = "${ProductName}-${ProductVersion}-windows-${Target}-${CudaName}" + $OutputName = "${ProductName}-${ProductVersion}-windows-${Target}-${acceleration}" if ( ! $SkipDeps ) { Install-BuildDependencies -WingetFile "${ScriptHome}/.Wingetfile" diff --git a/.github/workflows/build-project.yaml b/.github/workflows/build-project.yaml index 03ffea0..4470023 100644 --- a/.github/workflows/build-project.yaml +++ b/.github/workflows/build-project.yaml @@ -227,7 +227,7 @@ jobs: needs: check-event strategy: matrix: - cublas: [cpu, hipblas, cuda] + acceleration: [cpu, hipblas, cuda] defaults: run: shell: pwsh @@ -257,7 +257,7 @@ jobs: with: target: x64 config: ${{ needs.check-event.outputs.config }} - cublas: ${{ matrix.cublas }} + acceleration: ${{ matrix.acceleration }} - name: Package Plugin 📀 uses: ./.github/actions/package-plugin @@ -265,10 +265,10 @@ jobs: target: x64 config: ${{ needs.check-event.outputs.config }} package: ${{ fromJSON(needs.check-event.outputs.package) }} - cublas: ${{ matrix.cublas }} + acceleration: ${{ matrix.acceleration }} - name: Upload Artifacts 📡 uses: actions/upload-artifact@v4 with: - name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-windows-x64-${{ matrix.cublas }}-${{ needs.check-event.outputs.commitHash }} + name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-windows-x64-${{ matrix.acceleration }}-${{ needs.check-event.outputs.commitHash }} path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-windows-x64*.*