66 use math,
only :
rzero,
rone,
copy,
cmult,
cadd,
cfill,
invcol1,
vdot3,
add2, &
84 use,
intrinsic :: iso_c_binding, only : c_ptr
105 integer,
intent(in),
optional :: n
106 type(
field_t),
intent(inout) :: a
118 call rzero(a%x, size)
124 integer,
intent(in),
optional :: n
125 type(
field_t),
intent(inout) :: a
143 integer,
intent(in),
optional :: n
145 type(
field_t),
intent(inout) :: a
157 call copy(a%x, b%x, size)
163 integer,
intent(in),
optional :: n
164 type(
field_t),
intent(inout) :: a
165 real(kind=
rp),
intent(in) :: c
177 call cmult(a%x, c, size)
183 integer,
intent(in),
optional :: n
184 type(
field_t),
intent(inout) :: a
185 real(kind=
rp),
intent(in) :: s
197 call cadd(a%x, s, size)
203 integer,
intent(in),
optional :: n
204 type(
field_t),
intent(inout) :: a
205 real(kind=
rp),
intent(in) :: c
217 call cfill(a%x, c, size)
223 integer,
intent(in),
optional :: n
224 type(
field_t),
intent(inout) :: a
243 integer,
intent(in),
optional :: n
244 type(
field_t),
intent(inout) :: a
258 call invcol3(a%x, b%x, c%x, size)
266 integer,
intent(in),
optional :: n
267 type(
field_t),
intent(in) :: u1, u2, u3
268 type(
field_t),
intent(in) :: v1, v2, v3
269 type(
field_t),
intent(out) :: dot
280 u1%x_d, u2%x_d, u3%x_d, &
281 v1%x_d, v2%x_d, v3%x_d, &
294 integer,
intent(in),
optional :: n
295 type(
field_t),
intent(inout) :: a
308 call add2(a%x, b%x, size)
315 integer,
intent(in),
optional :: n
316 type(
field_t),
intent(inout) :: a
317 type(
field_t),
intent(in) :: b, c
329 call add3(a%x, b%x, c%x, size)
336 integer,
intent(in),
optional :: n
337 type(
field_t),
intent(inout) :: a
338 type(
field_t),
intent(in) :: b, c, d
350 call add4(a%x, b%x, c%x, d%x, size)
357 integer,
intent(in),
optional :: n
358 type(
field_t),
intent(inout) :: a
359 type(
field_t),
intent(inout) :: b
371 call sub2(a%x, b%x, size)
378 integer,
intent(in),
optional :: n
379 type(
field_t),
intent(inout) :: a
393 call sub3(a%x, b%x, c%x, size)
402 integer,
intent(in),
optional :: n
403 type(
field_t),
intent(inout) :: a
404 type(
field_t),
intent(inout) :: b
405 real(kind=
rp),
intent(in) :: c1
417 call add2s1(a%x, b%x, c1, size)
425 integer,
intent(in),
optional :: n
426 type(
field_t),
intent(inout) :: a
427 type(
field_t),
intent(inout) :: b
428 real(kind=
rp),
intent(in) :: c1
440 call add2s2(a%x, b%x, c1, size)
447 integer,
intent(in),
optional :: n
448 type(
field_t),
intent(inout) :: a
450 real(kind=
rp),
intent(in) :: c1
469 integer,
intent(in),
optional :: n
470 type(
field_t),
intent(inout) :: a
472 real(kind=
rp),
intent(in) :: c
484 call cmult2(a%x, b%x, c, size)
491 integer,
intent(in),
optional :: n
492 type(
field_t),
intent(inout) :: a
513 integer,
intent(in),
optional :: n
514 type(
field_t),
intent(inout) :: a
527 call col2(a%x, b%x, size)
534 integer,
intent(in),
optional :: n
535 type(
field_t),
intent(inout) :: a
549 call col3(a%x, b%x, c%x, size)
556 integer,
intent(in),
optional :: n
557 type(
field_t),
intent(inout) :: a
571 call subcol3(a%x, b%x, c%x, size)
578 integer,
intent(in),
optional :: n
579 type(
field_t),
intent(inout) :: a
582 real(kind=
rp),
intent(in) :: c1, c2
594 call add3s2(a%x, b%x, c%x, c1, c2, size)
601 integer,
intent(in),
optional :: n
602 type(
field_t),
intent(inout) :: a
616 call addcol3(a%x, b%x, c%x, size)
623 integer,
intent(in),
optional :: n
624 type(
field_t),
intent(inout) :: a
639 call addcol4(a%x, b%x, c%x, d%x, size)
645 integer,
intent(in),
optional :: n
659 sum =
glsum(a%x, size)
666 integer,
intent(in),
optional :: n
680 val =
glmax(a%x, size)
687 integer,
intent(in),
optional :: n
701 val =
glmin(a%x, size)
707 integer,
intent(in),
optional :: n
708 type(
field_t),
intent(in) :: a, b
709 real(kind=
rp) :: norm
721 norm =
glsc2(a%x, b%x, size)
727 integer,
intent(in),
optional :: n
728 type(
field_t),
intent(in) :: a, b, c
729 real(kind=
rp) :: norm
741 norm =
glsc3(a%x, b%x, c%x, size)
747 integer,
intent(in),
optional :: n
748 type(
field_t),
intent(in) :: a, b
749 real(kind=
rp) :: norm
775 integer,
intent(in) :: n, n_mask
776 real(kind=
rp),
dimension(n_mask),
intent(inout) :: a
778 integer,
dimension(0:n_mask) ::
mask
779 type(c_ptr) :: mask_d, a_d
798 type(
field_t),
intent(inout) :: a
799 real(kind=
rp),
dimension(:),
intent(inout) :: b
801 integer,
intent(in) :: n
802 type(c_ptr) :: mask_d, b_d
805 mask_d =
mask%get_d()
824 integer,
intent(in) :: n, n_mask
825 real(kind=
rp),
dimension(n_mask),
intent(in) :: b
826 type(
field_t),
intent(inout) :: a
827 integer,
dimension(0:n_mask) ::
mask
828 type(c_ptr) :: mask_d, b_d
843 integer,
intent(in),
optional :: n
844 type(
field_t),
intent(inout) :: a
857 call pwmax2(a%x, b%x, size)
865 integer,
intent(in),
optional :: n
866 type(
field_t),
intent(inout) :: a
880 call pwmax3(a%x, b%x, c%x, size)
887 integer,
intent(in),
optional :: n
888 type(
field_t),
intent(inout) :: a
889 real(kind=
rp),
intent(in) :: b
909 integer,
intent(in),
optional :: n
910 type(
field_t),
intent(inout) :: a
912 real(kind=
rp),
intent(in) :: c
924 call cpwmax3(a%x, b%x, c, size)
932 integer,
intent(in),
optional :: n
933 type(
field_t),
intent(inout) :: a
946 call pwmin2(a%x, b%x, size)
954 integer,
intent(in),
optional :: n
955 type(
field_t),
intent(inout) :: a
969 call pwmin3(a%x, b%x, c%x, size)
976 integer,
intent(in),
optional :: n
977 type(
field_t),
intent(inout) :: a
978 real(kind=
rp),
intent(in) :: b
998 integer,
intent(in),
optional :: n
999 type(
field_t),
intent(inout) :: a
1000 type(
field_t),
intent(in) :: b
1001 real(kind=
rp),
intent(in) :: c
1004 if (
present(n))
then
1013 call cpwmin3(a%x, b%x, c, size)
Return the device pointer for an associated Fortran array.
subroutine, public device_pwmin2(a_d, b_d, n, strm)
Compute the point-wise minimum of two vectors .
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_pwmax3(a_d, b_d, c_d, n, strm)
Compute the point-wise maximum of two vectors .
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_cpwmax3(a_d, b_d, c, n, strm)
Compute the point-wise maximum of a vector and a scalar .
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_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_pwmin3(a_d, b_d, c_d, n, strm)
Compute the point-wise minimum of two vectors .
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_cpwmax2(a_d, c, n, strm)
Compute the point-wise maximum of a vector and a scalar .
subroutine, public device_subcol3(a_d, b_d, c_d, n, strm)
Returns .
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_cpwmin3(a_d, b_d, c, n, strm)
Compute the point-wise minimum of a vector and a scalar .
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_cpwmin2(a_d, c, n, strm)
Compute the point-wise minimum of a vector and a scalar .
subroutine, public device_add3(a_d, b_d, c_d, n, strm)
Vector addition .
real(kind=rp) function, public device_glmin(a_d, n, strm)
Min of a vector of length n.
subroutine, public device_pwmax2(a_d, b_d, n, strm)
Compute the point-wise maximum of two vectors .
Device abstraction, common interface for various accelerators.
subroutine, public field_cpwmax2(a, b, n)
Point-wise max operation for field and constant .
subroutine, public field_add2s1(a, b, c1, n)
Vector addition with scalar multiplication (multiplication on first argument)
subroutine, public field_cpwmin3(a, b, c, n)
Point-wise min operation for field and constant .
subroutine, public field_invcol2(a, b, n)
Vector division .
subroutine field_add4(a, b, c, d, n)
Vector addition .
subroutine, public field_cadd(a, s, n)
Add a scalar to vector .
subroutine, public field_invcol1(a, n)
Invert a vector .
subroutine, public field_col2(a, b, n)
Vector multiplication .
subroutine, public field_sub2(a, b, n)
Vector substraction .
subroutine, public field_sub3(a, b, c, n)
Vector subtraction .
real(kind=rp) function, public field_glmin(a, n)
Global minimum of all elements in a field .
subroutine, public field_cmult2(a, b, c, n)
Multiplication by constant c .
subroutine, public field_masked_gather_copy(a, b, mask, n)
Gather a field to reduced contiguous array .
real(kind=rp) function, public field_glsc2(a, b, n)
subroutine, public field_cfill(a, c, n)
Set all elements to a constant c .
subroutine, public field_add2s2(a, b, c1, n)
Vector addition with scalar multiplication (multiplication on second argument)
real(kind=rp) function, public field_glmax(a, n)
Global maximum of all elements in a field .
real(kind=rp) function, public field_glsum(a, n)
subroutine, public field_rzero(a, n)
Zero a real vector.
subroutine, public field_addcol3(a, b, c, n)
Returns .
real(kind=rp) function, public field_glsubnorm(a, b, n)
subroutine, public field_rone(a, n)
Set all elements to one.
subroutine, public field_invcol3(a, b, c, n)
Invert a vector .
subroutine, public field_add3s2(a, b, c, c1, c2, n)
Returns .
subroutine, public field_add2(a, b, n)
Vector addition .
subroutine, public field_cpwmin2(a, b, n)
Point-wise min operation for field and constant .
subroutine, public field_pwmax2(a, b, n)
Point-wise max operation .
subroutine, public field_pwmin3(a, b, c, n)
Point-wise min operation .
subroutine, public field_col3(a, b, c, n)
Vector multiplication with 3 vectors .
subroutine, public field_copy(a, b, n)
Copy a vector .
subroutine, public field_subcol3(a, b, c, n)
Returns .
subroutine, public field_add3(a, b, c, n)
Vector addition .
subroutine, public field_pwmax3(a, b, c, n)
Point-wise max operation .
subroutine, public field_cpwmax3(a, b, c, n)
Point-wise max operation for field and constant .
subroutine, public field_cmult(a, c, n)
Multiplication by constant c .
real(kind=rp) function, public field_glsc3(a, b, c, n)
subroutine, public field_addcol4(a, b, c, d, n)
Returns .
subroutine, public field_addsqr2s2(a, b, c1, n)
Returns .
subroutine, public field_vdot3(dot, u1, u2, u3, v1, v2, v3, n)
Compute a dot product (3-d version) assuming vector components etc.
subroutine, public field_pwmin2(a, b, n)
Point-wise min operation .
subroutine, public field_masked_scatter_copy_0(a, b, mask, n, n_mask)
Gather a contiguous array into a field .
subroutine, public field_masked_gather_copy_0(a, b, mask, n, n_mask)
Gather a field to reduced contiguous array .
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 .
real(kind=rp) function, public glsc3(a, b, c, n)
Weighted inner product .
subroutine, public cadd(a, s, n)
Add a scalar to vector .
subroutine, public addsqr2s2(a, b, c1, n)
Returns .
subroutine, public add2s1(a, b, c1, n)
Vector addition with scalar multiplication (multiplication on first argument)
subroutine, public cpwmin2(a, b, n)
Point-wise minimum of scalar and vector .
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 cpwmin3(a, b, c, n)
Point-wise minimum of scalar and vector .
subroutine, public pwmax3(a, b, c, n)
Point-wise maximum of two vectors .
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 invcol3(a, b, c, n)
Invert a vector .
subroutine, public add3s2(a, b, c, c1, c2, n)
Returns .
subroutine, public pwmax2(a, b, n)
Point-wise maximum of two vectors .
subroutine, public pwmin2(a, b, n)
Point-wise minimum of two vectors .
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 cpwmax3(a, b, c, n)
Point-wise maximum of scalar and 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 cpwmax2(a, b, n)
Point-wise maximum of scalar and vector .
subroutine, public sub2(a, b, n)
Vector substraction .
subroutine, public pwmin3(a, b, c, n)
Point-wise minimum of two vectors .
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.
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
Type for consistently handling masks in Neko. This type encapsulates the mask array and its associate...