Skip to content

Add hipSPARSELt examples #16

Add hipSPARSELt examples

Add hipSPARSELt examples #16

name: Build HIP-Basic VS
on:
push:
branches: [ amd-staging, amd-mainline, release/** ]
paths:
- 'HIP-Basic/**'
- '.github/workflows/**'
- 'Scripts/VisualStudio/**'
pull_request:
branches: [ amd-staging, amd-mainline, release/** ]
paths:
- 'HIP-Basic/**'
- '.github/workflows/**'
- 'Scripts/VisualStudio/**'
env:
PLATFORM_TOOLSET_VERSION: 6.4
HIP_PATH: C:\Program Files\AMD\ROCm\6.4\
HIPSDK_INSTALLER_VERSION: 25.Q3
VULKAN_SDK: C:\VulkanSDK\1.4.313.2\
GLFW_DIR: C:\glfw-3.4.bin.WIN64\
jobs:
build:
name: "Build HIP Basic VS"
strategy:
matrix:
config: [Debug, Release]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v2
- name: Install Python dependencies
shell: pwsh
run: |
python3 -m pip install rich
- name: Check GUID
shell: pwsh
run: |
python3 Scripts/VisualStudio/check_vs_files.py
- name: Install additional dependencies
shell: pwsh
run: |
$ProgressPreference = 'SilentlyContinue'
Write-Host "Downloading GLFW 3.4"
Invoke-WebRequest -Uri https://github.com/glfw/glfw/releases/download/3.4/glfw-3.4.bin.WIN64.zip -OutFile glfw-3.4.bin.WIN64.zip
Expand-Archive -Path glfw-3.4.bin.WIN64.zip -DestinationPath C:\ -PassThru
Write-Host "Downloading Vulkan SDK 1.4.313.2"
Invoke-WebRequest -Uri https://sdk.lunarg.com/sdk/download/1.4.313.2/windows/vulkansdk-windows-X64-1.4.313.2.exe -OutFile vulkansdk-windows-X64-1.4.313.2.exe
Write-Host "Installing Vulkan SDK"
Start-Process vulkansdk-windows-X64-1.4.313.2.exe -ArgumentList '--accept-licenses','--default-answer','--confirm-command','install' -NoNewWindow -Wait
- name: Install HIP SDK
shell: pwsh
run: |
$ProgressPreference = 'SilentlyContinue'
Write-Host "Downloading installer https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ env.HIPSDK_INSTALLER_VERSION }}-Win10-Win11-For-HIP.exe"
Invoke-WebRequest -Uri https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ env.HIPSDK_INSTALLER_VERSION }}-Win10-Win11-For-HIP.exe -OutFile HIPSDK.exe
Write-Host "Installing HIP SDK"
Start-Process HIPSDK.exe -ArgumentList '-install','-log',"$((Get-Location).Path)\installer_log.txt" -NoNewWindow -Wait
Write-Host "Installer log:"
Get-Content "installer_log.txt"
if (Test-Path -Path "${{ env.HIP_PATH }}") {
Write-Host "HIP_PATH directory exists: ${{ env.HIP_PATH }}"
Write-Host "HIP SDK installed successfully"
} else {
Write-Host "HIP_PATH directory DOES NOT exist: ${{ env.HIP_PATH }}"
Write-Host "HIP SDK installation failed"
Exit 1
}
- name: Apply patch
shell: pwsh
run: |
Write-Host "Applying patches $(Get-ChildItem -File Scripts\VisualStudio\*.patch)"
git apply (Get-ChildItem -File Scripts\VisualStudio\*.patch).FullName
Write-Host "Patches applied. Showing diff"
git diff
- name: Build ${{ matrix.config }} x64
shell: pwsh
run: |
Write-Host "Replace toolset $((Get-ChildItem -Recurse -File | Get-Content | Select-String -Pattern 'HIP clang .\..' | Select-Object -First 1).Matches.Value) with HIP clang ${{ env.PLATFORM_TOOLSET_VERSION }}"
Get-ChildItem -Recurse -File | Where-Object { Select-String -Pattern 'HIP clang .\..' -Path $_ } | ForEach-Object {
(Get-Content -Path $_.FullName) -replace 'HIP clang .\..', "HIP clang ${{ env.PLATFORM_TOOLSET_VERSION }}" | Set-Content -Path $_.FullName
}
msbuild Scripts\VisualStudio\build.proj -maxCpuCount -detailedSummary -property:"Category=HIP-Basic;Configuration=${{ matrix.config }};Platform=x64"
Write-Host "msbuild returned: $LastExitCode"
Exit $LastExitCode