Sacado: mpl::for_each for host only
Created by: rppawlo
@etphipp - The sacado::mpl::for_each function is tagged with the KOKKOS_FORCEINLINE_FUNCTION. This means that when compiling for cuda, every function called within that for_each operator must also be tagged the same. Otherwise we see massive compiler warnings like the one below on cuda builds. It's really not feasible to tag every method of every object (including ctors) to compile for device too. I started down this path but then realized I would have to add this to every phalanx object (field, tag, layout) and then go all the way to the Teuchos::RCP and add KOKKOS_FORCEINLINE_FUNCTION to the RCP ctors.
Could you provide a second version of this mpl function that is host only? Maybe sacado::mpl::for_each_host? Is there a better way to do this?
/ascldap/users/rppawlo/Trilinos/packages/sacado/src/mpl/Sacado_mpl_for_each.hpp(51): warning: calling a __host__ function from a __host__ __device__ function is not allowed
detected during:
instantiation of "Sacado::mpl::for_each<Seq, Iter1, Iter2>::for_each(const Op &) [with Seq=Sacado::mpl::vector<double>, Iter1=Sacado::mpl::vector_iterator<Sacado::mpl::vector<double>, 0>, Iter2=Sacado::mpl::vector_iterator<Sacado::mpl::vector<double>, 1>, Op=PHX::KokkosViewFactoryFunctor<PHX::MyTraits::Residual>]"
/ascldap/users/rppawlo/Trilinos/packages/phalanx/src/Phalanx_EvaluationContainer_Def.hpp(138): here
instantiation of "void PHX::EvaluationContainer<EvalT, Traits>::postRegistrationSetup(Traits::SetupData, PHX::FieldManager<Traits> &) [with EvalT=PHX::MyTraits::Residual, Traits=PHX::MyTraits]"
/ascldap/users/rppawlo/Trilinos/packages/phalanx/src/Phalanx_EvaluationContainer_Def.hpp(63): here
instantiation of "PHX::EvaluationContainer<EvalT, Traits>::EvaluationContainer() [with EvalT=PHX::MyTraits::Residual, Traits=PHX::MyTraits]"
/ascldap/users/rppawlo/Trilinos/packages/phalanx/src/Phalanx_EvaluationContainer_TemplateBuilder.hpp(61): here
instantiation of "Teuchos::RCP<PHX::EvaluationContainerBase<Traits>> PHX::EvaluationContainer_TemplateBuilder<Traits>::build<ScalarT>() const [with Traits=PHX::MyTraits, ScalarT=PHX::MyTraits::Residual]"
/ascldap/users/rppawlo/Trilinos/packages/phalanx/src/Phalanx_TemplateManager.hpp(110): here
instantiation of "void PHX::TemplateManager<TypeSeq, BaseT, ObjectT>::BuildObject<BuilderOpT>::operator()(T) const [with TypeSeq=PHX::MyTraits::EvalTypes, BaseT=PHX::EvaluationContainerBase<PHX::MyTraits>, ObjectT=PHX::EvaluationContainer<Sacado::mpl::placeholders::_, PHX::MyTraits>, BuilderOpT=PHX::EvaluationContainer_TemplateBuilder<PHX::MyTraits>, T=PHX::MyTraits::Residual]"
(51): here
instantiation of "Sacado::mpl::for_each<Seq, Iter1, Iter2>::for_each(const Op &) [with Seq=PHX::MyTraits::EvalTypes, Iter1=Sacado::mpl::vector_iterator<PHX::MyTraits::EvalTypes, 0>, Iter2=Sacado::mpl::vector_iterator<PHX::MyTraits::EvalTypes, 1>, Op=PHX::TemplateManager<PHX::MyTraits::EvalTypes, PHX::EvaluationContainerBase<PHX::MyTraits>, PHX::EvaluationContainer<Sacado::mpl::placeholders::_, PHX::MyTraits>>::BuildObject<PHX::EvaluationContainer_TemplateBuilder<PHX::MyTraits>>]"
/ascldap/users/rppawlo/Trilinos/packages/phalanx/src/Phalanx_TemplateManager_Def.hpp(68): here
instantiation of "void PHX::TemplateManager<TypeSeq, BaseT, ObjectT>::buildObjects(const BuilderOpT &) [with TypeSeq=PHX::MyTraits::EvalTypes, BaseT=PHX::EvaluationContainerBase<PHX::MyTraits>, ObjectT=PHX::EvaluationContainer<Sacado::mpl::placeholders::_, PHX::MyTraits>, BuilderOpT=PHX::EvaluationContainer_TemplateBuilder<PHX::MyTraits>]"
/ascldap/users/rppawlo/Trilinos/packages/phalanx/src/Phalanx_FieldManager_Def.hpp(64): here
instantiation of "PHX::FieldManager<Traits>::FieldManager() [with Traits=PHX::MyTraits]"
/ascldap/users/rppawlo/Trilinos/packages/phalanx/test/AliasedFields/AliasedFieldsTest.cpp(85): here