Skip to content

Calling host functions/operators from function with device annotation #174

Open
@pgrete

Description

@pgrete

There are several places in the code where host/device annotation (e.g., through KOKKOS_INLINE_FUNCTION) result in host called that is potentially called from a device, e.g.,

/home/pgrete/src/parthenon/src/mesh/domain.hpp(67): warning: calling a __host__ function("std::array< ::parthenon::IndexRange, (unsigned long)3ul> ::operator []") from a __host__ __device__ function("parthenon::IndexShape::MakeZeroDimensional_") is not allowed

/home/pgrete/src/parthenon/src/mesh/domain.hpp(68): warning: calling a __host__ function("std::array<int, (unsigned long)3ul> ::operator []") from a __host__ __device__ function("parthenon::IndexShape::MakeZeroDimensional_") is not allowed

/home/pgrete/src/parthenon/src/interface/variable_pack.hpp(62): warning: calling a __host__ function from a __host__ __device__ function is not allowed
          detected during instantiation of "int parthenon::VariablePack<T>::GetDim(int) [with T=parthenon::Real]" 
/home/pgrete/src/parthenon/tst/unit/test_container_iterator.cpp(93): here

As far as I can tell this is currently not a problem because we actually never call these function from within a kernel, but this should nevertheless be addressed.
I started to simplify the IndexRange struct in #165 as it caused the majority of warnings.

Anyone, feel free to pick this up (I'm still working on #165 and #136 and want to finish those with high priority).

Metadata

Metadata

Assignees

Labels

KokkosKokkos infrastructure/feature relatedbugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions