mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
GPU: Raise CUDA/HIP minimum and remove legacy guards
- Raise CUDA minimum from 9.0 to 11.4 (sm_70/Volta).
- Raise HIP minimum to GFX906 (Vega 20/MI50) / ROCm 5.6.
- Remove EIGEN_HAS_{CUDA,HIP,GPU}_FP16 guards — FP16 is always available
on sm_70+ and GFX906+.
- Remove obsolete __HIP_ARCH_HAS_* preprocessor branches.
- C++14 cleanup: remove pre-C++14 workarounds in GPU code.
- Fix NVCC warnings (deprecated register keyword, unreachable code,
tautological comparisons).
- Fix HIP test execution on gfx1151.
- Update CI configuration for new minimum versions.
This commit is contained in:
40
test/main.h
40
test/main.h
@@ -76,10 +76,8 @@
|
||||
#include <cuda.h>
|
||||
#include <cuda_runtime.h>
|
||||
#include <cuda_runtime_api.h>
|
||||
#if CUDA_VERSION >= 7050
|
||||
#include <cuda_fp16.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(EIGEN_CUDACC) || defined(EIGEN_HIPCC)
|
||||
#define EIGEN_TEST_NO_LONGDOUBLE
|
||||
@@ -949,6 +947,37 @@ inline void set_seed_from_time() {
|
||||
g_seed = static_cast<decltype(g_seed)>(ns);
|
||||
}
|
||||
|
||||
#if defined(EIGEN_USE_GPU)
|
||||
inline int maybe_skip_gpu_tests() {
|
||||
#if defined(EIGEN_USE_HIP)
|
||||
int device_count = 0;
|
||||
hipError_t status = hipGetDeviceCount(&device_count);
|
||||
if (status != hipSuccess) {
|
||||
std::cout << "SKIP: HIP GPU tests require a visible ROCm device. hipGetDeviceCount failed with: "
|
||||
<< hipGetErrorString(status) << std::endl;
|
||||
return 77;
|
||||
}
|
||||
if (device_count <= 0) {
|
||||
std::cout << "SKIP: HIP GPU tests require a visible ROCm device." << std::endl;
|
||||
return 77;
|
||||
}
|
||||
#elif defined(EIGEN_CUDACC)
|
||||
int device_count = 0;
|
||||
cudaError_t status = cudaGetDeviceCount(&device_count);
|
||||
if (status != cudaSuccess) {
|
||||
std::cout << "SKIP: CUDA GPU tests require a visible CUDA device. cudaGetDeviceCount failed with: "
|
||||
<< cudaGetErrorString(status) << std::endl;
|
||||
return 77;
|
||||
}
|
||||
if (device_count <= 0) {
|
||||
std::cout << "SKIP: CUDA GPU tests require a visible CUDA device." << std::endl;
|
||||
return 77;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
g_has_set_repeat = false;
|
||||
g_has_set_seed = false;
|
||||
@@ -997,6 +1026,13 @@ int main(int argc, char* argv[]) {
|
||||
srand(g_seed);
|
||||
std::cout << "Repeating each test " << g_repeat << " times" << std::endl;
|
||||
|
||||
#if defined(EIGEN_USE_GPU)
|
||||
{
|
||||
const int skip_code = maybe_skip_gpu_tests();
|
||||
if (skip_code != 0) return skip_code;
|
||||
}
|
||||
#endif
|
||||
|
||||
VERIFY(EigenTest::all().size() > 0);
|
||||
|
||||
for (std::size_t i = 0; i < EigenTest::all().size(); ++i) {
|
||||
|
||||
Reference in New Issue
Block a user