86 use,
intrinsic :: iso_c_binding, only : c_ptr
107 integer,
intent(in),
optional :: n
120 call rzero(a%x, size)
126 integer,
intent(in),
optional :: n
145 integer,
intent(in),
optional :: n
159 call copy(a%x, b%x, size)
165 integer,
intent(in),
optional :: n
167 real(kind=
rp),
intent(in) :: c
179 call cmult(a%x, c, size)
185 integer,
intent(in),
optional :: n
187 real(kind=
rp),
intent(in) :: s
199 call cadd(a%x, s, size)
205 integer,
intent(in),
optional :: n
208 real(kind=
rp),
intent(in) :: s
220 call cadd2(a%x, b%x, s, size)
227 integer,
intent(in),
optional :: n
229 real(kind=
rp),
intent(in) :: c
241 call cfill(a%x, c, size)
247 integer,
intent(in),
optional :: n
267 integer,
intent(in),
optional :: n
282 call invcol3(a%x, b%x, c%x, size)
290 integer,
intent(in),
optional :: n
291 type(
vector_t),
intent(in) :: u1, u2, u3
292 type(
vector_t),
intent(in) :: v1, v2, v3
293 type(
vector_t),
intent(inout) :: dot
304 u1%x_d, u2%x_d, u3%x_d, &
305 v1%x_d, v2%x_d, v3%x_d, &
318 integer,
intent(in),
optional :: n
332 call add2(a%x, b%x, size)
339 integer,
intent(in),
optional :: n
353 call add3(a%x, b%x, c%x, size)
360 integer,
intent(in),
optional :: n
362 type(
vector_t),
intent(in) :: b, c, d
374 call add4(a%x, b%x, c%x, d%x, size)
381 integer,
intent(in),
optional :: n
395 call sub2(a%x, b%x, size)
402 integer,
intent(in),
optional :: n
417 call sub3(a%x, b%x, c%x, size)
426 integer,
intent(in),
optional :: n
429 real(kind=
rp),
intent(in) :: c1
441 call add2s1(a%x, b%x, c1, size)
449 integer,
intent(in),
optional :: n
452 real(kind=
rp),
intent(in) :: c1
464 call add2s2(a%x, b%x, c1, size)
471 integer,
intent(in),
optional :: n
474 real(kind=
rp),
intent(in) :: c1
493 integer,
intent(in),
optional :: n
496 real(kind=
rp),
intent(in) :: c
508 call cmult2(a%x, b%x, c, size)
515 integer,
intent(in),
optional :: n
537 integer,
intent(in),
optional :: n
551 call col2(a%x, b%x, size)
558 integer,
intent(in),
optional :: n
573 call col3(a%x, b%x, c%x, size)
580 integer,
intent(in),
optional :: n
595 call subcol3(a%x, b%x, c%x, size)
602 integer,
intent(in),
optional :: n
606 real(kind=
rp),
intent(in) :: c1, c2
618 call add3s2(a%x, b%x, c%x, c1, c2, size)
625 integer,
intent(in),
optional :: n
640 call addcol3(a%x, b%x, c%x, size)
647 integer,
intent(in),
optional :: n
663 call addcol4(a%x, b%x, c%x, d%x, size)
669 integer,
intent(in),
optional :: n
683 sum =
glsum(a%x, size)
690 integer,
intent(in),
optional :: n
704 val =
glmax(a%x, size)
711 integer,
intent(in),
optional :: n
725 val =
glmin(a%x, size)
731 integer,
intent(in),
optional :: n
733 real(kind=
rp) :: norm
745 norm =
glsc2(a%x, b%x, size)
751 integer,
intent(in),
optional :: n
752 type(
vector_t),
intent(in) :: a, b, c
753 real(kind=
rp) :: norm
765 norm =
glsc3(a%x, b%x, c%x, size)
772 integer,
intent(in),
optional :: n
791 integer,
intent(in),
optional :: n
793 real(kind=
rp) :: norm
819 integer,
intent(in) :: n, n_mask
821 real(kind=
rp),
dimension(n),
intent(in) :: b
822 integer,
dimension(0:n_mask) ::
mask
823 type(c_ptr) :: mask_d, b_d
825 if (n .lt. 1 .or. n_mask .lt. 1)
return
848 integer,
intent(in) :: lx, ly, lz, n_mask
850 real(kind=
rp),
dimension(:, :, :, :),
intent(in) :: b
851 integer,
dimension(0:n_mask),
intent(in) ::
mask
852 integer,
dimension(0:n_mask),
intent(in) :: facet
853 type(c_ptr) :: mask_d, facet_d, b_d
860 size(b, 1),
size(b, 2), lx, ly, lz, n_mask)
875 real(kind=
rp),
dimension(:),
intent(in) :: b
877 integer,
intent(in) :: n
878 type(c_ptr) :: mask_d, b_d
880 if (n .lt. 1 .or.
mask%size() .lt. 1)
return
883 mask_d =
mask%get_d()
902 integer,
intent(in) :: n, n_mask
903 real(kind=
rp),
dimension(n),
intent(inout) :: a
905 integer,
dimension(0:n_mask) ::
mask
906 type(c_ptr) :: mask_d, a_d
908 if (n .lt. 1 .or. n_mask .lt. 1)
return
927 real(kind=
rp),
dimension(:),
intent(inout) :: a
930 integer,
intent(in) :: n
931 type(c_ptr) :: mask_d, a_d
933 if (n .lt. 1 .or.
mask%size() .lt. 1)
return
937 mask_d =
mask%get_d()
948 integer,
intent(in),
optional :: n
950 real(kind=
rp),
intent(in) :: min_value, max_value
959 if (a%size() .lt. 1)
return
964 call cwrap(a%x, min_value, max_value, size)
971 integer,
intent(in),
optional :: n
991 integer,
intent(in),
optional :: n
994 real(kind=
rp),
intent(in) :: p
1006 call power(ap%x, a%x, p, size)
Return the device pointer for an associated Fortran array.
subroutine, public device_masked_scatter_copy_aligned(a_d, b_d, mask_d, n, n_mask, strm)
Scatter a masked vector .
subroutine, public device_add2s1(a_d, b_d, c1, n, strm)
subroutine, public device_sub3(a_d, b_d, c_d, n, strm)
Vector subtraction .
subroutine, public device_masked_scatter_copy_0(a_d, b_d, mask_d, n, n_mask, strm)
Scatter a masked vector .
subroutine, public device_add2s2(a_d, b_d, c1, n, strm)
Vector addition with scalar multiplication (multiplication on first argument)
real(kind=rp) function, public device_glmax(a_d, n, strm)
Max of a vector of length n.
subroutine, public device_add2(a_d, b_d, n, strm)
Vector addition .
subroutine, public device_addcol3(a_d, b_d, c_d, n, strm)
Returns .
real(kind=rp) function, public device_glsum(a_d, n, strm)
Sum a vector of length n.
subroutine, public device_invcol1(a_d, n, strm)
Invert a vector .
subroutine, public device_add3s2(a_d, b_d, c_d, c1, c2, n, strm)
Returns .
subroutine, public device_rzero(a_d, n, strm)
Zero a real vector.
subroutine, public device_rone(a_d, n, strm)
Set all elements to one.
subroutine, public device_cmult(a_d, c, n, strm)
Multiplication by constant c .
subroutine, public device_vdot3(dot_d, u1_d, u2_d, u3_d, v1_d, v2_d, v3_d, n, strm)
Compute a dot product (3-d version) assuming vector components etc.
real(kind=rp) function, public device_glsubnorm(a_d, b_d, n, strm)
Returns the norm of the difference of two vectors .
subroutine, public device_cadd2(a_d, b_d, c, n, strm)
Add a scalar to vector .
subroutine, public device_sub2(a_d, b_d, n, strm)
Vector substraction .
subroutine, public device_copy(a_d, b_d, n, strm)
Copy a vector .
subroutine, public device_invcol3(a_d, b_d, c_d, n, strm)
Vector division .
subroutine, public device_power(ap_d, a_d, p, n, strm)
Take the power of a vector .
subroutine, public device_col2(a_d, b_d, n, strm)
Vector multiplication .
subroutine, public device_masked_gather_copy_aligned(a_d, b_d, mask_d, n, n_mask, strm)
Gather a masked vector .
subroutine, public device_add4(a_d, b_d, c_d, d_d, n, strm)
subroutine, public device_subcol3(a_d, b_d, c_d, n, strm)
Returns .
subroutine, public device_absval(a_d, n, strm)
subroutine, public device_masked_gather_copy_0(a_d, b_d, mask_d, n, n_mask, strm)
Gather a masked vector .
subroutine, public device_invcol2(a_d, b_d, n, strm)
Vector division .
subroutine, public device_addsqr2s2(a_d, b_d, c1, n, strm)
Returns .
real(kind=rp) function, public device_glsc3(a_d, b_d, c_d, n, strm)
Weighted inner product .
subroutine, public device_cwrap(a_d, min_val, max_val, n, strm)
Wrap value around a range (min, max)
subroutine, public device_face_masked_gather_copy_0(a_d, b_d, mask_d, facet_d, n1, n2, lx, ly, lz, n_mask, strm)
Gather a face-local SEM field .
real(kind=rp) function, public device_glsc2(a_d, b_d, n, strm)
Weighted inner product .
subroutine, public device_cmult2(a_d, b_d, c, n, strm)
Multiplication by constant c .
subroutine, public device_col3(a_d, b_d, c_d, n, strm)
Vector multiplication with 3 vectors .
subroutine, public device_addcol4(a_d, b_d, c_d, d_d, n, strm)
Returns .
subroutine, public device_cfill(a_d, c, n, strm)
Set all elements to a constant c .
subroutine, public device_add3(a_d, b_d, c_d, n, strm)
Vector addition .
subroutine, public device_sqrt_inplace(a_d, n, strm)
Sqrt a vector .
real(kind=rp) function, public device_glmin(a_d, n, strm)
Min of a vector of length n.
Device abstraction, common interface for various accelerators.
Object for handling masks in Neko.
subroutine, public cmult(a, c, n)
Multiplication by constant c .
subroutine, public cmult2(a, b, c, n)
Multiplication by constant c .
subroutine, public invcol2(a, b, n)
Vector division .
subroutine, public sqrt_inplace(a, n)
Sqrt a vector .
real(kind=rp) function, public glsc3(a, b, c, n)
Weighted inner product .
subroutine, public masked_scatter_copy(a, b, mask, n, n_mask)
Scatter a contigous vector to masked positions in a target array .
subroutine, public cadd2(a, b, s, n)
Add a scalar to vector .
subroutine, public face_masked_gather_copy_0(a, b, mask, facet, lx, ly, lz, n_mask)
Gather values from a face-local SEM field to a reduced contiguous vector.
subroutine, public cadd(a, s, n)
Add a scalar to vector .
subroutine, public addsqr2s2(a, b, c1, n)
Returns .
subroutine, public cwrap(a, min_val, max_val, n)
Wrap value around a range [min, max)
subroutine, public add2s1(a, b, c1, n)
Vector addition with scalar multiplication (multiplication on first argument)
real(kind=rp) function, public glsc2(a, b, n)
Weighted inner product .
subroutine, public masked_scatter_copy_0(a, b, mask, n, n_mask)
Scatter a contigous vector to masked positions in a target array .
subroutine, public subcol3(a, b, c, n)
Returns .
subroutine, public rone(a, n)
Set all elements to one.
subroutine, public masked_gather_copy(a, b, mask, n, n_mask)
Gather a masked vector to reduced contigous vector .
subroutine, public add3(a, b, c, n)
Vector addition .
real(kind=rp) function, public glsum(a, n)
Sum a vector of length n.
subroutine, public sub3(a, b, c, n)
Vector subtraction .
subroutine, public addcol4(a, b, c, d, n)
Returns .
subroutine, public add2(a, b, n)
Vector addition .
subroutine, public cfill(a, c, n)
Set all elements to a constant c .
subroutine, public absval(a, n)
Take the absolute value of an array.
subroutine, public invcol3(a, b, c, n)
Invert a vector .
subroutine, public add3s2(a, b, c, c1, c2, n)
Returns .
subroutine, public masked_gather_copy_0(a, b, mask, n, n_mask)
Gather a masked vector to reduced contigous vector .
subroutine, public addcol3(a, b, c, n)
Returns .
subroutine, public invcol1(a, n)
Invert a vector .
subroutine, public col2(a, b, n)
Vector multiplication .
real(kind=rp) function, public glmax(a, n)
Max of a vector of length n.
subroutine, public copy(a, b, n)
Copy a vector .
subroutine, public add4(a, b, c, d, n)
Vector addition .
subroutine, public col3(a, b, c, n)
Vector multiplication with 3 vectors .
subroutine, public vdot3(dot, u1, u2, u3, v1, v2, v3, n)
Compute a dot product (3-d version) assuming vector components etc.
subroutine, public rzero(a, n)
Zero a real vector.
real(kind=rp) function, public glsubnorm(a, b, n)
Returns the norm of the difference of two vectors .
subroutine, public sub2(a, b, n)
Vector substraction .
subroutine, public add2s2(a, b, c1, n)
Vector addition with scalar multiplication (multiplication on second argument)
real(kind=rp) function, public glmin(a, n)
Min of a vector of length n.
subroutine, public power(ap, a, p, n)
Take the power of a vector .
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
subroutine, public vector_masked_gather_copy_0(a, b, mask, n, n_mask)
Gather a vector to reduced contigous array .
real(kind=rp) function, public vector_glmin(a, n)
Global minimum of all elements in a vector .
real(kind=rp) function, public vector_glsc3(a, b, c, n)
subroutine, public vector_add2(a, b, n)
Vector addition .
subroutine, public vector_vdot3(dot, u1, u2, u3, v1, v2, v3, n)
Compute a dot product (3-d version) assuming vector components etc.
subroutine, public vector_copy(a, b, n)
Copy a vector .
subroutine, public vector_sub3(a, b, c, n)
Vector subtraction .
subroutine, public vector_power(ap, a, p, n)
Take the power of a vector .
subroutine, public vector_cmult(a, c, n)
Multiplication by constant c .
subroutine, public vector_invcol1(a, n)
Invert a vector .
subroutine, public vector_add3s2(a, b, c, c1, c2, n)
Returns .
subroutine, public vector_masked_gather_copy(a, b, mask, n)
Gather a vector to reduced contigous array .
subroutine, public vector_sub2(a, b, n)
Vector substraction .
subroutine, public vector_face_masked_gather_copy_0(a, b, mask, facet, lx, ly, lz, n_mask)
Gather a face-local SEM field to a reduced contiguous vector.
subroutine, public vector_addsqr2s2(a, b, c1, n)
Returns .
subroutine, public vector_absval(a, n)
Compute the pointwise absolute value of a vector .
subroutine, public vector_col2(a, b, n)
Vector multiplication .
subroutine, public vector_cadd2(a, b, s, n)
Add a scalar to vector .
subroutine, public vector_cfill(a, c, n)
Set all elements to a constant c .
real(kind=rp) function, public vector_glsum(a, n)
subroutine, public vector_cwrap(a, min_value, max_value, n)
Wrap vector elements into the range [min_value, max_value)
real(kind=rp) function, public vector_glsc2(a, b, n)
subroutine, public vector_addcol3(a, b, c, n)
Returns .
real(kind=rp) function, public vector_glsubnorm(a, b, n)
subroutine, public vector_invcol2(a, b, n)
Vector division .
subroutine, public vector_sqrt_inplace(a, n)
Sqrt a vector .
subroutine, public vector_subcol3(a, b, c, n)
Returns .
subroutine, public vector_cadd(a, s, n)
Add a scalar to vector .
subroutine vector_add4(a, b, c, d, n)
Vector addition .
subroutine, public vector_add3(a, b, c, n)
Vector addition .
real(kind=rp) function, public vector_glmax(a, n)
Global maximum of all elements in a vector .
subroutine, public vector_add2s1(a, b, c1, n)
Vector addition with scalar multiplication (multiplication on first argument)
subroutine, public vector_add2s2(a, b, c1, n)
Vector addition with scalar multiplication (multiplication on second argument)
subroutine, public vector_addcol4(a, b, c, d, n)
Returns .
subroutine, public vector_masked_scatter_copy(a, b, mask, n)
Scatter a contiguous vector into an array .
subroutine, public vector_cmult2(a, b, c, n)
Multiplication by constant c .
subroutine, public vector_rone(a, n)
Set all elements to one.
subroutine, public vector_rzero(a, n)
Zero a real vector.
subroutine, public vector_col3(a, b, c, n)
Vector multiplication with 3 vectors .
subroutine, public vector_masked_scatter_copy_0(a, b, mask, n, n_mask)
Scatter a contiguous vector into an array .
subroutine, public vector_invcol3(a, b, c, n)
Invert a vector .
Type for consistently handling masks in Neko. This type encapsulates the mask array and its associate...