template <typename Number, typename MemorySpaceType = MemorySpace::Host>
void
export_to_ghosted_array_start(
- const unsigned int communication_channel,
- const ArrayView<const Number> &locally_owned_array,
- const ArrayView<Number> & temporary_storage,
- const ArrayView<Number> & ghost_array,
- std::vector<MPI_Request> & requests) const;
+ const unsigned int communication_channel,
+ const ArrayView<const Number, MemorySpaceType> &locally_owned_array,
+ const ArrayView<Number, MemorySpaceType> & temporary_storage,
+ const ArrayView<Number, MemorySpaceType> & ghost_array,
+ std::vector<MPI_Request> & requests) const;
/**
* Finish the exports of the data in a locally owned array to the range
*/
template <typename Number, typename MemorySpaceType = MemorySpace::Host>
void
- export_to_ghosted_array_finish(const ArrayView<Number> & ghost_array,
- std::vector<MPI_Request> &requests) const;
+ export_to_ghosted_array_finish(
+ const ArrayView<Number, MemorySpaceType> &ghost_array,
+ std::vector<MPI_Request> & requests) const;
/**
* Start importing the data on an array indexed by the ghost indices of
template <typename Number, typename MemorySpaceType = MemorySpace::Host>
void
import_from_ghosted_array_start(
- const VectorOperation::values vector_operation,
- const unsigned int communication_channel,
- const ArrayView<Number> & ghost_array,
- const ArrayView<Number> & temporary_storage,
- std::vector<MPI_Request> & requests) const;
+ const VectorOperation::values vector_operation,
+ const unsigned int communication_channel,
+ const ArrayView<Number, MemorySpaceType> &ghost_array,
+ const ArrayView<Number, MemorySpaceType> &temporary_storage,
+ std::vector<MPI_Request> & requests) const;
/**
* Finish importing the data from an array indexed by the ghost
template <typename Number, typename MemorySpaceType = MemorySpace::Host>
void
import_from_ghosted_array_finish(
- const VectorOperation::values vector_operation,
- const ArrayView<const Number> &temporary_storage,
- const ArrayView<Number> & locally_owned_storage,
- const ArrayView<Number> & ghost_array,
- std::vector<MPI_Request> & requests) const;
+ const VectorOperation::values vector_operation,
+ const ArrayView<const Number, MemorySpaceType> &temporary_storage,
+ const ArrayView<Number, MemorySpaceType> & locally_owned_storage,
+ const ArrayView<Number, MemorySpaceType> & ghost_array,
+ std::vector<MPI_Request> & requests) const;
#endif
/**
template <typename Number, typename MemorySpaceType>
void
Partitioner::export_to_ghosted_array_start(
- const unsigned int communication_channel,
- const ArrayView<const Number> &locally_owned_array,
- const ArrayView<Number> & temporary_storage,
- const ArrayView<Number> & ghost_array,
- std::vector<MPI_Request> & requests) const
+ const unsigned int communication_channel,
+ const ArrayView<const Number, MemorySpaceType> &locally_owned_array,
+ const ArrayView<Number, MemorySpaceType> & temporary_storage,
+ const ArrayView<Number, MemorySpaceType> & ghost_array,
+ std::vector<MPI_Request> & requests) const
{
AssertDimension(temporary_storage.size(), n_import_indices());
Assert(ghost_array.size() == n_ghost_indices() ||
template <typename Number, typename MemorySpaceType>
void
Partitioner::export_to_ghosted_array_finish(
- const ArrayView<Number> & ghost_array,
- std::vector<MPI_Request> &requests) const
+ const ArrayView<Number, MemorySpaceType> &ghost_array,
+ std::vector<MPI_Request> & requests) const
{
Assert(ghost_array.size() == n_ghost_indices() ||
ghost_array.size() == n_ghost_indices_in_larger_set,
template <typename Number, typename MemorySpaceType>
void
Partitioner::import_from_ghosted_array_start(
- const VectorOperation::values vector_operation,
- const unsigned int communication_channel,
- const ArrayView<Number> & ghost_array,
- const ArrayView<Number> & temporary_storage,
- std::vector<MPI_Request> & requests) const
+ const VectorOperation::values vector_operation,
+ const unsigned int communication_channel,
+ const ArrayView<Number, MemorySpaceType> &ghost_array,
+ const ArrayView<Number, MemorySpaceType> &temporary_storage,
+ std::vector<MPI_Request> & requests) const
{
AssertDimension(temporary_storage.size(), n_import_indices());
Assert(ghost_array.size() == n_ghost_indices() ||
template <typename Number, typename MemorySpaceType>
void
Partitioner::import_from_ghosted_array_finish(
- const VectorOperation::values vector_operation,
- const ArrayView<const Number> &temporary_storage,
- const ArrayView<Number> & locally_owned_array,
- const ArrayView<Number> & ghost_array,
- std::vector<MPI_Request> & requests) const
+ const VectorOperation::values vector_operation,
+ const ArrayView<const Number, MemorySpaceType> &temporary_storage,
+ const ArrayView<Number, MemorySpaceType> & locally_owned_array,
+ const ArrayView<Number, MemorySpaceType> & ghost_array,
+ std::vector<MPI_Request> & requests) const
{
AssertDimension(temporary_storage.size(), n_import_indices());
Assert(ghost_array.size() == n_ghost_indices() ||
partitioner->import_from_ghosted_array_start(
operation,
counter,
- ArrayView<Number>(data.values.get() + partitioner->local_size(),
- partitioner->n_ghost_indices()),
- ArrayView<Number>(import_data.values.get(),
- partitioner->n_import_indices()),
+ ArrayView<Number, MemorySpace::Host>(data.values.get() +
+ partitioner->local_size(),
+ partitioner->n_ghost_indices()),
+ ArrayView<Number, MemorySpace::Host>(import_data.values.get(),
+ partitioner->n_import_indices()),
compress_requests);
# else
partitioner->import_from_ghosted_array_start(
operation,
counter,
- ArrayView<Number>(data.values_dev.get() + partitioner->local_size(),
- partitioner->n_ghost_indices()),
- ArrayView<Number>(import_data.values_dev.get(),
- partitioner->n_import_indices()),
+ ArrayView<Number, MemorySpace::CUDA>(data.values_dev.get() +
+ partitioner->local_size(),
+ partitioner->n_ghost_indices()),
+ ArrayView<Number, MemorySpace::CUDA>(import_data.values_dev.get(),
+ partitioner->n_import_indices()),
compress_requests);
# endif
#endif
ExcNotInitialized());
partitioner->import_from_ghosted_array_finish<Number, MemorySpace::Host>(
operation,
- ArrayView<const Number>(import_data.values.get(),
- partitioner->n_import_indices()),
- ArrayView<Number>(data.values.get(), partitioner->local_size()),
- ArrayView<Number>(data.values.get() + partitioner->local_size(),
- partitioner->n_ghost_indices()),
+ ArrayView<const Number, MemorySpace::Host>(
+ import_data.values.get(), partitioner->n_import_indices()),
+ ArrayView<Number, MemorySpace::Host>(data.values.get(),
+ partitioner->local_size()),
+ ArrayView<Number, MemorySpace::Host>(data.values.get() +
+ partitioner->local_size(),
+ partitioner->n_ghost_indices()),
compress_requests);
# else
Assert(partitioner->n_import_indices() == 0 ||
ExcNotInitialized());
partitioner->import_from_ghosted_array_finish<Number, MemorySpace::CUDA>(
operation,
- ArrayView<const Number>(import_data.values_dev.get(),
- partitioner->n_import_indices()),
- ArrayView<Number>(data.values_dev.get(), partitioner->local_size()),
- ArrayView<Number>(data.values_dev.get() + partitioner->local_size(),
- partitioner->n_ghost_indices()),
+ ArrayView<const Number, MemorySpace::CUDA>(
+ import_data.values_dev.get(), partitioner->n_import_indices()),
+ ArrayView<Number, MemorySpace::CUDA>(data.values_dev.get(),
+ partitioner->local_size()),
+ ArrayView<Number, MemorySpace::CUDA>(data.values_dev.get() +
+ partitioner->local_size(),
+ partitioner->n_ghost_indices()),
compress_requests);
# endif
# if !(defined(DEAL_II_COMPILER_CUDA_AWARE) && \
defined(DEAL_II_WITH_CUDA_AWARE_MPI))
- partitioner->export_to_ghosted_array_start<Number, MemorySpaceType>(
+ partitioner->export_to_ghosted_array_start<Number, MemorySpace::Host>(
counter,
- ArrayView<const Number>(data.values.get(), partitioner->local_size()),
- ArrayView<Number>(import_data.values.get(),
- partitioner->n_import_indices()),
- ArrayView<Number>(data.values.get() + partitioner->local_size(),
- partitioner->n_ghost_indices()),
+ ArrayView<const Number, MemorySpace::Host>(data.values.get(),
+ partitioner->local_size()),
+ ArrayView<Number, MemorySpace::Host>(import_data.values.get(),
+ partitioner->n_import_indices()),
+ ArrayView<Number, MemorySpace::Host>(data.values.get() +
+ partitioner->local_size(),
+ partitioner->n_ghost_indices()),
update_ghost_values_requests);
# else
- partitioner->export_to_ghosted_array_start<Number, MemorySpaceType>(
+ partitioner->export_to_ghosted_array_start<Number, MemorySpace::CUDA>(
counter,
- ArrayView<const Number>(data.values_dev.get(),
- partitioner->local_size()),
- ArrayView<Number>(import_data.values_dev.get(),
- partitioner->n_import_indices()),
- ArrayView<Number>(data.values_dev.get() + partitioner->local_size(),
- partitioner->n_ghost_indices()),
+ ArrayView<const Number, MemorySpace::CUDA>(data.values_dev.get(),
+ partitioner->local_size()),
+ ArrayView<Number, MemorySpace::CUDA>(import_data.values_dev.get(),
+ partitioner->n_import_indices()),
+ ArrayView<Number, MemorySpace::CUDA>(data.values_dev.get() +
+ partitioner->local_size(),
+ partitioner->n_ghost_indices()),
update_ghost_values_requests);
# endif
# if !(defined(DEAL_II_COMPILER_CUDA_AWARE) && \
defined(DEAL_II_WITH_CUDA_AWARE_MPI))
partitioner->export_to_ghosted_array_finish(
- ArrayView<Number>(data.values.get() + partitioner->local_size(),
- partitioner->n_ghost_indices()),
+ ArrayView<Number, MemorySpace::Host>(
+ data.values.get() + partitioner->local_size(),
+ partitioner->n_ghost_indices()),
update_ghost_values_requests);
# else
partitioner->export_to_ghosted_array_finish(
- ArrayView<Number>(data.values_dev.get() + partitioner->local_size(),
- partitioner->n_ghost_indices()),
+ ArrayView<Number, MemorySpace::CUDA>(
+ data.values_dev.get() + partitioner->local_size(),
+ partitioner->n_ghost_indices()),
update_ghost_values_requests);
# endif
}
for (SCALAR : MPI_SCALARS)
{
#ifdef DEAL_II_WITH_MPI
- template void Utilities::MPI::Partitioner::export_to_ghosted_array_start<
- SCALAR,
- dealii::MemorySpace::CUDA>(const unsigned int,
- const ArrayView<const SCALAR> &,
- const ArrayView<SCALAR> &,
- const ArrayView<SCALAR> &,
- std::vector<MPI_Request> &) const;
-
template void Utilities::MPI::Partitioner::
- export_to_ghosted_array_finish<SCALAR, MemorySpace::CUDA>(
- const ArrayView<SCALAR> &, std::vector<MPI_Request> &) const;
+ export_to_ghosted_array_start<SCALAR, dealii::MemorySpace::CUDA>(
+ const unsigned int,
+ const ArrayView<const SCALAR, MemorySpace::CUDA> &,
+ const ArrayView<SCALAR, MemorySpace::CUDA> &,
+ const ArrayView<SCALAR, MemorySpace::CUDA> &,
+ std::vector<MPI_Request> &) const;
+
+ template void Utilities::MPI::Partitioner::export_to_ghosted_array_finish<
+ SCALAR,
+ MemorySpace::CUDA>(const ArrayView<SCALAR, MemorySpace::CUDA> &,
+ std::vector<MPI_Request> &) const;
template void Utilities::MPI::Partitioner::import_from_ghosted_array_start<
SCALAR,
MemorySpace::CUDA>(const VectorOperation::values,
const unsigned int,
- const ArrayView<SCALAR> &,
- const ArrayView<SCALAR> &,
+ const ArrayView<SCALAR, MemorySpace::CUDA> &,
+ const ArrayView<SCALAR, MemorySpace::CUDA> &,
std::vector<MPI_Request> &) const;
template void Utilities::MPI::Partitioner::import_from_ghosted_array_finish<
SCALAR,
MemorySpace::CUDA>(const VectorOperation::values,
- const ArrayView<const SCALAR> &,
- const ArrayView<SCALAR> &,
- const ArrayView<SCALAR> &,
+ const ArrayView<const SCALAR, MemorySpace::CUDA> &,
+ const ArrayView<SCALAR, MemorySpace::CUDA> &,
+ const ArrayView<SCALAR, MemorySpace::CUDA> &,
std::vector<MPI_Request> &) const;
#endif
}
template void Utilities::MPI::Partitioner::export_to_ghosted_array_start<
SCALAR,
MemorySpace::Host>(const unsigned int,
- const ArrayView<const SCALAR> &,
- const ArrayView<SCALAR> &,
- const ArrayView<SCALAR> &,
+ const ArrayView<const SCALAR, MemorySpace::Host> &,
+ const ArrayView<SCALAR, MemorySpace::Host> &,
+ const ArrayView<SCALAR, MemorySpace::Host> &,
+ std::vector<MPI_Request> &) const;
+ template void Utilities::MPI::Partitioner::export_to_ghosted_array_finish<
+ SCALAR,
+ MemorySpace::Host>(const ArrayView<SCALAR, MemorySpace::Host> &,
std::vector<MPI_Request> &) const;
- template void Utilities::MPI::Partitioner::
- export_to_ghosted_array_finish<SCALAR, MemorySpace::Host>(
- const ArrayView<SCALAR> &, std::vector<MPI_Request> &) const;
template void Utilities::MPI::Partitioner::import_from_ghosted_array_start<
SCALAR,
MemorySpace::Host>(const VectorOperation::values,
const unsigned int,
- const ArrayView<SCALAR> &,
- const ArrayView<SCALAR> &,
+ const ArrayView<SCALAR, MemorySpace::Host> &,
+ const ArrayView<SCALAR, MemorySpace::Host> &,
std::vector<MPI_Request> &) const;
template void Utilities::MPI::Partitioner::import_from_ghosted_array_finish<
SCALAR,
MemorySpace::Host>(const VectorOperation::values,
- const ArrayView<const SCALAR> &,
- const ArrayView<SCALAR> &,
- const ArrayView<SCALAR> &,
+ const ArrayView<const SCALAR, MemorySpace::Host> &,
+ const ArrayView<SCALAR, MemorySpace::Host> &,
+ const ArrayView<SCALAR, MemorySpace::Host> &,
std::vector<MPI_Request> &) const;
#endif
}
template <typename Number>
void
-print_cuda_view(const ArrayView<Number> cuda_view)
+print_cuda_view(const ArrayView<Number, MemorySpace::CUDA> cuda_view)
{
std::vector<Number> cpu_values(cuda_view.size());
Utilities::CUDA::copy_to_host(cuda_view.data(), cpu_values);
nullptr, Utilities::CUDA::delete_device_data<unsigned int>);
locally_owned_data.reset(
Utilities::CUDA::allocate_device_data<unsigned int>(local_size));
- ArrayView<unsigned int> locally_owned_data_view(locally_owned_data.get(),
- local_size);
+ ArrayView<unsigned int, MemorySpace::CUDA> locally_owned_data_view(
+ locally_owned_data.get(), local_size);
Utilities::CUDA::copy_to_dev(cpu_locally_owned_data,
locally_owned_data.get());
nullptr, Utilities::CUDA::delete_device_data<unsigned int>);
ghosts.reset(
Utilities::CUDA::allocate_device_data<unsigned int>(v.n_ghost_indices()));
- ArrayView<unsigned int> ghosts_view(ghosts.get(), v.n_ghost_indices());
+ ArrayView<unsigned int, MemorySpace::CUDA> ghosts_view(ghosts.get(),
+ v.n_ghost_indices());
std::unique_ptr<unsigned int[], void (*)(unsigned int *)> temp_array(
nullptr, Utilities::CUDA::delete_device_data<unsigned int>);
temp_array.reset(
Utilities::CUDA::allocate_device_data<unsigned int>(v.n_import_indices()));
- ArrayView<unsigned int> temp_array_view(temp_array.get(),
- v.n_import_indices());
+ ArrayView<unsigned int, MemorySpace::CUDA> temp_array_view(
+ temp_array.get(), v.n_import_indices());
std::vector<MPI_Request> requests;
AssertCuda(cuda_error);
Assert(temp_array_view.size() >= w.n_import_indices(), ExcInternalError());
- ArrayView<unsigned int> temp_array_view_w(temp_array_view.data(),
- w.n_import_indices());
+ ArrayView<unsigned int, MemorySpace::CUDA> temp_array_view_w(
+ temp_array_view.data(), w.n_import_indices());
w.export_to_ghosted_array_start<unsigned int, MemorySpace::CUDA>(
3, locally_owned_data_view, temp_array_view_w, ghosts_view, requests);
nullptr, Utilities::CUDA::delete_device_data<unsigned int>);
temp_array2.reset(
Utilities::CUDA::allocate_device_data<unsigned int>(x.n_import_indices()));
- ArrayView<unsigned int> temp_array2_view(temp_array2.get(),
- x.n_import_indices());
+ ArrayView<unsigned int, MemorySpace::CUDA> temp_array2_view(
+ temp_array2.get(), x.n_import_indices());
std::unique_ptr<unsigned int[], void (*)(unsigned int *)> ghosts2(
nullptr, Utilities::CUDA::delete_device_data<unsigned int>);
ghosts2.reset(
Utilities::CUDA::allocate_device_data<unsigned int>(x.n_ghost_indices()));
- ArrayView<unsigned int> ghosts2_view(ghosts2.get(), x.n_ghost_indices());
+ ArrayView<unsigned int, MemorySpace::CUDA> ghosts2_view(ghosts2.get(),
+ x.n_ghost_indices());
std::vector<MPI_Request> requests2;
x.export_to_ghosted_array_start<unsigned int, MemorySpace::CUDA>(
AssertCuda(cuda_error);
Assert(temp_array_view.size() >= x.n_import_indices(), ExcInternalError());
- ArrayView<unsigned int> temp_array_view_x(temp_array_view.data(),
- x.n_import_indices());
+ ArrayView<unsigned int, MemorySpace::CUDA> temp_array_view_x(
+ temp_array_view.data(), x.n_import_indices());
x.export_to_ghosted_array_start<unsigned int, MemorySpace::CUDA>(
3, locally_owned_data_view, temp_array_view_x, ghosts_view, requests);
x.export_to_ghosted_array_finish<unsigned int, MemorySpace::CUDA>(ghosts_view,
template <typename Number>
void
-print_cuda_view(const ArrayView<Number> cuda_view)
+print_cuda_view(const ArrayView<Number, MemorySpace::CUDA> cuda_view)
{
std::vector<Number> cpu_values(cuda_view.size());
Utilities::CUDA::copy_to_host(cuda_view.data(), cpu_values);
std::unique_ptr<unsigned int[], void (*)(unsigned int *)> ghost_array(
Utilities::CUDA::allocate_device_data<unsigned int>(cpu_ghost_array.size()),
Utilities::CUDA::delete_device_data<unsigned int>);
- ArrayView<unsigned int> ghost_array_view(ghost_array.get(),
- cpu_ghost_array.size());
+ ArrayView<unsigned int, MemorySpace::CUDA> ghost_array_view(
+ ghost_array.get(), cpu_ghost_array.size());
Utilities::CUDA::copy_to_dev(cpu_ghost_array, ghost_array.get());
// set up other arrays
std::unique_ptr<unsigned int[], void (*)(unsigned int *)> locally_owned_array(
Utilities::CUDA::allocate_device_data<unsigned int>(local_size),
Utilities::CUDA::delete_device_data<unsigned int>);
- ArrayView<unsigned int> locally_owned_array_view(locally_owned_array.get(),
- local_size);
+ ArrayView<unsigned int, MemorySpace::CUDA> locally_owned_array_view(
+ locally_owned_array.get(), local_size);
std::unique_ptr<unsigned int[], void (*)(unsigned int *)> temp_array(
Utilities::CUDA::allocate_device_data<unsigned int>(v.n_import_indices()),
Utilities::CUDA::delete_device_data<unsigned int>);
- ArrayView<unsigned int> temp_array_view(temp_array.get(),
- v.n_import_indices());
+ ArrayView<unsigned int, MemorySpace::CUDA> temp_array_view(
+ temp_array.get(), v.n_import_indices());
std::vector<MPI_Request> requests;
Utilities::CUDA::allocate_device_data<unsigned int>(
ghost_array_view.size()),
Utilities::CUDA::delete_device_data<unsigned int>);
- ArrayView<unsigned int> ghosts_view(ghosts.get(), ghost_array_view.size());
- const cudaError_t cuda_error =
+ ArrayView<unsigned int, MemorySpace::CUDA> ghosts_view(
+ ghosts.get(), ghost_array_view.size());
+ const cudaError_t cuda_error =
cudaMemcpy(ghosts.get(),
ghost_array_view.data(),
ghost_array_view.size() * sizeof(unsigned int),
locally_owned_array_view.size() * sizeof(unsigned int));
AssertCuda(cuda_error);
Assert(temp_array_view.size() >= w.n_import_indices(), ExcInternalError());
- ArrayView<unsigned int> temp_array_view_w(temp_array_view.data(),
- w.n_import_indices());
+ ArrayView<unsigned int, MemorySpace::CUDA> temp_array_view_w(
+ temp_array_view.data(), w.n_import_indices());
{
std::unique_ptr<unsigned int[], void (*)(unsigned int *)> ghosts(
Utilities::CUDA::allocate_device_data<unsigned int>(
ghost_array_view.size()),
Utilities::CUDA::delete_device_data<unsigned int>);
- ArrayView<unsigned int> ghosts_view(ghosts.get(), ghost_array_view.size());
- const cudaError_t cuda_error =
+ ArrayView<unsigned int, MemorySpace::CUDA> ghosts_view(
+ ghosts.get(), ghost_array_view.size());
+ const cudaError_t cuda_error =
cudaMemcpy(ghosts.get(),
ghost_array_view.data(),
ghost_array_view.size() * sizeof(unsigned int),
locally_owned_array_view.size() * sizeof(unsigned int));
AssertCuda(cuda_error);
Assert(temp_array_view.size() >= x.n_import_indices(), ExcInternalError());
- ArrayView<unsigned int> temp_array_view_x(temp_array_view.data(),
- x.n_import_indices());
+ ArrayView<unsigned int, MemorySpace::CUDA> temp_array_view_x(
+ temp_array_view.data(), x.n_import_indices());
{
std::unique_ptr<unsigned int[], void (*)(unsigned int *)> ghosts(
Utilities::CUDA::allocate_device_data<unsigned int>(
ghost_array_view.size()),
Utilities::CUDA::delete_device_data<unsigned int>);
- ArrayView<unsigned int> ghosts_view(ghosts.get(), ghost_array_view.size());
- const cudaError_t cuda_error =
+ ArrayView<unsigned int, MemorySpace::CUDA> ghosts_view(
+ ghosts.get(), ghost_array_view.size());
+ const cudaError_t cuda_error =
cudaMemcpy(ghosts.get(),
ghost_array_view.data(),
ghost_array_view.size() * sizeof(unsigned int),
std::unique_ptr<unsigned int[], void (*)(unsigned int *)> ghosts(
Utilities::CUDA::allocate_device_data<unsigned int>(cpu_ghosts.size()),
Utilities::CUDA::delete_device_data<unsigned int>);
- ArrayView<unsigned int> ghosts_view(ghosts.get(), cpu_ghosts.size());
+ ArrayView<unsigned int, MemorySpace::CUDA> ghosts_view(ghosts.get(),
+ cpu_ghosts.size());
Utilities::CUDA::copy_to_dev(cpu_ghosts, ghosts.get());
x.import_from_ghosted_array_start<unsigned int, MemorySpace::CUDA>(
template <typename Number>
void
-print_cuda_view(const ArrayView<Number> cuda_view)
+print_cuda_view(const ArrayView<Number, MemorySpace::CUDA> cuda_view)
{
std::vector<Number> cpu_values(cuda_view.size());
Utilities::CUDA::copy_to_host(cuda_view.data(), cpu_values);
// create vector
std::vector<Number> cpu_owned(rank == 0 ? 8 : 0);
- for (int i = 0; i < cpu_owned.size(); ++i)
+ for (unsigned int i = 0; i < cpu_owned.size(); ++i)
cpu_owned[i] = i;
std::unique_ptr<Number[], void (*)(Number *)> owned(
Utilities::CUDA::allocate_device_data<Number>(cpu_owned.size()),
Utilities::CUDA::delete_device_data<Number>);
- ArrayView<Number> owned_view(owned.get(), cpu_owned.size());
+ ArrayView<Number, MemorySpace::CUDA> owned_view(owned.get(),
+ cpu_owned.size());
Utilities::CUDA::copy_to_dev(cpu_owned, owned.get());
std::vector<Number> cpu_ghost(4, 0);
std::unique_ptr<Number[], void (*)(Number *)> ghost(
Utilities::CUDA::allocate_device_data<Number>(cpu_ghost.size()),
Utilities::CUDA::delete_device_data<Number>);
- ArrayView<Number> ghost_view(ghost.get(), cpu_ghost.size());
+ ArrayView<Number, MemorySpace::CUDA> ghost_view(ghost.get(),
+ cpu_ghost.size());
Utilities::CUDA::copy_to_dev(cpu_ghost, ghost.get());
// update ghost values
Utilities::CUDA::allocate_device_data<Number>(
tight_partitioner->n_import_indices()),
Utilities::CUDA::delete_device_data<Number>);
- ArrayView<Number> tmp_data_view(tmp_data.get(),
- tight_partitioner->n_import_indices());
+ ArrayView<Number, MemorySpace::CUDA> tmp_data_view(
+ tmp_data.get(), tight_partitioner->n_import_indices());
// begin exchange, and ...
tight_partitioner->export_to_ghosted_array_start<Number, MemorySpace::CUDA>(
Utilities::CUDA::allocate_device_data<Number>(
tight_partitioner->n_import_indices()),
Utilities::CUDA::delete_device_data<Number>);
- ArrayView<Number> import_data_view(tmp_data.get(),
- tight_partitioner->n_import_indices());
+ ArrayView<Number, MemorySpace::CUDA> import_data_view(
+ tmp_data.get(), tight_partitioner->n_import_indices());
// now do insert:
auto compress = [&](VectorOperation::values operation) {