dot_R0R1R1_rel_block Function

private pure function dot_R0R1R1_rel_block(u, v, option, nblock) result(a)

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), contiguous :: u(:)
real(kind=rk), intent(in), contiguous :: v(:)
character(len=*), intent(in), optional :: option
integer, intent(in) :: nblock

Return Value real(kind=rk)


Calls

proc~~dot_r0r1r1_rel_block~~CallsGraph proc~dot_r0r1r1_rel_block fordot::dot_R0R1R1_rel_block proc~compute_block_ranges fordot::compute_block_ranges proc~dot_r0r1r1_rel_block->proc~compute_block_ranges reduce reduce proc~dot_r0r1r1_rel_block->reduce

Called by

proc~~dot_r0r1r1_rel_block~~CalledByGraph proc~dot_r0r1r1_rel_block fordot::dot_R0R1R1_rel_block interface~dot_product fordot::dot_product interface~dot_product->proc~dot_r0r1r1_rel_block

Source Code

   pure function dot_R0R1R1_rel_block(u,v,option,nblock) result(a)
      real(rk),     intent(in), contiguous :: u(:)
      real(rk),     intent(in), contiguous :: v(:)
      character(*), intent(in), optional   :: option
      integer,      intent(in)             :: nblock
      real(rk)                             :: a
      integer                              :: im, se, ee
      integer                              :: block_size(nblock), start_elem(nblock), end_elem(nblock)

      call compute_block_ranges(size(u), nblock, block_size, start_elem, end_elem)
      a = 0.0_rk
#if defined(USE_DO_CONCURRENT)
      do concurrent (im = 1: nblock) reduce(+:a)
         se = start_elem(im)
         ee = end_elem(im)
         a = a + dot_product(u(se:ee),v(se:ee),option)
    end do
#else
      do im = 1, nblock
         se = start_elem(im)
         ee = end_elem(im)
         a = a + dot_product(u(se:ee),v(se:ee),option)
      end do
#endif
   end function dot_R0R1R1_rel_block