-
Notifications
You must be signed in to change notification settings - Fork 31
Description
The current Ippl master compiles with several warnings (mostly host_device functions calling host only functions). It would be good to fix them (at least most if not all) so that it doesn't get unmanageable. Below I list these warnings, what could be the potential cause and how we can may be fix it.
i)
/p/project1/pepcexa/muralikrishnan1/ippl_11_2025_master/ippl/src/Expression/IpplOperations.h(176): warning #20013-D: calling a constexpr __host__ function("std::__cxx11::basic_string<char, ::std::char_traits<char> , ::std::allocator<char> > ::~basic_string()") from a __host__ __device__ function("ippl::detail::ParticleAttribBase< ::Kokkos::CudaSpace> ::~ParticleAttribBase") is not allowed.
I think this is occurring due to the std::string here https://github.com/IPPL-framework/ippl/blob/master/src/Particle/ParticleAttribBase.h#L71 recently added by @klappi-s for vis. Can we use something else instead of std::string or modify string itself in a way that this warning does not happen?
ii)
warning #20011-D: calling a __host__ function("ippl::FEMVector<double> ::FEMVector(const ippl::FEMVector<double> &)") from a __host__ __device__ function("ippl::Subtract< ::ippl::FEMVector<double> , ::ippl::Multiply< ::ippl::detail::Scalar<double> , ::ippl::FEMVector<double> > > ::Subtract") is not allowed
As the message says FEMVector seems to be host only and all the Multiply, Subtract, Add etc. are host_device. @s-mayani Can we make FEMVector also host_device using Kokkos Macros?
iii) Warning #20208-D: 'long double' is treated as 'double' in device code . I think this is due to https://github.com/IPPL-framework/ippl/blob/master/src/FEM/Quadrature/GaussJacobiQuadrature.h#L31 in FEM. Is really long double needed there @s-mayani ? and if yes are there may be ways to do it in device code not sure.
iv)
/p/project1/pepcexa/muralikrishnan1/ippl_11_2025_master/ippl/src/Expression/IpplOperations.h(177): warning #20013-D: calling a constexpr __host__ function("std::array< ::std::variant< ::ippl::LoggingBufferHandler< ::Kokkos::HostSpace> , ::ippl::LoggingBufferHandler< ::Kokkos::CudaUVMSpace> , ::ippl::LoggingBufferHandler< ::Kokkos::CudaHostPinnedSpace> , ::ippl::LoggingBufferHandler< ::Kokkos::CudaSpace> > , (unsigned long)4ul> ::array(const ::std::array< ::std::variant< ::ippl::LoggingBufferHandler< ::Kokkos::HostSpace> , ::ippl::LoggingBufferHandler< ::Kokkos::CudaUVMSpace> , ::ippl::LoggingBufferHandler< ::Kokkos::CudaHostPinnedSpace> , ::ippl::LoggingBufferHandler< ::Kokkos::CudaSpace> > , (unsigned long)4ul> &)") from a __host__ __device__ function("ippl::detail::MultispaceContainer< ::ippl::LoggingBufferHandler, ::Kokkos::CudaSpace, ::Kokkos::CudaHostPinnedSpace, ::Kokkos::CudaUVMSpace, ::Kokkos::HostSpace > ::MultispaceContainer") is not allowed
This seems to be due to use of std::array which is not host_device but I am not sure exactly where the usage is as it is something to do with MultispaceContainer and may be LoggingBufferHandler