Grid icon indicating copy to clipboard operation
Grid copied to clipboard

BlockConjugateGradient.h fails to compile with gcc-9.1.0

Open detar opened this issue 3 years ago • 0 comments

The operator() member calls Lattice_reduction.h - sliceMulMatrix which encounters an ambiguous overload of the operator* in Tensor_arith_scalar.h:

../Grid/install-grid-gpu-cuda/include/Grid/lattice/Lattice_reduction.h: In instantiation of 'void Grid::sl
iceMaddMatrix(Grid::Lattice&, Eigen::MatrixXcd&, const Grid::Lattice&, const Grid::Lattice<vob
j>&, int, Grid::RealD) [with vobj = Grid::iScalar<Grid::iScalar<Grid::iVector<Grid::Grid_simd<thrust::comp
lex, Grid::GpuVector<8, Grid::GpuComplex > >, 3> > >; Eigen::MatrixXcd = Eigen::Matrix<std:
:complex, -1, -1>; Grid::RealD = double]': ../Grid/install-grid-gpu-cuda/include/Grid/algorithms/iterative/BlockConjugateGradient.h:256:16: require
d from 'void Grid::BlockConjugateGradient<Field>::BlockCGrQsolve(Grid::LinearOperatorBase<Field>&, const F
ield&, Field&) [with Field = Grid::Lattice<Grid::iScalar<Grid::iScalar<Grid::iVector<Grid::Grid_simd<thrus
t::complex, Grid::GpuVector<8, Grid::GpuComplex > >, 3> > > >]' ../Grid/install-grid-gpu-cuda/include/Grid/algorithms/iterative/BlockConjugateGradient.h:130:1: required
from 'void Grid::BlockConjugateGradient<Field>::operator()(Grid::LinearOperatorBase<Field>&, const Field&
, Field&) [with Field = Grid::Lattice<Grid::iScalar<Grid::iScalar<Grid::iVector<Grid::Grid_simd<thrust::co
mplex, Grid::GpuVector<8, Grid::GpuComplex > >, 3> > > >]' ../Grid/install-grid-gpu-cuda/include/Grid/algorithms/iterative/BlockConjugateGradient.h:127:6: required
from here ../Grid/install-grid-gpu-cuda/include/Grid/lattice/Lattice_reduction.h:643:315: error: ambiguous overload
for 'operator*' (operand types are '__gnu_cxx::__alloc_traits<Grid::uvmAllocator<Grid::iScalar<Grid::iScal
ar<Grid::iVector<Grid::Grid_simd<thrust::complex, Grid::GpuVector<8, Grid::GpuComplex > >,
3> > > >, Grid::iScalar<Grid::iScalar<Grid::iVector<Grid::Grid_simd<thrust::complex, Grid::GpuVecto
r<8, Grid::GpuComplex > >, 3> > > >::value_type' {aka 'Grid::iScalar<Grid::iScalar<Grid::iVector<G
rid::Grid_simd<thrust::complex, Grid::GpuVector<8, Grid::GpuComplex > >, 3> > >'} and 'std:
:complex') 643 | thread_for_collapse_in_region(2, n,nblock, { |


^ ../Grid/install-grid-gpu-cuda/include/Grid/tensors/Tensor_arith_scalar.h:39:40: note: candidate: 'Grid::iS
calar<T> Grid::operator*(const Grid::iScalar<T>&, typename Grid::iScalar<T>::scalar_type) [with l = Grid::
iScalar<Grid::iVector<Grid::Grid_simd<thrust::complex, Grid::GpuVector<8, Grid::GpuComplex \

, 3> >; typename Grid::iScalar<T>::scalar_type = thrust::complex]' 39 | template accelerator_inline iScalar operator * (const iScalar& lhs,const typename i
Scalar::scalar_type rhs) | ^~~~~~~~ ../Grid/install-grid-gpu-cuda/include/Grid/tensors/Tensor_arith_scalar.h:113:1: note: candidate: 'Grid::iS
calar<T> Grid::operator*(const Grid::iScalar<T>&, Grid::ComplexD) [with l = Grid::iScalar<Grid::iVector<Gr
id::Grid_simd<thrust::complex, Grid::GpuVector<8, Grid::GpuComplex > >, 3> >; typename std:
:enable_if<(! std::is_same<typename Grid::iScalar<T>::scalar_type, thrust::complex >::value), int>
::type = 0; Grid::ComplexD = thrust::complex]' 113 | accelerator_inline iScalar operator * (const iScalar& lhs,ComplexD rhs) | ^~~~~~~~

detar avatar Oct 20 '21 21:10 detar