Skip to content

Commit 6964f90

Browse files
Merge pull request #1485 from lattice/hotfix/ccomplex
Hotfix/ccomplex
2 parents 77a0be0 + 2bef92c commit 6964f90

File tree

8 files changed

+30
-16
lines changed

8 files changed

+30
-16
lines changed

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,15 @@ if(QUDA_DOWNLOAD_EIGEN)
425425
SYSTEM YES)
426426
target_include_directories(Eigen SYSTEM INTERFACE ${Eigen_SOURCE_DIR})
427427
install(DIRECTORY ${Eigen_SOURCE_DIR}/Eigen TYPE INCLUDE)
428+
429+
# Eigen 3.4 needs to be patched on Neon with nvc++
430+
if (${CMAKE_CXX_COMPILER_ID} MATCHES "NVHPC")
431+
set(CMAKE_PATCH_EIGEN OFF CACHE BOOL "Internal use only; do not modify")
432+
if (NOT CMAKE_PATCH_EIGEN)
433+
execute_process(COMMAND patch -N "${Eigen_SOURCE_DIR}/Eigen/src/Core/arch/NEON/Complex.h" "${CMAKE_SOURCE_DIR}/cmake/eigen34_neon.diff")
434+
set(CMAKE_PATCH_EIGEN ON CACHE BOOL "Internal use only; do not modify" FORCE)
435+
endif()
436+
endif()
428437
else()
429438
# fall back to using find_package
430439
find_package(Eigen QUIET)

cmake/eigen34_neon.diff

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
21c21
2+
< #if EIGEN_COMP_CLANG || EIGEN_COMP_CASTXML
3+
---
4+
> #if EIGEN_COMP_CLANG || EIGEN_COMP_CASTXML || __NVCOMPILER_LLVM__
5+
393c393
6+
< #if EIGEN_COMP_CLANG || EIGEN_COMP_CASTXML
7+
---
8+
> #if EIGEN_COMP_CLANG || EIGEN_COMP_CASTXML || __NVCOMPILER_LLVM__

include/kernels/spinor_dilute.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace quda {
2929
static constexpr int nColor = nColor_;
3030
static constexpr QudaDilutionType type = type_;
3131
static constexpr int max_dilution_size = get_size<nSpin, nColor>(type);
32-
using V = typename colorspinor_mapper<store_t, nSpin, nColor>::type;
32+
using V = typename colorspinor_mapper<store_t, nSpin, nColor, false, false, true>::type;
3333
int dilution_size;
3434
V v[max_dilution_size];
3535
V src;

lib/communicator_stack.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,20 @@ namespace quda
2727
static Communicator &get_default_communicator()
2828
{
2929
auto search = communicator_stack.find(default_comm_key);
30-
if (search == communicator_stack.end()) { errorQuda("Default communicator can't be found."); }
30+
if (search == communicator_stack.end()) {
31+
fprintf(getOutputFile(), "Default communicator can't be found\n");
32+
comm_abort(1);
33+
}
3134
return search->second;
3235
}
3336

3437
Communicator &get_current_communicator()
3538
{
3639
auto search = communicator_stack.find(current_key);
37-
if (search == communicator_stack.end()) { errorQuda("Current communicator can't be found."); }
40+
if (search == communicator_stack.end()) {
41+
fprintf(getOutputFile(), "Current communicator can't be found\n");
42+
comm_abort(1);
43+
}
3844
return search->second;
3945
}
4046

lib/interface_quda.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include <cstring>
55
#include <iostream>
66
#include <sys/time.h>
7-
#include <complex.h>
87

98
#include <quda.h>
109
#include <quda_internal.h>

lib/spinor_dilute.in.cu

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,7 @@ namespace quda
8787
const lat_dim_t &local_block, IntList<Nc, N...>)
8888
{
8989
if (src.Ncolor() == Nc) {
90-
if constexpr (Nc <= 32) {
91-
SpinorDilute<real, Ns, Nc>(src, v, type, local_block);
92-
} else {
93-
errorQuda(
94-
"nColor = %d is too large to compile, see QUDA issue #1422 (https://github.com/lattice/quda/issues/1422)",
95-
src.Ncolor());
96-
}
90+
SpinorDilute<real, Ns, Nc>(src, v, type, local_block);
9791
} else {
9892
if constexpr (sizeof...(N) > 0)
9993
spinorDilute<real, Ns>(src, v, type, local_block, IntList<N...>());

lib/targets/cuda/blas_lapack_cublas.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#include <complex.h>
21
#include <blas_lapack.h>
32
#include <timer.h>
43
#ifdef NATIVE_LAPACK_LIB

tests/staggered_eigensolve_test_gtest.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ bool skip_test(test_t test_param)
6565
case QUDA_EIG_IR_ARNOLDI:
6666
// if (spectrum == QUDA_SPECTRUM_LI_EIG || spectrum == QUDA_SPECTRUM_SI_EIG) return true;
6767
return true; // we skip this because it takes an unnecessarily long time and it's covered elsewhere
68-
break;
69-
default: return true; break;
68+
default: return true;
7069
}
7170
} else if (combo_solve_type == QUDA_DIRECT_SOLVE) {
7271
// mat
@@ -94,10 +93,10 @@ bool skip_test(test_t test_param)
9493
case QUDA_EIG_IR_ARNOLDI:
9594
if (spectrum == QUDA_SPECTRUM_LI_EIG || spectrum == QUDA_SPECTRUM_SI_EIG) return true;
9695
break;
97-
default: return true; break;
96+
default: return true;
9897
}
9998
break;
100-
default: return true; break;
99+
default: return true;
101100
}
102101
}
103102
return false;

0 commit comments

Comments
 (0)