-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revamp testing for cross-compilation validation
Make sure packages built with cross-compilation can still be tested on their target architecture afterwards.
- Loading branch information
Showing
4 changed files
with
92 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@echo on | ||
|
||
nvcc --version | ||
if errorlevel 1 exit 1 | ||
|
||
|
||
cl /Tp test.cpp /link /LIBPATH:"%CONDA_PREFIX%\Library\lib" cudart_static.lib /out:test_nvcc.exe | ||
if errorlevel 1 exit 1 | ||
|
||
nvcc --verbose test.cu | ||
if errorlevel 1 exit 1 | ||
|
||
|
||
cmake %CMAKE_ARGS% -S . -B ./build -G=Ninja | ||
if errorlevel 1 exit 1 | ||
|
||
cmake --build ./build -v | ||
if errorlevel 1 exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/bin/bash | ||
set -e | ||
set -x | ||
|
||
kernel_name="$(uname -s)" | ||
if [[ "${kernel_name}" != "Linux" ]] | ||
then | ||
echo "Unknown OS. Expected Linux, but found ${kernel_name}" | ||
exit 1 | ||
fi | ||
|
||
processor_name="$(uname -m)" | ||
case "${processor_name}" in | ||
"x86_64") test_platform="linux-64" ;; | ||
"aarch64") test_platform="linux-aarch64" ;; | ||
"ppc64le") test_platform="linux-ppc64le" ;; | ||
*) echo "Unknown architecture: ${processor_name}" && exit 1 ;; | ||
esac | ||
|
||
if [[ "${test_platform}" != "${target_platform}" ]] | ||
then | ||
echo "Skipping NVCC testing as current platform is ${test_platform}, whereas; NVCC is built for ${target_platform}." | ||
exit 0 | ||
fi | ||
|
||
cmake_version=$(cmake --version | grep version | awk '{print $3}') | ||
|
||
nvcc --version | ||
|
||
$CXX --verbose ${CXXFLAGS} -lcuda -lcudart_static test.cpp | ||
|
||
nvcc --verbose test.cu | ||
|
||
cmake ${CMAKE_ARGS} -S . -B ./build -G=Ninja | ||
cmake --build ./build -v | ||
|
||
if [[ "${target_platform}" == "linux-ppc64le" ]] | ||
then | ||
echo "Skipping CMake tests on ${target_platform} due to known issues." | ||
exit 0 | ||
fi | ||
|
||
mkdir -p cmake-tests | ||
git clone -b v${cmake_version} --depth 1 https://gitlab.kitware.com/cmake/cmake.git cmake-tests | ||
cmake -S cmake-tests -B cmake-tests/build -DCMake_TEST_HOST_CMAKE=ON -DCMake_TEST_CUDA=nvcc -G "Ninja" | ||
cd cmake-tests/build | ||
|
||
# Test exclusion list: | ||
# Requires cublas | ||
# Cuda.ProperDeviceLibraries | ||
# | ||
# Requires curand | ||
# *SharedRuntime* | ||
# | ||
# Requires execution on a machine with a CUDA GPU | ||
# Cuda.ObjectLibrary | ||
# Cuda.WithC | ||
# Cuda.StubRPATH | ||
# CudaOnly.ArchSpecial | ||
# CudaOnly.GPUDebugFlag | ||
# CudaOnly.SeparateCompilationPTX | ||
# CudaOnly.WithDefs | ||
# CudaOnly.CUBIN | ||
# CudaOnly.Fatbin | ||
# CudaOnly.OptixIR | ||
# RunCMake.CUDA_architectures | ||
# *Toolkit* | ||
# Failing due to undefined symbol: __libc_dl_error_tsd, version GLIBC_PRIVATE | ||
# Cuda.Complex | ||
CUDAHOSTCXX=$CXX ctest -L CUDA --output-on-failure -j $(nproc) -E "(ProperDeviceLibraries|SharedRuntime|ObjectLibrary|WithC|StubRPATH|ArchSpecial|GPUDebugFlag|SeparateCompilationPTX|WithDefs|CUBIN|Fatbin|OptixIR|CUDA_architectures|Toolkit|Cuda.Complex)" |