17#ifndef dealii_vector_operations_internal_h
18#define dealii_vector_operations_internal_h
30#include <deal.II/lac/cuda_kernels.templates.h>
40 namespace VectorOperations
66 template <
typename T,
typename U>
68 copy(
const T *begin,
const T *end, U *dest)
70 std::copy(begin, end, dest);
73 template <
typename T,
typename U>
75 copy(
const std::complex<T> *begin,
76 const std::complex<T> *end,
77 std::complex<U> * dest)
79 std::copy(begin, end, dest);
82 template <
typename T,
typename U>
84 copy(
const std::complex<T> *,
const std::complex<T> *, U *)
87 ExcMessage(
"Can't convert a vector of complex numbers "
88 "into a vector of reals/doubles"));
93#ifdef DEAL_II_WITH_TBB
102 template <
typename Functor>
114 const unsigned int gs =
148 template <
typename Functor>
154 const std::shared_ptr<::parallel::internal::TBBPartitioner>
157#ifdef DEAL_II_WITH_TBB
165 Assert(partitioner.get() !=
nullptr,
167 "Unexpected initialization of Vector that does "
168 "not set the TBB partitioner to a usable state."));
169 std::shared_ptr<tbb::affinity_partitioner> tbb_partitioner =
170 partitioner->acquire_one_partitioner();
186 partitioner->release_one_partitioner(tbb_partitioner);
188 else if (vec_size > 0)
200 template <
typename Number>
215 if (
value == Number())
217#ifdef DEAL_II_HAVE_CXX17
218 if constexpr (std::is_trivial<Number>::value)
220 if (std::is_trivial<Number>::value)
223 std::memset(
dst + begin, 0,
sizeof(Number) * (end - begin));
234 template <
typename Number,
typename OtherNumber>
250#if __GNUG__ && __GNUC__ < 5
251 if (__has_trivial_copy(Number) &&
252 std::is_same<Number, OtherNumber>::value)
254# ifdef DEAL_II_HAVE_CXX17
255 if constexpr (std::is_trivially_copyable<Number>() &&
256 std::is_same<Number, OtherNumber>::value)
258 if (std::is_trivially_copyable<Number>() &&
259 std::is_same<Number, OtherNumber>::value)
262 std::memcpy(
dst + begin,
src + begin, (end - begin) *
sizeof(Number));
271 const OtherNumber *
const src;
275 template <
typename Number>
303 template <
typename Number>
307 const Number *
const v_val,
335 template <
typename Number>
339 const Number *
const v_val,
370 template <
typename Number>
398 template <
typename Number>
426 template <
typename Number>
454 template <
typename Number>
458 const Number *
const v_val,
459 const Number *
const w_val,
492 template <
typename Number>
496 const Number *
const v_val,
524 template <
typename Number>
565 template <
typename Number>
593 template <
typename Number>
597 const Number *
const u_val,
625 template <
typename Number>
629 const Number *
const u_val,
630 const Number *
const v_val,
663 template <
typename Number>
707 template <
typename Number>
744 template <
typename Number,
typename Number2>
747 static constexpr bool vectorizes = std::is_same<Number, Number2>::value &&
750 Dot(
const Number *
const X,
const Number2 *
const Y)
776 "This operation is not correctly implemented for "
777 "complex-valued objects.");
781 const Number *
const X;
782 const Number2 *
const Y;
785 template <
typename Number,
typename RealType>
808 const Number *
const X;
811 template <
typename Number,
typename RealType>
837 template <
typename Number,
typename RealType>
865 template <
typename Number>
891 template <
typename Number>
897 const Number *
const V,
898 const Number *
const W,
933 "This operation is not correctly implemented for "
934 "complex-valued objects.");
939 const Number *
const V;
940 const Number *
const W;
988 template <
typename Operation,
typename ResultType>
1006 outer_results[0] = ResultType();
1014 const size_type remainder = vec_size % 32;
1028 std::integral_constant<bool, Operation::vectorizes>());
1044 const size_type inner_chunks = remainder / 8;
1046 const size_type remainder_inner = remainder % 8;
1047 ResultType r0 = ResultType(), r1 = ResultType(),
1049 switch (inner_chunks)
1068 for (
size_type j = 0; j < remainder_inner; ++j)
1077 outer_results[n_chunks] = r0;
1088 while (n_chunks > 1)
1090 if (n_chunks % 2 == 1)
1091 outer_results[n_chunks++] = ResultType();
1092 for (
size_type i = 0; i < n_chunks; i += 2)
1093 outer_results[i / 2] = outer_results[i] + outer_results[i + 1];
1096 result = outer_results[0];
1107 ResultType r0, r1, r2, r3;
1111 first + 2 * new_size,
1112 first + 3 * new_size,
1126 template <
typename Operation,
typename ResultType>
1129 const Operation &op,
1133 std::integral_constant<bool, false>)
1137 for (
size_type i = 0; i < n_chunks; ++i)
1139 ResultType r0 = op(
index);
1140 ResultType r1 = op(
index + 1);
1141 ResultType r2 = op(
index + 2);
1142 ResultType r3 = op(
index + 3);
1147 r1 += op(
index + 1);
1148 r2 += op(
index + 2);
1149 r3 += op(
index + 3);
1153 outer_results[i] = r0 + r2;
1164 template <
typename Operation,
typename Number>
1167 const Operation &op,
1171 std::integral_constant<bool, true>)
1180 const size_type regular_chunks = n_chunks / nvecs;
1181 for (
size_type i = 0; i < regular_chunks; ++i)
1190 r0 += op.do_vectorized(
index);
1191 r1 += op.do_vectorized(
index + nvecs);
1192 r2 += op.do_vectorized(
index + 2 * nvecs);
1193 r3 += op.do_vectorized(
index + 3 * nvecs);
1198 r0.
store(&outer_results[i * nvecs]);
1210 "VectorizedArray::size() must be a power of 2 and not more than 16");
1212 if (n_chunks % nvecs != 0)
1216 const size_type start_irreg = regular_chunks * nvecs;
1217 for (
size_type c = start_irreg; c < n_chunks; ++c)
1218 for (
size_type j = 0; j < 32; j += 2 * nvecs,
index += 2 * nvecs)
1220 r0 += op.do_vectorized(
index);
1221 r1 += op.do_vectorized(
index + nvecs);
1224 r0.
store(&outer_results[start_irreg]);
1233#ifdef DEAL_II_WITH_TBB
1262 template <
typename Operation,
typename ResultType>
1276 const unsigned int gs =
1311 for (
size_type i = range.begin(); i < range.end(); ++i)
1352 template <
typename Operation,
typename ResultType>
1355 const Operation &op,
1358 ResultType & result,
1359 const std::shared_ptr<::parallel::internal::TBBPartitioner>
1362#ifdef DEAL_II_WITH_TBB
1370 Assert(partitioner.get() !=
nullptr,
1372 "Unexpected initialization of Vector that does "
1373 "not set the TBB partitioner to a usable state."));
1374 std::shared_ptr<tbb::affinity_partitioner> tbb_partitioner =
1375 partitioner->acquire_one_partitioner();
1393 partitioner->release_one_partitioner(tbb_partitioner);
1394 result = generic_functor.
do_sum();
1405 template <
typename Number,
typename Number2,
typename MemorySpace>
1410 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1413 const ::MemorySpace::MemorySpaceData<Number2, MemorySpace>
1418 std::is_same<MemorySpace, ::MemorySpace::CUDA>::value &&
1419 std::is_same<Number, Number2>::value,
1420 "For the CUDA MemorySpace Number and Number2 should be the same type");
1425 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1434 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1437 const ::MemorySpace::MemorySpaceData<Number, MemorySpace>
1444 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1447 const ::MemorySpace::MemorySpaceData<Number, MemorySpace>
1454 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1463 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1467 const ::MemorySpace::MemorySpaceData<Number, MemorySpace>
1474 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1479 const ::MemorySpace::MemorySpaceData<Number, MemorySpace>
1481 const ::MemorySpace::MemorySpaceData<Number, MemorySpace>
1488 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1492 const ::MemorySpace::MemorySpaceData<Number, MemorySpace>
1499 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1504 const ::MemorySpace::MemorySpaceData<Number, MemorySpace>
1511 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1517 const ::MemorySpace::MemorySpaceData<Number, MemorySpace>
1519 const ::MemorySpace::MemorySpaceData<Number, MemorySpace>
1526 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1535 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1538 const ::MemorySpace::MemorySpaceData<Number, MemorySpace>
1545 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1549 const ::MemorySpace::MemorySpaceData<Number, MemorySpace>
1556 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1561 const ::MemorySpace::MemorySpaceData<Number, MemorySpace>
1563 const ::MemorySpace::MemorySpaceData<Number, MemorySpace>
1570 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1573 const ::MemorySpace::MemorySpaceData<Number2, MemorySpace>
1580 template <
typename real_type>
1583 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1587 const ::MemorySpace::MemorySpaceData<Number, MemorySpace>
1594 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1597 const ::MemorySpace::MemorySpaceData<Number, MemorySpace>
1603 template <
typename real_type>
1606 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1614 template <
typename real_type>
1617 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1627 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1631 const ::MemorySpace::MemorySpaceData<Number, MemorySpace>
1633 const ::MemorySpace::MemorySpaceData<Number, MemorySpace>
1640 template <
typename MemorySpace2>
1643 const std::shared_ptr<::parallel::internal::TBBPartitioner> &
1647 const ::MemorySpace::MemorySpaceData<Number, MemorySpace2>
1655 template <
typename Number,
typename Number2>
1659 copy(
const std::shared_ptr<::parallel::internal::TBBPartitioner>
1660 & thread_loop_partitioner,
1662 const ::MemorySpace::
1663 MemorySpaceData<Number2, ::MemorySpace::Host> &v_data,
1670 parallel_for(copier, 0, size, thread_loop_partitioner);
1674 set(
const std::shared_ptr<::parallel::internal::TBBPartitioner>
1675 & thread_loop_partitioner,
1683 parallel_for(setter, 0, size, thread_loop_partitioner);
1688 const std::shared_ptr<::parallel::internal::TBBPartitioner>
1689 & thread_loop_partitioner,
1691 const ::MemorySpace::
1692 MemorySpaceData<Number, ::MemorySpace::Host> &v_data,
1698 v_data.values.get());
1699 parallel_for(vector_add, 0, size, thread_loop_partitioner);
1704 const std::shared_ptr<::parallel::internal::TBBPartitioner>
1705 & thread_loop_partitioner,
1707 const ::MemorySpace::
1708 MemorySpaceData<Number, ::MemorySpace::Host> &v_data,
1714 v_data.values.get());
1715 parallel_for(vector_subtract, 0, size, thread_loop_partitioner);
1720 const std::shared_ptr<::parallel::internal::TBBPartitioner>
1721 & thread_loop_partitioner,
1729 parallel_for(vector_add, 0, size, thread_loop_partitioner);
1733 add_av(
const std::shared_ptr<::parallel::internal::TBBPartitioner>
1734 & thread_loop_partitioner,
1737 const ::MemorySpace::
1738 MemorySpaceData<Number, ::MemorySpace::Host> &v_data,
1744 v_data.values.get(),
1746 parallel_for(vector_add, 0, size, thread_loop_partitioner);
1751 const std::shared_ptr<::parallel::internal::TBBPartitioner>
1752 & thread_loop_partitioner,
1756 const ::MemorySpace::
1757 MemorySpaceData<Number, ::MemorySpace::Host> &v_data,
1758 const ::MemorySpace::
1759 MemorySpaceData<Number, ::MemorySpace::Host> &w_data,
1765 data.values.get(), v_data.values.get(), w_data.values.get(), a, b);
1766 parallel_for(vector_add, 0, size, thread_loop_partitioner);
1771 const std::shared_ptr<::parallel::internal::TBBPartitioner>
1772 & thread_loop_partitioner,
1775 const ::MemorySpace::
1776 MemorySpaceData<Number, ::MemorySpace::Host> &v_data,
1782 v_data.values.get(),
1784 parallel_for(vector_sadd, 0, size, thread_loop_partitioner);
1789 const std::shared_ptr<::parallel::internal::TBBPartitioner>
1790 & thread_loop_partitioner,
1794 const ::MemorySpace::
1795 MemorySpaceData<Number, ::MemorySpace::Host> &v_data,
1801 v_data.values.get(),
1804 parallel_for(vector_sadd, 0, size, thread_loop_partitioner);
1809 const std::shared_ptr<::parallel::internal::TBBPartitioner>
1810 & thread_loop_partitioner,
1815 const ::MemorySpace::
1816 MemorySpaceData<Number, ::MemorySpace::Host> &v_data,
1817 const ::MemorySpace::
1818 MemorySpaceData<Number, ::MemorySpace::Host> &w_data,
1824 data.values.get(), v_data.values.get(), w_data.values.get(), x, a, b);
1825 parallel_for(vector_sadd, 0, size, thread_loop_partitioner);
1830 const std::shared_ptr<::parallel::internal::TBBPartitioner>
1831 & thread_loop_partitioner,
1833 const Number factor,
1840 parallel_for(vector_multiply, 0, size, thread_loop_partitioner);
1844 scale(
const std::shared_ptr<::parallel::internal::TBBPartitioner>
1845 & thread_loop_partitioner,
1847 const ::MemorySpace::
1848 MemorySpaceData<Number, ::MemorySpace::Host> &v_data,
1854 v_data.values.get());
1855 parallel_for(vector_scale, 0, size, thread_loop_partitioner);
1859 equ_au(
const std::shared_ptr<::parallel::internal::TBBPartitioner>
1860 & thread_loop_partitioner,
1863 const ::MemorySpace::
1864 MemorySpaceData<Number, ::MemorySpace::Host> &v_data,
1870 v_data.values.get(),
1872 parallel_for(vector_equ, 0, size, thread_loop_partitioner);
1877 const std::shared_ptr<::parallel::internal::TBBPartitioner>
1878 & thread_loop_partitioner,
1882 const ::MemorySpace::
1883 MemorySpaceData<Number, ::MemorySpace::Host> &v_data,
1884 const ::MemorySpace::
1885 MemorySpaceData<Number, ::MemorySpace::Host> &w_data,
1891 data.values.get(), v_data.values.get(), w_data.values.get(), a, b);
1892 parallel_for(vector_equ, 0, size, thread_loop_partitioner);
1896 dot(
const std::shared_ptr<::parallel::internal::TBBPartitioner>
1897 & thread_loop_partitioner,
1899 const ::MemorySpace::
1900 MemorySpaceData<Number2, ::MemorySpace::Host> &v_data,
1907 data.values.get(), v_data.values.get());
1909 dot, 0, size, sum, thread_loop_partitioner);
1915 template <
typename real_type>
1917 norm_2(
const std::shared_ptr<::parallel::internal::TBBPartitioner>
1918 & thread_loop_partitioner,
1931 const std::shared_ptr<::parallel::internal::TBBPartitioner>
1932 & thread_loop_partitioner,
1934 const ::MemorySpace::
1935 MemorySpaceData<Number, ::MemorySpace::Host> &data)
1944 template <
typename real_type>
1946 norm_1(
const std::shared_ptr<::parallel::internal::TBBPartitioner>
1947 & thread_loop_partitioner,
1958 template <
typename real_type>
1960 norm_p(
const std::shared_ptr<::parallel::internal::TBBPartitioner>
1961 & thread_loop_partitioner,
1975 const std::shared_ptr<::parallel::internal::TBBPartitioner>
1976 & thread_loop_partitioner,
1979 const ::MemorySpace::
1980 MemorySpaceData<Number, ::MemorySpace::Host> &v_data,
1981 const ::MemorySpace::
1982 MemorySpaceData<Number, ::MemorySpace::Host> &w_data,
1989 v_data.values.get(),
1990 w_data.values.get(),
1997 template <
typename MemorySpace2>
2000 const std::shared_ptr<::parallel::internal::TBBPartitioner>
2001 & thread_loop_partitioner,
2004 const ::MemorySpace::MemorySpaceData<Number, MemorySpace2>
2009 typename std::enable_if<
2010 std::is_same<MemorySpace2, ::MemorySpace::Host>::value,
2015 copy(thread_loop_partitioner, size, v_data, data);
2019 add_vector(thread_loop_partitioner, size, v_data, data);
2027#ifdef DEAL_II_COMPILER_CUDA_AWARE
2028 template <
typename MemorySpace2>
2031 const std::shared_ptr<::parallel::internal::TBBPartitioner>
2035 const ::MemorySpace::MemorySpaceData<Number, MemorySpace2>
2040 typename std::enable_if<
2041 std::is_same<MemorySpace2, ::MemorySpace::CUDA>::value,
2046 cudaError_t cuda_error_code = cudaMemcpy(data.values.get(),
2047 v_data.values_dev.get(),
2048 size *
sizeof(Number),
2049 cudaMemcpyDeviceToHost);
2062#ifdef DEAL_II_COMPILER_CUDA_AWARE
2063 template <
typename Number>
2066 static const int block_size =
2067 ::LinearAlgebra::CUDAWrappers::kernel::block_size;
2068 static const int chunk_size =
2069 ::LinearAlgebra::CUDAWrappers::kernel::chunk_size;
2073 const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2075 const ::MemorySpace::
2076 MemorySpaceData<Number, ::MemorySpace::CUDA> &v_data,
2081 cudaError_t cuda_error_code = cudaMemcpy(data.values_dev.get(),
2082 v_data.values_dev.get(),
2083 size *
sizeof(Number),
2084 cudaMemcpyDeviceToDevice);
2089 set(
const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2096 const int n_blocks = 1 + size / (chunk_size * block_size);
2097 ::LinearAlgebra::CUDAWrappers::kernel::set<Number>
2098 <<<n_blocks, block_size>>>(data.values_dev.get(), s, size);
2104 const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2106 const ::MemorySpace::
2107 MemorySpaceData<Number, ::MemorySpace::CUDA> &v_data,
2112 const int n_blocks = 1 + size / (chunk_size * block_size);
2113 ::LinearAlgebra::CUDAWrappers::kernel::add_aV<Number>
2114 <<<n_blocks, block_size>>>(data.values_dev.get(),
2116 v_data.values_dev.get(),
2123 const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2125 const ::MemorySpace::
2126 MemorySpaceData<Number, ::MemorySpace::CUDA> &v_data,
2131 const int n_blocks = 1 + size / (chunk_size * block_size);
2132 ::LinearAlgebra::CUDAWrappers::kernel::add_aV<Number>
2133 <<<n_blocks, block_size>>>(data.values_dev.get(),
2135 v_data.values_dev.get(),
2142 const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2149 const int n_blocks = 1 + size / (chunk_size * block_size);
2150 ::LinearAlgebra::CUDAWrappers::kernel::vec_add<Number>
2151 <<<n_blocks, block_size>>>(data.values_dev.get(), a, size);
2157 const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2160 const ::MemorySpace::
2161 MemorySpaceData<Number, ::MemorySpace::CUDA> &v_data,
2166 const int n_blocks = 1 + size / (chunk_size * block_size);
2167 ::LinearAlgebra::CUDAWrappers::kernel::add_aV<Number>
2168 <<<n_blocks, block_size>>>(data.values_dev.get(),
2170 v_data.values_dev.get(),
2177 const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2181 const ::MemorySpace::
2182 MemorySpaceData<Number, ::MemorySpace::CUDA> &v_data,
2183 const ::MemorySpace::
2184 MemorySpaceData<Number, ::MemorySpace::CUDA> &w_data,
2189 const int n_blocks = 1 + size / (chunk_size * block_size);
2190 ::LinearAlgebra::CUDAWrappers::kernel::add_aVbW<Number>
2191 <<<dim3(n_blocks, 1), dim3(block_size)>>>(data.values_dev.get(),
2193 v_data.values_dev.get(),
2195 w_data.values_dev.get(),
2202 const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2205 const ::MemorySpace::
2206 MemorySpaceData<Number, ::MemorySpace::CUDA> &v_data,
2211 const int n_blocks = 1 + size / (chunk_size * block_size);
2212 ::LinearAlgebra::CUDAWrappers::kernel::sadd<Number>
2213 <<<dim3(n_blocks, 1), dim3(block_size)>>>(
2214 x, data.values_dev.get(), 1., v_data.values_dev.get(), size);
2220 const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2224 const ::MemorySpace::
2225 MemorySpaceData<Number, ::MemorySpace::CUDA> &v_data,
2230 const int n_blocks = 1 + size / (chunk_size * block_size);
2231 ::LinearAlgebra::CUDAWrappers::kernel::sadd<Number>
2232 <<<dim3(n_blocks, 1), dim3(block_size)>>>(
2233 x, data.values_dev.get(), a, v_data.values_dev.get(), size);
2239 const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2244 const ::MemorySpace::
2245 MemorySpaceData<Number, ::MemorySpace::CUDA> &v_data,
2246 const ::MemorySpace::
2247 MemorySpaceData<Number, ::MemorySpace::CUDA> &w_data,
2252 const int n_blocks = 1 + size / (chunk_size * block_size);
2253 ::LinearAlgebra::CUDAWrappers::kernel::sadd<Number>
2254 <<<dim3(n_blocks, 1), dim3(block_size)>>>(x,
2255 data.values_dev.get(),
2257 v_data.values_dev.get(),
2259 w_data.values_dev.get(),
2266 const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2268 const Number factor,
2273 const int n_blocks = 1 + size / (chunk_size * block_size);
2274 ::LinearAlgebra::CUDAWrappers::kernel::vec_scale<Number>
2275 <<<n_blocks, block_size>>>(data.values_dev.get(), factor, size);
2281 const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2283 const ::MemorySpace::
2284 MemorySpaceData<Number, ::MemorySpace::CUDA> &v_data,
2289 const int n_blocks = 1 + size / (chunk_size * block_size);
2290 ::LinearAlgebra::CUDAWrappers::kernel::scale<Number>
2291 <<<dim3(n_blocks, 1), dim3(block_size)>>>(data.values_dev.get(),
2292 v_data.values_dev.get(),
2299 const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2302 const ::MemorySpace::
2303 MemorySpaceData<Number, ::MemorySpace::CUDA> &v_data,
2308 const int n_blocks = 1 + size / (chunk_size * block_size);
2309 ::LinearAlgebra::CUDAWrappers::kernel::equ<Number>
2310 <<<dim3(n_blocks, 1), dim3(block_size)>>>(data.values_dev.get(),
2312 v_data.values_dev.get(),
2319 const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2323 const ::MemorySpace::
2324 MemorySpaceData<Number, ::MemorySpace::CUDA> &v_data,
2325 const ::MemorySpace::
2326 MemorySpaceData<Number, ::MemorySpace::CUDA> &w_data,
2331 const int n_blocks = 1 + size / (chunk_size * block_size);
2332 ::LinearAlgebra::CUDAWrappers::kernel::equ<Number>
2333 <<<dim3(n_blocks, 1), dim3(block_size)>>>(data.values_dev.get(),
2335 v_data.values_dev.get(),
2337 w_data.values_dev.get(),
2343 dot(
const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2345 const ::MemorySpace::
2346 MemorySpaceData<Number, ::MemorySpace::CUDA> &v_data,
2351 Number * result_device;
2352 cudaError_t error_code = cudaMalloc(&result_device,
sizeof(Number));
2354 error_code = cudaMemset(result_device, 0,
sizeof(Number));
2357 const int n_blocks = 1 + size / (chunk_size * block_size);
2361 <<<dim3(n_blocks, 1), dim3(block_size)>>>(result_device,
2362 data.values_dev.get(),
2363 v_data.values_dev.get(),
2364 static_cast<unsigned int>(
2370 error_code = cudaMemcpy(&result,
2373 cudaMemcpyDeviceToHost);
2376 error_code = cudaFree(result_device);
2384 template <
typename real_type>
2386 norm_2(
const std::shared_ptr<::parallel::internal::TBBPartitioner>
2387 & thread_loop_partitioner,
2394 sum =
dot(thread_loop_partitioner, size, data, data);
2399 const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2401 const ::MemorySpace::
2402 MemorySpaceData<Number, ::MemorySpace::CUDA> &data)
2404 Number * result_device;
2405 cudaError_t error_code = cudaMalloc(&result_device,
sizeof(Number));
2407 error_code = cudaMemset(result_device, 0,
sizeof(Number));
2409 const int n_blocks = 1 + size / (chunk_size * block_size);
2413 <<<dim3(n_blocks, 1), dim3(block_size)>>>(result_device,
2414 data.values_dev.get(),
2419 error_code = cudaMemcpy(&result,
2422 cudaMemcpyDeviceToHost);
2425 error_code = cudaFree(result_device);
2431 template <
typename real_type>
2434 const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2441 Number * result_device;
2442 cudaError_t error_code = cudaMalloc(&result_device,
sizeof(Number));
2444 error_code = cudaMemset(result_device, 0,
sizeof(Number));
2446 const int n_blocks = 1 + size / (chunk_size * block_size);
2450 <<<dim3(n_blocks, 1), dim3(block_size)>>>(result_device,
2451 data.values_dev.get(),
2455 error_code = cudaMemcpy(&sum,
2458 cudaMemcpyDeviceToHost);
2461 error_code = cudaFree(result_device);
2465 template <
typename real_type>
2468 const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2480 const std::shared_ptr<::parallel::internal::TBBPartitioner> &,
2483 const ::MemorySpace::
2484 MemorySpaceData<Number, ::MemorySpace::CUDA> &v_data,
2485 const ::MemorySpace::
2486 MemorySpaceData<Number, ::MemorySpace::CUDA> &w_data,
2492 cudaError_t error_code = cudaMalloc(&res_d,
sizeof(Number));
2494 error_code = cudaMemset(res_d, 0,
sizeof(Number));
2497 const int n_blocks = 1 + size / (chunk_size * block_size);
2498 ::LinearAlgebra::CUDAWrappers::kernel::add_and_dot<Number>
2499 <<<dim3(n_blocks, 1), dim3(block_size)>>>(res_d,
2500 data.values_dev.get(),
2501 v_data.values_dev.get(),
2502 w_data.values_dev.get(),
2508 cudaMemcpy(&res, res_d,
sizeof(Number), cudaMemcpyDeviceToHost);
2510 error_code = cudaFree(res_d);
2515 template <
typename MemorySpace2>
2518 const std::shared_ptr<::parallel::internal::TBBPartitioner>
2519 & thread_loop_partitioner,
2522 const ::MemorySpace::MemorySpaceData<Number, MemorySpace2>
2527 typename std::enable_if<
2528 std::is_same<MemorySpace2, ::MemorySpace::CUDA>::value,
2533 copy(thread_loop_partitioner, size, v_data, data);
2537 add_vector(thread_loop_partitioner, size, v_data, data);
2545 template <
typename MemorySpace2>
2548 const std::shared_ptr<::parallel::internal::TBBPartitioner>
2552 const ::MemorySpace::MemorySpaceData<Number, MemorySpace2>
2557 typename std::enable_if<
2558 std::is_same<MemorySpace2, ::MemorySpace::Host>::value,
2563 cudaError_t cuda_error_code = cudaMemcpy(data.values_dev.get(),
2564 v_data.values.get(),
2565 size *
sizeof(Number),
2566 cudaMemcpyHostToDevice);
static unsigned int n_threads()
static constexpr std::size_t size()
void store(Number *ptr) const
void load(const Number *ptr)
#define DEAL_II_OPENMP_SIMD_PRAGMA
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_FALLTHROUGH
__global__ void double_vector_reduction(Number *result, const Number *v1, const Number *v2, const size_type N)
__global__ void reduction(Number *result, const Number *v, const size_type N)
#define AssertCudaKernel()
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertIsFinite(number)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
#define AssertCuda(error_code)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
unsigned int minimum_parallel_grain_size
void accumulate_recursive(const Operation &op, const size_type first, const size_type last, ResultType &result)
bool is_non_negative(const T &t)
void parallel_reduce(const Operation &op, const size_type start, const size_type end, ResultType &result, const std::shared_ptr<::parallel::internal::TBBPartitioner > &partitioner)
void copy(const T *begin, const T *end, U *dest)
void parallel_for(Functor &functor, const size_type start, const size_type end, const std::shared_ptr<::parallel::internal::TBBPartitioner > &partitioner)
const unsigned int vector_accumulation_recursion_threshold
void accumulate_regular(const Operation &op, const size_type &n_chunks, size_type &index, ResultType(&outer_results)[vector_accumulation_recursion_threshold], std::integral_constant< bool, false >)
types::global_dof_index size_type
void parallel_for(Iterator x_begin, Iterator x_end, const Functor &functor, const unsigned int grainsize)
::VectorizedArray< Number, width > min(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > pow(const ::VectorizedArray< Number, width > &, const Number p)
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)
unsigned int global_dof_index
static const bool vectorizes
AddAndDot(Number *const X, const Number *const V, const Number *const W, const Number a)
Number operator()(const size_type i) const
VectorizedArray< Number > do_vectorized(const size_type i) const
Dot(const Number *const X, const Number2 *const Y)
static constexpr bool vectorizes
Number operator()(const size_type i) const
VectorizedArray< Number > do_vectorized(const size_type i) const
Number operator()(const size_type i) const
VectorizedArray< Number > do_vectorized(const size_type i) const
MeanValue(const Number *X)
static const bool vectorizes
RealType operator()(const size_type i) const
static const bool vectorizes
VectorizedArray< Number > do_vectorized(const size_type i) const
Norm2(const Number *const X)
RealType operator()(const size_type i) const
static const bool vectorizes
VectorizedArray< Number > do_vectorized(const size_type i) const
RealType operator()(const size_type i) const
NormP(const Number *X, RealType p)
VectorizedArray< Number > do_vectorized(const size_type i) const
static const bool vectorizes
void operator()(const tbb::blocked_range< size_type > &range) const
TBBForFunctor(Functor &functor, const size_type start, const size_type end)
static const unsigned int threshold_array_allocate
TBBReduceFunctor(const Operation &op, const size_type start, const size_type end)
ResultType small_array[threshold_array_allocate]
ResultType do_sum() const
void operator()(const tbb::blocked_range< size_type > &range) const
std::vector< ResultType > large_array
Vector_copy(const OtherNumber *const src, Number *const dst)
void operator()(const size_type begin, const size_type end) const
const OtherNumber *const src
Vector_set(const Number value, Number *const dst)
void operator()(const size_type begin, const size_type end) const
Vectorization_add_av(Number *const val, const Number *const v_val, const Number factor)
void operator()(const size_type begin, const size_type end) const
const Number *const v_val
Vectorization_add_avpbw(Number *const val, const Number *const v_val, const Number *const w_val, const Number a, const Number b)
void operator()(const size_type begin, const size_type end) const
const Number *const w_val
const Number *const v_val
void operator()(const size_type begin, const size_type end) const
Vectorization_add_factor(Number *const val, const Number factor)
void operator()(const size_type begin, const size_type end) const
const Number *const v_val
Vectorization_add_v(Number *const val, const Number *const v_val)
const Number *const u_val
Vectorization_equ_au(Number *const val, const Number *const u_val, const Number a)
void operator()(const size_type begin, const size_type end) const
Vectorization_equ_aubv(Number *const val, const Number *const u_val, const Number *const v_val, const Number a, const Number b)
const Number *const u_val
void operator()(const size_type begin, const size_type end) const
const Number *const v_val
Vectorization_equ_aubvcw(Number *val, const Number *u_val, const Number *v_val, const Number *w_val, const Number a, const Number b, const Number c)
const Number *const w_val
const Number *const v_val
const Number *const u_val
void operator()(const size_type begin, const size_type end) const
Vectorization_multiply_factor(Number *const val, const Number factor)
void operator()(const size_type begin, const size_type end) const
void operator()(const size_type begin, const size_type end) const
const Number *const a_val
Vectorization_ratio(Number *val, const Number *a_val, const Number *b_val)
const Number *const b_val
Vectorization_sadd_xav(Number *val, const Number *const v_val, const Number a, const Number x)
const Number *const v_val
void operator()(const size_type begin, const size_type end) const
const Number *const v_val
const Number *const w_val
void operator()(const size_type begin, const size_type end) const
Vectorization_sadd_xavbw(Number *val, const Number *v_val, const Number *w_val, Number x, Number a, Number b)
Vectorization_sadd_xv(Number *const val, const Number *const v_val, const Number x)
void operator()(const size_type begin, const size_type end) const
const Number *const v_val
const Number *const v_val
void operator()(const size_type begin, const size_type end) const
Vectorization_scale(Number *const val, const Number *const v_val)
Vectorization_subtract_v(Number *val, const Number *const v_val)
void operator()(const size_type begin, const size_type end) const
const Number *const v_val
static void set(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, const Number s, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static void norm_2(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, real_type &sum, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static void norm_p(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, real_type &sum, const real_type p, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static void import_elements(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, VectorOperation::values operation, const ::MemorySpace::MemorySpaceData< Number, MemorySpace2 > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data, typename std::enable_if< std::is_same< MemorySpace2, ::MemorySpace::Host >::value, int >::type=0)
static void add_avpbw(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, const Number a, const Number b, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &v_data, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &w_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static void sadd_xav(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, const Number x, const Number a, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static void equ_au(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, const Number a, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static void scale(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static Number mean_value(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static void add_factor(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, Number a, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static void sadd_xv(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, const Number x, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static void norm_1(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, real_type &sum, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static void copy(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, const ::MemorySpace::MemorySpaceData< Number2, ::MemorySpace::Host > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static void import_elements(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, VectorOperation::values operation, const ::MemorySpace::MemorySpaceData< Number, MemorySpace2 > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data, typename std::enable_if< std::is_same< MemorySpace2, ::MemorySpace::CUDA >::value, int >::type=0)
static void add_av(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, const Number a, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static void add_vector(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static void sadd_xavbw(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, const Number x, const Number a, const Number b, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &v_data, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &w_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static void subtract_vector(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static Number add_and_dot(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, const Number a, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &v_data, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &w_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static Number dot(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, const ::MemorySpace::MemorySpaceData< Number2, ::MemorySpace::Host > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static void equ_aubv(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, const Number a, const Number b, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &v_data, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &w_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static void multiply_factor(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, const Number factor, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::Host > &data)
static void add_factor(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, Number a, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static Number add_and_dot(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, const Number a, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &v_data, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &w_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static void multiply_factor(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, const Number factor, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static void subtract_vector(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static void scale(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static void copy(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static Number mean_value(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static void norm_p(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, real_type &, real_type, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &)
static void sadd_xavbw(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, const Number x, const Number a, const Number b, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &v_data, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &w_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static void equ_aubv(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, const Number a, const Number b, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &v_data, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &w_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static void sadd_xav(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, const Number x, const Number a, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static Number dot(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static void norm_1(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, real_type &sum, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static void sadd_xv(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, const Number x, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static void import_elements(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, VectorOperation::values operation, const ::MemorySpace::MemorySpaceData< Number, MemorySpace2 > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data, typename std::enable_if< std::is_same< MemorySpace2, ::MemorySpace::CUDA >::value, int >::type=0)
static void equ_au(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, const Number a, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static void norm_2(const std::shared_ptr<::parallel::internal::TBBPartitioner > &thread_loop_partitioner, const size_type size, real_type &sum, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static void import_elements(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, VectorOperation::values operation, const ::MemorySpace::MemorySpaceData< Number, MemorySpace2 > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data, typename std::enable_if< std::is_same< MemorySpace2, ::MemorySpace::Host >::value, int >::type=0)
static void add_vector(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static void set(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, const Number s, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static void add_avpbw(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, const Number a, const Number b, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &v_data, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &w_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static void add_av(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type size, const Number a, const ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &v_data, ::MemorySpace::MemorySpaceData< Number, ::MemorySpace::CUDA > &data)
static Number mean_value(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, const ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static void equ_au(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, const Number, const ::MemorySpace::MemorySpaceData< Number, MemorySpace > &, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static void add_avpbw(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, const Number, const Number, const ::MemorySpace::MemorySpaceData< Number, MemorySpace > &, const ::MemorySpace::MemorySpaceData< Number, MemorySpace > &, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static void sadd_xv(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, const Number, const ::MemorySpace::MemorySpaceData< Number, MemorySpace > &, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static void add_factor(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, Number, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static void norm_2(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, real_type &, const ::MemorySpace::MemorySpaceData< Number, MemorySpace > &, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static void add_vector(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, const ::MemorySpace::MemorySpaceData< Number, MemorySpace > &, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static void scale(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, const ::MemorySpace::MemorySpaceData< Number, MemorySpace > &, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static void subtract_vector(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, const ::MemorySpace::MemorySpaceData< Number, MemorySpace > &, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static void sadd_xavbw(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, const Number, const Number, const Number, const ::MemorySpace::MemorySpaceData< Number, MemorySpace > &, const ::MemorySpace::MemorySpaceData< Number, MemorySpace > &, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static Number dot(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, const ::MemorySpace::MemorySpaceData< Number2, MemorySpace > &, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static Number add_and_dot(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, const Number, const ::MemorySpace::MemorySpaceData< Number, MemorySpace > &, const ::MemorySpace::MemorySpaceData< Number, MemorySpace > &, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static void sadd_xav(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, const Number, const Number, const ::MemorySpace::MemorySpaceData< Number, MemorySpace > &, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static void import_elements(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, VectorOperation::values, const ::MemorySpace::MemorySpaceData< Number, MemorySpace2 > &, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static void copy(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, const ::MemorySpace::MemorySpaceData< Number2, MemorySpace > &, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static void norm_1(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, real_type &, Number *, Number *)
static void add_av(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, const Number, const ::MemorySpace::MemorySpaceData< Number, MemorySpace > &, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static void multiply_factor(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, const Number, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static void norm_p(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, real_type &, real_type, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static void equ_aubv(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, const Number, const Number, const ::MemorySpace::MemorySpaceData< Number, MemorySpace > &, const ::MemorySpace::MemorySpaceData< Number, MemorySpace > &, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static void set(const std::shared_ptr<::parallel::internal::TBBPartitioner > &, const size_type, const Number, ::MemorySpace::MemorySpaceData< Number, MemorySpace > &)
static constexpr std::enable_if< std::is_same< Dummy, number >::value &&is_cuda_compatible< Dummy >::value, real_type >::type abs_square(const number &x)
static real_type abs(const number &x)