message: ENH: avoid GPU pagefaults in BVH::find()
  Avoid GPU page faults and relying on unified memory to compute
  the total number of candidates in the BVH::find() algorithm.
  Use RAJA sum reduction variable instead.
  Resolves
diff: @@ -478,6 +478,10 @@ void BVH< NDIMS, ExecSpace, FloatType >::find( IndexType* offsets,
  SLIC_ASSERT( inner_nodes != nullptr );
  SLIC_ASSERT( leaf_nodes != nullptr );
  + using reduce_policy =
  + typename axom::execution_space< ExecSpace >::reduce_policy;
  + RAJA::ReduceSum< reduce_policy, IndexType > total_count( 0 );
  +
  for_all< ExecSpace >( numPts, AXOM_LAMBDA(IndexType i)
  {
  int32 count = 0;
  @@ -544,6 +548,7 @@ void BVH< NDIMS, ExecSpace, FloatType >::find( IndexType* offsets,
  } // while
  counts[ i ] = count;
  + total_count += count;
  } );
  @@ -551,9 +556,7 @@ void BVH< NDIMS, ExecSpace, FloatType >::find( IndexType* offsets,
  RAJA::exclusive_scan< exec_policy >(
  counts, counts+numPts, offsets, RAJA::operators::plus<IndexType>{} );
  - // TODO: this will segault with raw(unmanaged) cuda pointers
  - IndexType total_candidates = offsets[numPts-1] + counts[numPts - 1];
  -
  + IndexType total_candidates = static_cast< IndexType >( total_count.get() );
  candidates = axom::allocate< IndexType >( total_candidates);
  // STEP 2: fill in candidates for each point
  @@ -658,6 +661,11 @@ void BVH< NDIMS, ExecSpace, FloatType >::find( IndexType* offsets,
  SLIC_ASSERT( leaf_nodes != nullptr );
  using vec4_t = internal::linear_bvh::Vec< FloatType, 4 >;
  +
  + using reduce_policy =
  + typename axom::execution_space< ExecSpace >::reduce_policy;
  + RAJA::ReduceSum< reduce_policy, IndexType > total_count( 0 );
  +
  for_all< ExecSpace >( numPts, AXOM_LAMBDA (IndexType i)
  {
  int32 count = 0;
  @@ -723,6 +731,7 @@ void BVH< NDIMS, ExecSpace, FloatType >::find( IndexType* offsets,
  } // while
  counts[ i ] = count;
  + total_count += count;
  } );
  @@ -730,8 +739,7 @@ void BVH< NDIMS, ExecSpace, FloatType >::find( IndexType* offsets,
  RAJA::exclusive_scan< exec_policy >(
  counts, counts+numPts, offsets, RAJA::operators::plus<IndexType>{} );
  - // TODO: this will segault with raw(unmanaged) cuda pointers
  - IndexType total_candidates = offsets[numPts-1] + counts[numPts - 1];
  + IndexType total_candidates = static_cast< IndexType >( total_count.get() );
  candidates = axom::allocate< IndexType >( total_candidates);
  