Tpetra: does FixedHashTable need to inherit from Teuchos::Describable?
Created by: aprokop
@trilinos/tpetra @dalg24
The following code
// Given Node
using DeviceType = typename Node::device_type;
using ExecutionSpace = typename DeviceType::execution_space;
RCP<Tpetra::Map<int,int,Node> > map = /* some map setup */;
Kokkos::View<int *, DeviceType> global_indices( "indices", n );
Kokkos::View<int *, DeviceType> indices( "indices" ); // some indices we set up
auto local_map = map->getLocalMap();
Kokkos::parallel_for(
Kokkos::RangePolicy<ExecutionSpace>( 0, n ),
KOKKOS_LAMBDA( int i ) {
global_indices( i ) = local_map.getGlobalElement( indices( i ) );
} );
Kokkos::fence();
produces a warning for CUDA:
warning: calling a __host__ function("Teuchos::Describable::~Describable [subobject]") from a __host__ __device__ function("Tpetra::Details::FixedHashTable<int, int, ::Kokkos::Device< ::Kokkos::Serial, ::Kokkos::HostSpace> > ::~FixedHashTable [subobject]") is not allowed
The problem seems to be that copying LocalMap
to the device is not correct, as it has FixedHashTable
inside it which inherits from Teuchos::Describable
(that one also inherits from Teuchos::LabeledObject
which even has std::string
inside).
The question is: what is the best way to deal with it? It seems to me that you need to remove Describable
from being a base class for FixedHashTable
.