Hello all,
I am struggling with nvlink error (no issue with the crayCC compiler):
nvlink error : Multiple definition of ‘nvkernel__ZN10TRUSTArrayIdEaSEd_F383L576_1’ in ‘/export/home/catA/pl254994/trust/amgx_openmp/lib/TRUST_mpi.a:distances_EF.cpp.o’, first defined in ‘/export/home/catA/pl254994/trust/amgx_openmp/lib/TRUST_mpi.a:Domaine_EF_axi.cpp.o’
nvlink fatal : merge_elf failed
pgacclnk: child process exit status 2: /export/home/catA/pl254994/.tmp_TRUST_trust/nvhpc-22.1/Linux_x86_64/22.1/compilers/bin/tools/nvdd
The related code is:
#pragma omp declare target
template <typename _TYPE_>
TRUSTArray<_TYPE_>& TRUSTArray<_TYPE_>::operator=(_TYPE_ x)
{
const int n = size_array_;
_TYPE_ *data = data_;
#ifdef _OPENMP
bool dataOnDevice = isDataOnDevice(*this);
#pragma omp target teams distribute parallel for if (dataOnDevice)
#endif
for (int i = 0; i < n; i++) data[i] = x;
return *this;
}
#pragma omp end declare target
How can I avoid the kernel is defined multiple times ?
Thanks