From b8f8c3000e382e13930de8f379d7e5459975c96c Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Fri, 31 Mar 2023 17:28:05 -0400 Subject: [PATCH] Clean up notions of CUDA in the codebase --- include/deal.II/base/memory_space.h | 4 +- include/deal.II/base/numbers.h | 4 +- include/deal.II/base/partitioner.templates.h | 2 - include/deal.II/base/point.h | 36 ++++---- include/deal.II/base/tensor.h | 80 +++++++++--------- .../lac/affine_constraints.templates.h | 1 - include/deal.II/lac/la_parallel_vector.h | 84 +++++++++---------- .../lac/la_parallel_vector.templates.h | 2 - include/deal.II/lac/precondition.h | 4 +- include/deal.II/lac/trilinos_tpetra_vector.h | 12 ++- .../deal.II/lac/vector_operations_internal.h | 2 - 11 files changed, 107 insertions(+), 124 deletions(-) diff --git a/include/deal.II/base/memory_space.h b/include/deal.II/base/memory_space.h index 91c87d9f8f..a749e66d56 100644 --- a/include/deal.II/base/memory_space.h +++ b/include/deal.II/base/memory_space.h @@ -46,12 +46,12 @@ namespace MemorySpace using kokkos_space = ::Kokkos::DefaultExecutionSpace::memory_space; }; +#ifdef DEAL_II_WITH_CUDA /** * Structure describing CUDA memory space. */ - // FIXME Only enable if CUDA is enabled in deal.II. using CUDA = Default; - +#endif } // namespace MemorySpace DEAL_II_NAMESPACE_CLOSE diff --git a/include/deal.II/base/numbers.h b/include/deal.II/base/numbers.h index 4057bcd1b4..4dcbaa426c 100644 --- a/include/deal.II/base/numbers.h +++ b/include/deal.II/base/numbers.h @@ -450,7 +450,7 @@ namespace numbers * template is selected if number is not a complex data type, this * function simply returns the given number. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ static constexpr DEAL_II_HOST_DEVICE const number & conjugate(const number &x); @@ -460,7 +460,7 @@ namespace numbers * general template is chosen for types not equal to std::complex, this * function simply returns the square of the given number. * - * @note If the template type can be used in CUDA device code, the same holds true + * @note If the template type can be used in device code, the same holds true * for this function. */ static constexpr DEAL_II_HOST_DEVICE real_type diff --git a/include/deal.II/base/partitioner.templates.h b/include/deal.II/base/partitioner.templates.h index 3732ce92cb..9e9673bac7 100644 --- a/include/deal.II/base/partitioner.templates.h +++ b/include/deal.II/base/partitioner.templates.h @@ -18,11 +18,9 @@ #include -#include #include #include -#include #include #include diff --git a/include/deal.II/base/point.h b/include/deal.II/base/point.h index ed984aaa93..7e996b7294 100644 --- a/include/deal.II/base/point.h +++ b/include/deal.II/base/point.h @@ -113,7 +113,7 @@ public: * Standard constructor. Creates an object that corresponds to the origin, * i.e., all coordinates are set to zero. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ DEAL_II_HOST_DEVICE Point(); @@ -130,7 +130,7 @@ public: * dim!=1 as it would leave some components of the point * coordinates uninitialized. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ explicit DEAL_II_HOST_DEVICE Point(const Number x); @@ -142,7 +142,7 @@ public: * coordinates uninitialized (if dim>2) or would not use some arguments (if * dim<2). * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ DEAL_II_HOST_DEVICE Point(const Number x, const Number y); @@ -154,7 +154,7 @@ public: * point coordinates uninitialized (if dim>3) or would not use some * arguments (if dim<3). * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ DEAL_II_HOST_DEVICE Point(const Number x, const Number y, const Number z); @@ -172,7 +172,7 @@ public: * that is zero in all coordinates except for a single 1 in the ith * coordinate. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ static DEAL_II_HOST_DEVICE Point unit_vector(const unsigned int i); @@ -180,7 +180,7 @@ public: /** * Read access to the indexth coordinate. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ DEAL_II_HOST_DEVICE Number operator()(const unsigned int index) const; @@ -188,7 +188,7 @@ public: /** * Read and write access to the indexth coordinate. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ DEAL_II_HOST_DEVICE Number & operator()(const unsigned int index); @@ -210,7 +210,7 @@ public: /** * Add an offset given as Tensor<1,dim,Number> to a point. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ DEAL_II_HOST_DEVICE Point operator+(const Tensor<1, dim, Number> &) const; @@ -222,7 +222,7 @@ public: * origin) and, consequently, the result is returned as a Tensor@<1,dim@> * rather than as a Point@. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ DEAL_II_HOST_DEVICE Tensor<1, dim, Number> operator-(const Point &) const; @@ -233,7 +233,7 @@ public: * documentation of this class, the result is then naturally returned as a * Point@ object rather than as a Tensor@<1,dim@>. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ DEAL_II_HOST_DEVICE Point operator-(const Tensor<1, dim, Number> &) const; @@ -241,7 +241,7 @@ public: /** * The opposite vector. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ DEAL_II_HOST_DEVICE Point operator-() const; @@ -258,7 +258,7 @@ public: /** * Multiply the current point by a factor. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. * * @relatesalso EnableIfScalar */ @@ -272,7 +272,7 @@ public: /** * Divide the current point by a factor. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ template DEAL_II_HOST_DEVICE Point< @@ -284,7 +284,7 @@ public: /** * Return the scalar product of the vectors representing two points. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ DEAL_II_HOST_DEVICE Number operator*(const Tensor<1, dim, Number> &p) const; @@ -299,7 +299,7 @@ public: * Tensor::norm_square() which returns the square of the * Frobenius norm. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ DEAL_II_HOST_DEVICE typename numbers::NumberTraits::real_type square() const; @@ -309,7 +309,7 @@ public: * p, i.e. the $l_2$ norm of the difference between the * vectors representing the two points. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ DEAL_II_HOST_DEVICE typename numbers::NumberTraits::real_type distance(const Point &p) const; @@ -318,7 +318,7 @@ public: * Return the squared Euclidean distance of this point to the point * p. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ DEAL_II_HOST_DEVICE typename numbers::NumberTraits::real_type distance_square(const Point &p) const; @@ -648,7 +648,7 @@ inline void Point::serialize(Archive &ar, const unsigned int) /** * Global operator scaling a point vector by a scalar. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. * * @relates Point */ diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index 1750f8b42d..b09d19f5cc 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -141,7 +141,7 @@ public: /** * Constructor. Set to zero. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ constexpr DEAL_II_HOST_DEVICE Tensor(); @@ -151,7 +151,7 @@ public: * obviously requires that the @p OtherNumber type is convertible to @p * Number. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ template constexpr DEAL_II_HOST_DEVICE @@ -160,7 +160,7 @@ public: /** * Constructor, where the data is copied from a C-style array. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ template constexpr DEAL_II_HOST_DEVICE @@ -236,7 +236,7 @@ public: * This is the non-const conversion operator that returns a writable * reference. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ constexpr DEAL_II_HOST_DEVICE operator Number &(); @@ -247,7 +247,7 @@ public: * * This is the const conversion operator that returns a read-only reference. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ constexpr DEAL_II_HOST_DEVICE operator const Number &() const; @@ -256,7 +256,7 @@ public: * obviously requires that the @p OtherNumber type is convertible to @p * Number. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ template constexpr DEAL_II_HOST_DEVICE Tensor & @@ -269,7 +269,7 @@ public: * copy constructor for Sacado::Rad::ADvar types automatically. * See https://github.com/dealii/dealii/pull/5865. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ constexpr DEAL_II_HOST_DEVICE Tensor & operator=(const Tensor<0, dim, Number> &rhs); @@ -287,7 +287,7 @@ public: * This operator assigns a scalar to a tensor. This obviously requires * that the @p OtherNumber type is convertible to @p Number. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ template constexpr DEAL_II_HOST_DEVICE Tensor & @@ -319,7 +319,7 @@ public: /** * Add another scalar. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ template constexpr DEAL_II_HOST_DEVICE Tensor & @@ -328,7 +328,7 @@ public: /** * Subtract another scalar. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ template constexpr DEAL_II_HOST_DEVICE Tensor & @@ -337,7 +337,7 @@ public: /** * Multiply the scalar with a factor. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ template constexpr DEAL_II_HOST_DEVICE Tensor & @@ -346,7 +346,7 @@ public: /** * Divide the scalar by factor. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ template constexpr DEAL_II_HOST_DEVICE Tensor & @@ -355,7 +355,7 @@ public: /** * Tensor with inverted entries. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ constexpr DEAL_II_HOST_DEVICE Tensor operator-() const; @@ -387,7 +387,7 @@ public: * Return the square of the Frobenius-norm of a tensor, i.e. the sum of the * absolute squares of all entries. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ constexpr DEAL_II_HOST_DEVICE real_type norm_square() const; @@ -558,7 +558,7 @@ public: /** * Constructor. Initialize all entries to zero. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ constexpr DEAL_II_HOST_DEVICE_ALWAYS_INLINE Tensor(); @@ -566,7 +566,7 @@ public: /** * A constructor where the data is copied from a C-style array. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ constexpr DEAL_II_HOST_DEVICE explicit Tensor(const array_type &initializer); @@ -581,7 +581,7 @@ public: * either equal to @p Number, or is convertible to @p Number. * Number. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ template constexpr DEAL_II_HOST_DEVICE explicit Tensor( @@ -592,7 +592,7 @@ public: * obviously requires that the @p OtherNumber type is convertible to @p * Number. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ template constexpr DEAL_II_HOST_DEVICE @@ -627,7 +627,7 @@ public: /** * Read-Write access operator. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ constexpr DEAL_II_HOST_DEVICE value_type & operator[](const unsigned int i); @@ -635,7 +635,7 @@ public: /** * Read-only access operator. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ constexpr DEAL_II_HOST_DEVICE const value_type & operator[](const unsigned int i) const; @@ -681,7 +681,7 @@ public: * This obviously requires that the @p OtherNumber type is convertible to @p * Number. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ template constexpr DEAL_II_HOST_DEVICE Tensor & @@ -735,7 +735,7 @@ public: /** * Add another tensor. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ template constexpr DEAL_II_HOST_DEVICE Tensor & @@ -744,7 +744,7 @@ public: /** * Subtract another tensor. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ template constexpr DEAL_II_HOST_DEVICE Tensor & @@ -754,7 +754,7 @@ public: * Scale the tensor by factor, i.e. multiply all components by * factor. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ template constexpr DEAL_II_HOST_DEVICE Tensor & @@ -763,7 +763,7 @@ public: /** * Scale the vector by 1/factor. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ template constexpr DEAL_II_HOST_DEVICE Tensor & @@ -772,7 +772,7 @@ public: /** * Unary minus operator. Negate all entries of a tensor. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ constexpr DEAL_II_HOST_DEVICE Tensor operator-() const; @@ -797,7 +797,7 @@ public: * the absolute squares of all entries. For the present case of rank-1 * tensors, this equals the usual l2 norm of the vector. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ DEAL_II_HOST_DEVICE typename numbers::NumberTraits::real_type @@ -807,7 +807,7 @@ public: * Return the square of the Frobenius-norm of a tensor, i.e. the sum of the * absolute squares of all entries. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ constexpr DEAL_II_HOST_DEVICE typename numbers::NumberTraits::real_type @@ -897,7 +897,7 @@ private: * This constructor is for internal use. It provides a way * to create constexpr constructors for Tensor * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. */ template constexpr DEAL_II_HOST_DEVICE @@ -1961,7 +1961,7 @@ operator<<(std::ostream &out, const Tensor<0, dim, Number> &p) * This function unwraps the underlying @p Number stored in the Tensor and * multiplies @p object with it. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. * * @relatesalso Tensor */ @@ -1981,7 +1981,7 @@ constexpr DEAL_II_HOST_DEVICE inline DEAL_II_ALWAYS_INLINE * This function unwraps the underlying @p Number stored in the Tensor and * multiplies @p object with it. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. * * @relatesalso Tensor */ @@ -2001,7 +2001,7 @@ constexpr DEAL_II_HOST_DEVICE inline DEAL_II_ALWAYS_INLINE * OtherNumber that are stored within the Tensor and multiplies them. It * returns an unwrapped number of product type. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. * * @relatesalso Tensor */ @@ -2019,7 +2019,7 @@ DEAL_II_HOST_DEVICE constexpr DEAL_II_ALWAYS_INLINE /** * Division of a tensor of rank 0 by a scalar number. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. * * @relatesalso Tensor */ @@ -2038,7 +2038,7 @@ DEAL_II_HOST_DEVICE constexpr DEAL_II_ALWAYS_INLINE /** * Add two tensors of rank 0. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. * * @relatesalso Tensor */ @@ -2055,7 +2055,7 @@ constexpr DEAL_II_HOST_DEVICE_ALWAYS_INLINE /** * Subtract two tensors of rank 0. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. * * @relatesalso Tensor */ @@ -2077,7 +2077,7 @@ constexpr DEAL_II_HOST_DEVICE_ALWAYS_INLINE * number, a complex floating point number, etc.) is allowed, see the * documentation of EnableIfScalar for details. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. * * @relatesalso Tensor */ @@ -2105,7 +2105,7 @@ constexpr DEAL_II_HOST_DEVICE inline DEAL_II_ALWAYS_INLINE * number, a complex floating point number, etc.) is allowed, see the * documentation of EnableIfScalar for details. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. * * @relatesalso Tensor */ @@ -2176,7 +2176,7 @@ namespace internal * discussion on operator*() above for more information about template * arguments and the return type. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. * * @relatesalso Tensor */ @@ -2197,7 +2197,7 @@ constexpr DEAL_II_HOST_DEVICE inline DEAL_II_ALWAYS_INLINE * * @tparam rank The rank of both tensors. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. * * @relatesalso Tensor */ @@ -2221,7 +2221,7 @@ constexpr DEAL_II_HOST_DEVICE inline DEAL_II_ALWAYS_INLINE * * @tparam rank The rank of both tensors. * - * @note This function can also be used in CUDA device code. + * @note This function can also be used in device code. * * @relatesalso Tensor */ diff --git a/include/deal.II/lac/affine_constraints.templates.h b/include/deal.II/lac/affine_constraints.templates.h index 506503b0c3..f1d018c490 100644 --- a/include/deal.II/lac/affine_constraints.templates.h +++ b/include/deal.II/lac/affine_constraints.templates.h @@ -18,7 +18,6 @@ #include -#include #include #include #include diff --git a/include/deal.II/lac/la_parallel_vector.h b/include/deal.II/lac/la_parallel_vector.h index 08467b477c..194d8af58d 100644 --- a/include/deal.II/lac/la_parallel_vector.h +++ b/include/deal.II/lac/la_parallel_vector.h @@ -185,25 +185,31 @@ namespace LinearAlgebra * fail in some circumstances. Therefore, it is strongly recommended to * not rely on this class to automatically detect the unsupported case. * - *

