mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-04-20 14:58:54 +00:00
commit4b309e6ad8Author: Allison Piper <alliepiper16@gmail.com> Date: Sat Apr 6 13:19:14 2024 +0000 Minor cleanups commit476ed2ceaeAuthor: Allison Piper <alliepiper16@gmail.com> Date: Sat Apr 6 12:53:37 2024 +0000 WAR compiler ice in nlohmann json. Only seeing this on GCC 9 + CTK 11.1. Seems to be having trouble with the `[[no_unique_address]]` optimization. commita9bf1d3e42Author: Allison Piper <alliepiper16@gmail.com> Date: Sat Apr 6 00:24:47 2024 +0000 Bump nlohmann json. commit80980fe373Author: Allison Piper <alliepiper16@gmail.com> Date: Sat Apr 6 00:22:07 2024 +0000 Fix llvm filesystem support commitf6099e6311Author: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 23:18:44 2024 +0000 Drop MSVC 2017 testing. commit5ae50a8ef5Author: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 23:02:32 2024 +0000 Add mroe missing headers. commitb2a9ae04d9Author: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 22:37:56 2024 +0000 Remove old CUDA+MSVC builds and make windows build-only. commit5b18c26a28Author: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 22:37:07 2024 +0000 Fix header for std::min/max. Why do I always think it's utility instead of algorithm.... commit6a409efa2dAuthor: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 22:18:18 2024 +0000 Temporarily disable CUPTI on all windows builds. commitf432f88866Author: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 21:42:52 2024 +0000 Fix warnings on MSVC. commit829787649bAuthor: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 21:03:16 2024 +0000 More flailing about in powershell. commit21742e6beaAuthor: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 20:36:08 2024 +0000 Cleanup filesystem header handling. commitde3d202635Author: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 20:09:00 2024 +0000 Windows CI debugging. commita4151667ffAuthor: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 19:45:40 2024 +0000 Quotation mark madness commitdd04f3befeAuthor: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 19:27:27 2024 +0000 Temporarily disable NVML on windows CI until new containers are ready. commitf3952848c4Author: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 19:25:22 2024 +0000 WAR issues on gcc-7. commit198986875eAuthor: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 19:25:04 2024 +0000 More matrix/devcontainer updates. commitb9712f8696Author: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 18:30:35 2024 +0000 Fix windows build scripts. commit943f268280Author: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 18:18:33 2024 +0000 Fix warnings with clang host compiler. commit7063e1d60aAuthor: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 18:14:28 2024 +0000 More devcontainer hijinks. commit06532fde81Author: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 17:51:25 2024 +0000 More matrix updates. commit78a265ea55Author: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 17:34:00 2024 +0000 Support CLI CMake options for windows ci scripts. commit670895c867Author: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 17:31:59 2024 +0000 Add missing devcontainers. commitb121823e74Author: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 17:22:54 2024 +0000 Build for `all-major` architectures in presets. We can get away with this because we require CMake 3.23.1. This was added in 3.23. commitfccfd44685Author: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 17:22:08 2024 +0000 Update matrix file. commite7d43ba90eAuthor: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 16:23:48 2024 +0000 Consolidate build/test jobs. commitc4044056ecAuthor: Allison Piper <alliepiper16@gmail.com> Date: Fri Apr 5 16:04:11 2024 +0000 Add missing build script.
208 lines
6.5 KiB
PowerShell
208 lines
6.5 KiB
PowerShell
|
|
Param(
|
|
[Parameter(Mandatory = $true)]
|
|
[Alias("std")]
|
|
[ValidateNotNullOrEmpty()]
|
|
[ValidateSet(17)]
|
|
[int]$CXX_STANDARD = 17
|
|
)
|
|
|
|
# We need the full path to cl because otherwise cmake will replace CMAKE_CXX_COMPILER with the full path
|
|
# and keep CMAKE_CUDA_HOST_COMPILER at "cl" which breaks our cmake script
|
|
$script:HOST_COMPILER = (Get-Command "cl").source -replace '\\','/'
|
|
$script:PARALLEL_LEVEL = (Get-WmiObject -class Win32_processor).NumberOfLogicalProcessors
|
|
|
|
# Extract the CL version for export to build scripts:
|
|
$script:CL_VERSION_STRING = & cl.exe /?
|
|
if ($script:CL_VERSION_STRING -match "Version (\d+\.\d+)\.\d+") {
|
|
$CL_VERSION = [version]$matches[1]
|
|
Write-Host "Detected cl.exe version: $CL_VERSION"
|
|
}
|
|
|
|
if (-not $env:CCCL_BUILD_INFIX) {
|
|
$env:CCCL_BUILD_INFIX = ""
|
|
}
|
|
|
|
# Presets will be configured in this directory:
|
|
$BUILD_DIR = "../build/$env:CCCL_BUILD_INFIX"
|
|
|
|
If(!(test-path -PathType container "../build")) {
|
|
New-Item -ItemType Directory -Path "../build"
|
|
}
|
|
|
|
# The most recent build will always be symlinked to cccl/build/latest
|
|
New-Item -ItemType Directory -Path "$BUILD_DIR" -Force
|
|
|
|
# Prepare environment for CMake:
|
|
$env:CMAKE_BUILD_PARALLEL_LEVEL = $PARALLEL_LEVEL
|
|
$env:CTEST_PARALLEL_LEVEL = 1
|
|
$env:CUDAHOSTCXX = $HOST_COMPILER.FullName
|
|
$env:CXX = $HOST_COMPILER.FullName
|
|
|
|
Write-Host "========================================"
|
|
Write-Host "Begin build"
|
|
Write-Host "pwd=$pwd"
|
|
Write-Host "BUILD_DIR=$BUILD_DIR"
|
|
Write-Host "CXX_STANDARD=$CXX_STANDARD"
|
|
Write-Host "CXX=$env:CXX"
|
|
Write-Host "CUDACXX=$env:CUDACXX"
|
|
Write-Host "CUDAHOSTCXX=$env:CUDAHOSTCXX"
|
|
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 "Current commit is:"
|
|
Write-Host "$(git log -1)"
|
|
Write-Host "========================================"
|
|
|
|
function configure_preset {
|
|
Param(
|
|
[Parameter(Mandatory = $true)]
|
|
[ValidateNotNullOrEmpty()]
|
|
[string]$BUILD_NAME,
|
|
[Parameter(Mandatory = $true)]
|
|
[ValidateNotNullOrEmpty()]
|
|
[string]$PRESET,
|
|
[Parameter(Mandatory = $true)]
|
|
[AllowEmptyString()]
|
|
[string]$CMAKE_OPTIONS
|
|
)
|
|
|
|
$step = "$BUILD_NAME (configure)"
|
|
|
|
# CMake must be invoked in the same directory as the presets file:
|
|
pushd ".."
|
|
|
|
$cmake_command = "cmake --preset $PRESET $CMAKE_OPTIONS --log-level VERBOSE"
|
|
echo "$cmake_command"
|
|
Invoke-Expression $cmake_command
|
|
$test_result = $LastExitCode
|
|
|
|
If ($test_result -ne 0) {
|
|
throw "$step Failed"
|
|
}
|
|
|
|
popd
|
|
Write-Host "$step complete."
|
|
}
|
|
|
|
function build_preset {
|
|
Param(
|
|
[Parameter(Mandatory = $true)]
|
|
[ValidateNotNullOrEmpty()]
|
|
[string]$BUILD_NAME,
|
|
[Parameter(Mandatory = $true)]
|
|
[ValidateNotNullOrEmpty()]
|
|
[string]$PRESET
|
|
)
|
|
|
|
$step = "$BUILD_NAME (build)"
|
|
|
|
# CMake must be invoked in the same directory as the presets file:
|
|
pushd ".."
|
|
|
|
sccache_stats('Start')
|
|
|
|
cmake --build --preset $PRESET -v
|
|
$test_result = $LastExitCode
|
|
|
|
sccache_stats('Stop')
|
|
|
|
echo "$step complete"
|
|
|
|
If ($test_result -ne 0) {
|
|
throw "$step Failed"
|
|
}
|
|
|
|
popd
|
|
}
|
|
|
|
function test_preset {
|
|
Param(
|
|
[Parameter(Mandatory = $true)]
|
|
[ValidateNotNullOrEmpty()]
|
|
[string]$BUILD_NAME,
|
|
[Parameter(Mandatory = $true)]
|
|
[ValidateNotNullOrEmpty()]
|
|
[string]$PRESET
|
|
)
|
|
|
|
$step = "$BUILD_NAME (test)"
|
|
|
|
# CTest must be invoked in the same directory as the presets file:
|
|
pushd ".."
|
|
|
|
sccache_stats('Start')
|
|
|
|
ctest --preset $PRESET
|
|
$test_result = $LastExitCode
|
|
|
|
sccache_stats('Stop')
|
|
|
|
echo "$step complete"
|
|
|
|
If ($test_result -ne 0) {
|
|
throw "$step Failed"
|
|
}
|
|
|
|
popd
|
|
}
|
|
|
|
function configure_and_build_preset {
|
|
Param(
|
|
[Parameter(Mandatory = $true)]
|
|
[ValidateNotNullOrEmpty()]
|
|
[string]$BUILD_NAME,
|
|
[Parameter(Mandatory = $true)]
|
|
[ValidateNotNullOrEmpty()]
|
|
[string]$PRESET,
|
|
[Parameter(Mandatory = $true)]
|
|
[AllowEmptyString()]
|
|
[string]$CMAKE_OPTIONS
|
|
)
|
|
|
|
configure_preset "$BUILD_NAME" "$PRESET" "$CMAKE_OPTIONS"
|
|
build_preset "$BUILD_NAME" "$PRESET"
|
|
}
|
|
|
|
function sccache_stats {
|
|
Param (
|
|
[Parameter(Mandatory = $true)]
|
|
[ValidateNotNullOrEmpty()]
|
|
[ValidateSet('Start','Stop')]
|
|
[string]$MODE
|
|
)
|
|
|
|
$sccache_stats = sccache -s
|
|
If($MODE -eq 'Start') {
|
|
[int]$script:sccache_compile_requests = ($sccache_stats[0] -replace '[^\d]+')
|
|
[int]$script:sccache_cache_hits_cpp = ($sccache_stats[2] -replace '[^\d]+')
|
|
[int]$script:sccache_cache_hits_cuda = ($sccache_stats[3] -replace '[^\d]+')
|
|
[int]$script:sccache_cache_miss_cpp = ($sccache_stats[5] -replace '[^\d]+')
|
|
[int]$script:sccache_cache_miss_cuda = ($sccache_stats[6] -replace '[^\d]+')
|
|
} else {
|
|
[int]$final_sccache_compile_requests = ($sccache_stats[0] -replace '[^\d]+')
|
|
[int]$final_sccache_cache_hits_cpp = ($sccache_stats[2] -replace '[^\d]+')
|
|
[int]$final_sccache_cache_hits_cuda = ($sccache_stats[3] -replace '[^\d]+')
|
|
[int]$final_sccache_cache_miss_cpp = ($sccache_stats[5] -replace '[^\d]+')
|
|
[int]$final_sccache_cache_miss_cuda = ($sccache_stats[6] -replace '[^\d]+')
|
|
|
|
[int]$total_requests = $final_sccache_compile_requests - $script:sccache_compile_requests
|
|
[int]$total_hits_cpp = $final_sccache_cache_hits_cpp - $script:sccache_cache_hits_cpp
|
|
[int]$total_hits_cuda = $final_sccache_cache_hits_cuda - $script:sccache_cache_hits_cuda
|
|
[int]$total_miss_cpp = $final_sccache_cache_miss_cpp - $script:sccache_cache_miss_cpp
|
|
[int]$total_miss_cuda = $final_sccache_cache_miss_cuda - $script:sccache_cache_miss_cuda
|
|
If ( $total_requests -gt 0 ) {
|
|
[int]$hit_rate_cpp = $total_hits_cpp / $total_requests * 100;
|
|
[int]$hit_rate_cuda = $total_hits_cuda / $total_requests * 100;
|
|
echo "sccache hits cpp: $total_hits_cpp `t| misses: $total_miss_cpp `t| hit rate: $hit_rate_cpp%"
|
|
echo "sccache hits cuda: $total_hits_cuda `t| misses: $total_miss_cuda `t| hit rate: $hit_rate_cuda%"
|
|
} else {
|
|
echo "sccache stats: N/A No new compilation requests"
|
|
}
|
|
}
|
|
}
|
|
|
|
Export-ModuleMember -Function configure_preset, build_preset, test_preset, configure_and_build_preset, sccache_stats
|
|
Export-ModuleMember -Variable BUILD_DIR, CL_VERSION
|