defined(DEAL_II_WITH_CUDA_AWARE_MPI)
if (std::is_same<MemorySpaceType, MemorySpace::CUDA>::value)
{
- const int n_blocks =
- 1 + (import_indices_plain_dev[i].second - 1) /
- (::dealii::CUDAWrappers::chunk_size *
- ::dealii::CUDAWrappers::block_size);
+ const auto chunk_size = import_indices_plain_dev[i].second;
+ const int n_blocks =
+ 1 + chunk_size / (::dealii::CUDAWrappers::chunk_size *
+ ::dealii::CUDAWrappers::block_size);
::dealii::LinearAlgebra::CUDAWrappers::kernel::
gather<<<n_blocks, ::dealii::CUDAWrappers::block_size>>>(
temp_array_ptr,
import_indices_plain_dev[i].first.get(),
locally_owned_array.data(),
- import_indices_plain_dev[i].second);
+ chunk_size);
}
else
# endif
{
const auto chunk_size = import_indices_plain.second;
const int n_blocks =
- 1 + (chunk_size - 1) / (::dealii::CUDAWrappers::chunk_size *
- ::dealii::CUDAWrappers::block_size);
+ 1 + chunk_size / (::dealii::CUDAWrappers::chunk_size *
+ ::dealii::CUDAWrappers::block_size);
dealii::LinearAlgebra::CUDAWrappers::kernel::
masked_vector_bin_op<Number,
dealii::LinearAlgebra::CUDAWrappers::
{
const auto chunk_size = import_indices_plain.second;
const int n_blocks =
- 1 + (chunk_size - 1) / (::dealii::CUDAWrappers::chunk_size *
- ::dealii::CUDAWrappers::block_size);
+ 1 + chunk_size / (::dealii::CUDAWrappers::chunk_size *
+ ::dealii::CUDAWrappers::block_size);
dealii::LinearAlgebra::CUDAWrappers::kernel::
masked_vector_bin_op<
Number,
{
const auto chunk_size = import_indices_plain.second;
const int n_blocks =
- 1 + (chunk_size - 1) / (::dealii::CUDAWrappers::chunk_size *
- ::dealii::CUDAWrappers::block_size);
+ 1 + chunk_size / (::dealii::CUDAWrappers::chunk_size *
+ ::dealii::CUDAWrappers::block_size);
dealii::LinearAlgebra::CUDAWrappers::kernel::
masked_vector_bin_op<
Number,
{
const auto chunk_size = import_indices_plain.second;
const int n_blocks =
- 1 + (chunk_size - 1) / (::dealii::CUDAWrappers::chunk_size *
- ::dealii::CUDAWrappers::block_size);
+ 1 + chunk_size / (::dealii::CUDAWrappers::chunk_size *
+ ::dealii::CUDAWrappers::block_size);
dealii::LinearAlgebra::CUDAWrappers::kernel::
set_permutated<<<n_blocks,
dealii::CUDAWrappers::block_size>>>(
::dealii::MemorySpace::CUDA>
&data)
{
- const int n_blocks = 1 + (size - 1) / (chunk_size * block_size);
+ const int n_blocks = 1 + size / (chunk_size * block_size);
::dealii::LinearAlgebra::CUDAWrappers::kernel::set<Number>
<<<n_blocks, block_size>>>(data.values_dev.get(), s, size);
::dealii::MemorySpace::CUDA>
&data)
{
- const int n_blocks = 1 + (size - 1) / (chunk_size * block_size);
+ const int n_blocks = 1 + size / (chunk_size * block_size);
::dealii::LinearAlgebra::CUDAWrappers::kernel::add_aV<Number>
<<<n_blocks, block_size>>>(data.values_dev.get(),
1.,
::dealii::MemorySpace::CUDA>
&data)
{
- const int n_blocks = 1 + (size - 1) / (chunk_size * block_size);
+ const int n_blocks = 1 + size / (chunk_size * block_size);
::dealii::LinearAlgebra::CUDAWrappers::kernel::add_aV<Number>
<<<n_blocks, block_size>>>(data.values_dev.get(),
-1.,
::dealii::MemorySpace::CUDA>
&data)
{
- const int n_blocks = 1 + (size - 1) / (chunk_size * block_size);
+ const int n_blocks = 1 + size / (chunk_size * block_size);
::dealii::LinearAlgebra::CUDAWrappers::kernel::vec_add<Number>
<<<n_blocks, block_size>>>(data.values_dev.get(), a, size);
::dealii::MemorySpace::CUDA>
&data)
{
- const int n_blocks = 1 + (size - 1) / (chunk_size * block_size);
+ const int n_blocks = 1 + size / (chunk_size * block_size);
::dealii::LinearAlgebra::CUDAWrappers::kernel::add_aV<Number>
<<<n_blocks, block_size>>>(data.values_dev.get(),
a,
::dealii::MemorySpace::CUDA>
&data)
{
- const int n_blocks = 1 + (size - 1) / (chunk_size * block_size);
+ const int n_blocks = 1 + size / (chunk_size * block_size);
::dealii::LinearAlgebra::CUDAWrappers::kernel::add_aVbW<Number>
<<<dim3(n_blocks, 1), dim3(block_size)>>>(data.values_dev.get(),
a,
::dealii::MemorySpace::CUDA>
&data)
{
- const int n_blocks = 1 + (size - 1) / (chunk_size * block_size);
+ const int n_blocks = 1 + size / (chunk_size * block_size);
::dealii::LinearAlgebra::CUDAWrappers::kernel::sadd<Number>
<<<dim3(n_blocks, 1), dim3(block_size)>>>(
x, data.values_dev.get(), 1., v_data.values_dev.get(), size);
::dealii::MemorySpace::CUDA>
&data)
{
- const int n_blocks = 1 + (size - 1) / (chunk_size * block_size);
+ const int n_blocks = 1 + size / (chunk_size * block_size);
::dealii::LinearAlgebra::CUDAWrappers::kernel::sadd<Number>
<<<dim3(n_blocks, 1), dim3(block_size)>>>(
x, data.values_dev.get(), a, v_data.values_dev.get(), size);
::dealii::MemorySpace::CUDA>
&data)
{
- const int n_blocks = 1 + (size - 1) / (chunk_size * block_size);
+ const int n_blocks = 1 + size / (chunk_size * block_size);
::dealii::LinearAlgebra::CUDAWrappers::kernel::sadd<Number>
<<<dim3(n_blocks, 1), dim3(block_size)>>>(x,
data.values_dev.get(),
::dealii::MemorySpace::CUDA>
&data)
{
- const int n_blocks = 1 + (size - 1) / (chunk_size * block_size);
+ const int n_blocks = 1 + size / (chunk_size * block_size);
::dealii::LinearAlgebra::CUDAWrappers::kernel::vec_scale<Number>
<<<n_blocks, block_size>>>(data.values_dev.get(), factor, size);
::dealii::MemorySpace::CUDA>
&data)
{
- const int n_blocks = 1 + (size - 1) / (chunk_size * block_size);
+ const int n_blocks = 1 + size / (chunk_size * block_size);
::dealii::LinearAlgebra::CUDAWrappers::kernel::scale<Number>
<<<dim3(n_blocks, 1), dim3(block_size)>>>(data.values_dev.get(),
v_data.values_dev.get(),
::dealii::MemorySpace::CUDA>
&data)
{
- const int n_blocks = 1 + (size - 1) / (chunk_size * block_size);
+ const int n_blocks = 1 + size / (chunk_size * block_size);
::dealii::LinearAlgebra::CUDAWrappers::kernel::equ<Number>
<<<dim3(n_blocks, 1), dim3(block_size)>>>(data.values_dev.get(),
a,
::dealii::MemorySpace::CUDA>
&data)
{
- const int n_blocks = 1 + (size - 1) / (chunk_size * block_size);
+ const int n_blocks = 1 + size / (chunk_size * block_size);
::dealii::LinearAlgebra::CUDAWrappers::kernel::equ<Number>
<<<dim3(n_blocks, 1), dim3(block_size)>>>(data.values_dev.get(),
a,
&data)
{
Number * result_device;
- cudaError_t error_code =
- cudaMalloc(&result_device, size * sizeof(Number));
+ cudaError_t error_code = cudaMalloc(&result_device, sizeof(Number));
AssertCuda(error_code);
error_code = cudaMemset(result_device, 0, sizeof(Number));
+ AssertCuda(error_code);
- const int n_blocks = 1 + (size - 1) / (chunk_size * block_size);
+ const int n_blocks = 1 + size / (chunk_size * block_size);
::dealii::LinearAlgebra::CUDAWrappers::kernel::double_vector_reduction<
Number,
::dealii::LinearAlgebra::CUDAWrappers::kernel::DotProduct<Number>>
AssertCuda(error_code);
error_code = cudaMemset(result_device, 0, sizeof(Number));
- const int n_blocks = 1 + (size - 1) / (chunk_size * block_size);
+ const int n_blocks = 1 + size / (chunk_size * block_size);
::dealii::LinearAlgebra::CUDAWrappers::kernel::reduction<
Number,
::dealii::LinearAlgebra::CUDAWrappers::kernel::ElemSum<Number>>
AssertCuda(error_code);
error_code = cudaMemset(result_device, 0, sizeof(Number));
- const int n_blocks = 1 + (size - 1) / (chunk_size * block_size);
+ const int n_blocks = 1 + size / (chunk_size * block_size);
::dealii::LinearAlgebra::CUDAWrappers::kernel::reduction<
Number,
::dealii::LinearAlgebra::CUDAWrappers::kernel::L1Norm<Number>>
error_code = cudaMemset(res_d, 0, sizeof(Number));
AssertCuda(error_code);
- const int n_blocks = 1 + (size - 1) / (chunk_size * block_size);
+ const int n_blocks = 1 + size / (chunk_size * block_size);
::dealii::LinearAlgebra::CUDAWrappers::kernel::add_and_dot<Number>
<<<dim3(n_blocks, 1), dim3(block_size)>>>(res_d,
data.values_dev.get(),