CUDA support

+ *

GPU support

* - * This vector class supports two different memory spaces: Host and CUDA. By - * default, the memory space is Host and all the data are allocated on the - * CPU. When the memory space is CUDA, all the data is allocated on the GPU. - * The operations on the vector are performed on the chosen memory space. * - * From the host, there are two methods to access the elements of the Vector - * when using the CUDA memory space: + * This vector class supports two different memory spaces: Host and Default. + * By default, the memory space is Host and all the data is allocated on the + * CPU. When the memory space is Default, all the data is allocated on + * Kokkos' default memory space. That means that if Kokkos was configured + * with a GPU backend, the data is allocated on a GPU. The operations on the + * vector are performed on the chosen memory space. From the host, there are + * two methods to access the elements of the Vector when using the Default + * memory space: *
    *
  • use get_values(): * @code - * Vector vector(local_range, comm); + * Vector vector(local_range, comm); * double* vector_dev = vector.get_values(); - * std::vector vector_host(local_range.n_elements(), 1.); - * Utilities::CUDA::copy_to_dev(vector_host, vector_dev); + * const int n_local_elements = local_range.n_elements(); + * std::vector vector_host(n_local_elements, 1.); + * Kokkos::deep_copy(Kokkos::View( + * vector_host.data(), n_local_elements), + * Kokkos::View( vector_dev, n_local_elements)); * @endcode *
  • use import(): * @code - * Vector vector(local_range, comm); + * Vector vector(local_range, comm); * ReadWriteVector rw_vector(local_range); * for (auto & val : rw_vector) * val = 1.; @@ -214,15 +220,10 @@ namespace LinearAlgebra * necessary. Since an MPI communication may be performed, import needs to * be called on all the processors. * - * @note By default, all the ranks will try to access the device 0. This is - * fine is if you have one rank per node and one gpu per node. If you - * have multiple GPUs on one node, we need each process to access a - * different GPU. If each node has the same number of GPUs, this can be done - * as follows: - * int n_devices = 0; cudaGetDeviceCount(&n_devices); int - * device_id = my_rank % n_devices; - * cudaSetDevice(device_id); - * + * @note By default, the GPU device id is chosen in a round-robin fashion + * according to the local MPI rank id. To choose a different device, Kokkos + * has to be initialized explicitly providing the respective devide id + * explicitly. * *

    MPI-3 shared-memory support

    * @@ -244,8 +245,6 @@ namespace LinearAlgebra * MPI_Comm_split_type(comm, MPI_COMM_TYPE_SHARED, rank, MPI_INFO_NULL, * &comm_sm); * @endcode - * - * @see CUDAWrappers */ template class Vector : public ::dealii::LinearAlgebra::VectorSpaceVector, @@ -265,8 +264,8 @@ namespace LinearAlgebra static_assert( std::is_same::value || - std::is_same::value, - "MemorySpace should be Host or CUDA"); + std::is_same::value, + "MemorySpace should be Host or Default"); /** * @name 1: Basic Object-handling @@ -578,8 +577,8 @@ namespace LinearAlgebra * * Must follow a call to the @p compress_start function. * - * When the MemorySpace is CUDA and MPI is not CUDA-aware, data changed on - * the device after the call to compress_start will be lost. + * When the MemorySpace is Default and MPI is not GPU-aware, data changed + * on the device after the call to compress_start will be lost. */ void compress_finish(VectorOperation::values operation); @@ -677,7 +676,7 @@ namespace LinearAlgebra * VectorOperation::values @p operation is used to decide if the elements * in @p V should be added to the current vector or replace the current * elements. The main purpose of this function is to get data from one - * memory space, e.g. CUDA, to the other, e.g. the Host. + * memory space, e.g. Default, to the other, e.g. the Host. * * @note The partitioners of the two distributed vectors need to be the * same as no MPI communication is performed. @@ -734,7 +733,7 @@ namespace LinearAlgebra * communication pattern is used multiple times. This can be used to * improve performance. * - * @note If the MemorySpace is CUDA, the data in the ReadWriteVector will + * @note If the MemorySpace is Default, the data in the ReadWriteVector will * be moved to the device. */ virtual void @@ -968,8 +967,8 @@ namespace LinearAlgebra * * It holds that end() - begin() == locally_owned_size(). * - * @note For the CUDA memory space, the iterator points to memory on the - * device. + * @note For the Default memory space, the iterator might point to memory + * on the device. */ iterator begin(); @@ -978,8 +977,8 @@ namespace LinearAlgebra * Return constant iterator to the start of the locally owned elements * of the vector. * - * @note For the CUDA memory space, the iterator points to memory on the - * device. + * @note For the Default memory space, the iterator might point to memory + * on the device. */ const_iterator begin() const; @@ -988,8 +987,8 @@ namespace LinearAlgebra * Return an iterator pointing to the element past the end of the array * of locally owned entries. * - * @note For the CUDA memory space, the iterator points to memory on the - * device. + * @note For the Default memory space, the iterator might point to memory + * on the device. */ iterator end(); @@ -998,8 +997,8 @@ namespace LinearAlgebra * Return a constant iterator pointing to the element past the end of * the array of the locally owned entries. * - * @note For the CUDA memory space, the iterator points to memory on the - * device. + * @note For the Default memory space, the iterator might point to memory + * on the device. */ const_iterator end() const; @@ -1072,8 +1071,8 @@ namespace LinearAlgebra /** * Return the pointer to the underlying raw array. * - * @note For the CUDA memory space, the pointer points to memory on the - * device. + * @note For the Default memory space, the pointer might point to memory + * on the device. */ Number * get_values() const; @@ -1093,7 +1092,7 @@ namespace LinearAlgebra * * @pre The sizes of the @p indices and @p values arrays must be identical. * - * @note This function is not implemented for CUDA memory space. + * @note This function is not implemented for Default memory space. */ template void @@ -1227,13 +1226,6 @@ namespace LinearAlgebra */ DeclException0(ExcVectorTypeNotCompatible); - /** - * Attempt to perform an operation not implemented on the device. - * - * @ingroup Exceptions - */ - DeclException0(ExcNotAllowedForCuda); - /** * Exception */ diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index 3e4a6396ef..20962b80db 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -19,8 +19,6 @@ #include -#include -#include #include #include diff --git a/include/deal.II/lac/precondition.h b/include/deal.II/lac/precondition.h index c41d969893..9c34802405 100644 --- a/include/deal.II/lac/precondition.h +++ b/include/deal.II/lac/precondition.h @@ -3402,7 +3402,7 @@ namespace internal template void set_initial_guess( - ::dealii::LinearAlgebra::distributed::Vector + ::dealii::LinearAlgebra::distributed::Vector &vector) { // Choose a high-frequency mode consisting of numbers between 0 and 1 @@ -3707,7 +3707,7 @@ PreconditionChebyshev:: false) || (std::is_same>::value == + Vector>::value == false)))) temp_vector2.reinit(src, true); else diff --git a/include/deal.II/lac/trilinos_tpetra_vector.h b/include/deal.II/lac/trilinos_tpetra_vector.h index 3fa6d81fdf..330776ac4e 100644 --- a/include/deal.II/lac/trilinos_tpetra_vector.h +++ b/include/deal.II/lac/trilinos_tpetra_vector.h @@ -101,15 +101,13 @@ namespace LinearAlgebra * Tpetra uses Kokkos for thread-parallelism and chooses the execution and * memory space automatically depending on Kokkos configuration. The * priority is ranked from highest to lowest: - * - Kokkos::Cuda - * - Kokkos::OpenMP - * - Kokkos::Threads + * - GPU backend + * - host parallel backend * - Kokkos::Serial * - * In case Kokkos was configured with CUDA support, this class stores the - * values in unified virtual memory space and performs its action on the - * GPU. In particular, there is no need for manually synchronizing memory - * between host and device. + * In case Kokkos was configured with GPU support, this class performs its + * actions on the GPU. In particular, there is no need for manually + * synchronizing memory between host and device. * * @ingroup TrilinosWrappers * @ingroup Vectors diff --git a/include/deal.II/lac/vector_operations_internal.h b/include/deal.II/lac/vector_operations_internal.h index f2a67f618c..291d05f56b 100644 --- a/include/deal.II/lac/vector_operations_internal.h +++ b/include/deal.II/lac/vector_operations_internal.h @@ -26,8 +26,6 @@ #include #include -#include -#include #include #include -- 2.39.5