diff --git a/ci/windows/build_common.psm1 b/ci/windows/build_common.psm1 index 1eb5f1a9d63..151bb1f112e 100644 --- a/ci/windows/build_common.psm1 +++ b/ci/windows/build_common.psm1 @@ -3,7 +3,11 @@ Param( [Alias("std")] [ValidateNotNullOrEmpty()] [ValidateSet(11, 14, 17, 20)] - [int]$CXX_STANDARD = 17 + [int]$CXX_STANDARD = 17, + [Parameter(Mandatory = $false)] + [ValidateNotNullOrEmpty()] + [Alias("arch")] + [int]$CUDA_ARCH = 0 ) $ErrorActionPreference = "Stop" @@ -20,6 +24,12 @@ if ($script:CL_VERSION_STRING -match "Version (\d+\.\d+)\.\d+") { Write-Host "Detected cl.exe version: $CL_VERSION" } +$script:GLOBAL_CMAKE_OPTIONS = "" +if ($CUDA_ARCH -ne 0) { + $script:GLOBAL_CMAKE_OPTIONS += "-DCMAKE_CUDA_ARCHITECTURES=$CUDA_ARCH" +} + + if (-not $env:CCCL_BUILD_INFIX) { $env:CCCL_BUILD_INFIX = "" } @@ -56,6 +66,7 @@ Write-Host "NVCC_VERSION=$NVCC_VERSION" Write-Host "CMAKE_BUILD_PARALLEL_LEVEL=$env:CMAKE_BUILD_PARALLEL_LEVEL" Write-Host "CTEST_PARALLEL_LEVEL=$env:CTEST_PARALLEL_LEVEL" Write-Host "CCCL_BUILD_INFIX=$env:CCCL_BUILD_INFIX" +Write-Host "GLOBAL_CMAKE_OPTIONS=$script:GLOBAL_CMAKE_OPTIONS" Write-Host "Current commit is:" Write-Host "$(git log -1 --format=short)" Write-Host "========================================" @@ -82,7 +93,7 @@ function configure_preset { pushd ".." # Echo and execute command to stdout: - $configure_command = "cmake --preset $PRESET $CMAKE_OPTIONS --log-level VERBOSE" + $configure_command = "cmake --preset $PRESET $script:GLOBAL_CMAKE_OPTIONS $CMAKE_OPTIONS --log-level VERBOSE" Write-Host $configure_command Invoke-Expression $configure_command $test_result = $LastExitCode diff --git a/ci/windows/build_cub.ps1 b/ci/windows/build_cub.ps1 index 32e4f71ee9a..27c5360ded9 100644 --- a/ci/windows/build_cub.ps1 +++ b/ci/windows/build_cub.ps1 @@ -3,7 +3,11 @@ Param( [Alias("std")] [ValidateNotNullOrEmpty()] [ValidateSet(11, 14, 17, 20)] - [int]$CXX_STANDARD = 17 + [int]$CXX_STANDARD = 17, + [Parameter(Mandatory = $false)] + [ValidateNotNullOrEmpty()] + [Alias("arch")] + [int]$CUDA_ARCH = 0 ) $ErrorActionPreference = "Stop" @@ -14,7 +18,7 @@ If($CURRENT_PATH -ne "ci") { pushd "$PSScriptRoot/.." } -Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD +Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD, $CUDA_ARCH $PRESET = "cub-cpp$CXX_STANDARD" $CMAKE_OPTIONS = "" diff --git a/ci/windows/build_cudax.ps1 b/ci/windows/build_cudax.ps1 index ca7bd578291..7b8cd0ff771 100644 --- a/ci/windows/build_cudax.ps1 +++ b/ci/windows/build_cudax.ps1 @@ -4,7 +4,11 @@ Param( [Alias("std")] [ValidateNotNullOrEmpty()] [ValidateSet(20)] - [int]$CXX_STANDARD = 20 + [int]$CXX_STANDARD = 20, + [Parameter(Mandatory = $false)] + [ValidateNotNullOrEmpty()] + [Alias("arch")] + [int]$CUDA_ARCH = 0 ) $CURRENT_PATH = Split-Path $pwd -leaf @@ -14,7 +18,7 @@ If($CURRENT_PATH -ne "ci") { } Remove-Module -Name build_common -Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD +Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD, $CUDA_ARCH $PRESET = "cudax-cpp$CXX_STANDARD" $CMAKE_OPTIONS = "" diff --git a/ci/windows/build_libcudacxx.ps1 b/ci/windows/build_libcudacxx.ps1 index a57e2280de7..2f80619f76b 100644 --- a/ci/windows/build_libcudacxx.ps1 +++ b/ci/windows/build_libcudacxx.ps1 @@ -3,7 +3,11 @@ Param( [Alias("std")] [ValidateNotNullOrEmpty()] [ValidateSet(11, 14, 17, 20)] - [int]$CXX_STANDARD = 17 + [int]$CXX_STANDARD = 17, + [Parameter(Mandatory = $false)] + [ValidateNotNullOrEmpty()] + [Alias("arch")] + [int]$CUDA_ARCH = 0 ) $ErrorActionPreference = "Stop" @@ -14,7 +18,7 @@ If($CURRENT_PATH -ne "ci") { pushd "$PSScriptRoot/.." } -Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD, $GPU_ARCHS +Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD, $CUDA_ARCH $PRESET = "libcudacxx-cpp${CXX_STANDARD}" $CMAKE_OPTIONS = "" diff --git a/ci/windows/build_thrust.ps1 b/ci/windows/build_thrust.ps1 index 186ed94eace..bda86859fd4 100644 --- a/ci/windows/build_thrust.ps1 +++ b/ci/windows/build_thrust.ps1 @@ -3,7 +3,11 @@ Param( [Alias("std")] [ValidateNotNullOrEmpty()] [ValidateSet(11, 14, 17, 20)] - [int]$CXX_STANDARD = 17 + [int]$CXX_STANDARD = 17, + [Parameter(Mandatory = $false)] + [ValidateNotNullOrEmpty()] + [Alias("arch")] + [int]$CUDA_ARCH = 0 ) $ErrorActionPreference = "Stop" @@ -14,7 +18,7 @@ If($CURRENT_PATH -ne "ci") { pushd "$PSScriptRoot/.." } -Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD +Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD, $CUDA_ARCH $PRESET = "thrust-cpp$CXX_STANDARD" $CMAKE_OPTIONS = "" diff --git a/ci/windows/test_thrust.ps1 b/ci/windows/test_thrust.ps1 index 7c020714208..eabda06df5b 100644 --- a/ci/windows/test_thrust.ps1 +++ b/ci/windows/test_thrust.ps1 @@ -5,6 +5,10 @@ Param( [ValidateSet(11, 14, 17, 20)] [int]$CXX_STANDARD = 17, [Parameter(Mandatory = $false)] + [ValidateNotNullOrEmpty()] + [Alias("arch")] + [int]$CUDA_ARCH = 0, + [Parameter(Mandatory = $false)] [Alias("cpu-only")] [switch]$CPU_ONLY = $false ) @@ -24,11 +28,11 @@ If($CURRENT_PATH -ne "ci") { } # Execute the build script: -$build_command = "$PSScriptRoot/build_thrust.ps1 -std $CXX_STANDARD" +$build_command = "$PSScriptRoot/build_thrust.ps1 -std $CXX_STANDARD -arch $CUDA_ARCH" Write-Host "Executing: $build_command" Invoke-Expression $build_command -Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD +Import-Module -Name "$PSScriptRoot/build_common.psm1" -ArgumentList $CXX_STANDARD, $CUDA_ARCH $PRESET = "thrust-cpu-cpp$CXX_STANDARD"