86 use,
intrinsic :: iso_c_binding, only : c_ptr
108 integer,
intent(in),
optional :: n
109 type(
field_t),
intent(inout) :: a
121 call rzero(a%x, size)
127 integer,
intent(in),
optional :: n
128 type(
field_t),
intent(inout) :: a
146 integer,
intent(in),
optional :: n
148 type(
field_t),
intent(inout) :: a
160 call copy(a%x, b%x, size)
166 integer,
intent(in),
optional :: n
167 type(
field_t),
intent(inout) :: a
168 real(kind=
rp),
intent(in) :: c
180 call cmult(a%x, c, size)
186 integer,
intent(in),
optional :: n
187 type(
field_t),
intent(inout) :: a
188 real(kind=
rp),
intent(in) :: s
200 call cadd(a%x, s, size)
206 integer,
intent(in),
optional :: n
207 type(
field_t),
intent(inout) :: a
208 real(kind=
rp),
intent(in) :: c
220 call cfill(a%x, c, size)
226 integer,
intent(in),
optional :: n
227 type(
field_t),
intent(inout) :: a
246 integer,
intent(in),
optional :: n
247 type(
field_t),
intent(inout) :: a
261 call invcol3(a%x, b%x, c%x, size)
269 integer,
intent(in),
optional :: n
270 type(
field_t),
intent(in) :: u1, u2, u3
271 type(
field_t),
intent(in) :: v1, v2, v3
272 type(
field_t),
intent(inout) :: dot
283 u1%x_d, u2%x_d, u3%x_d, &
284 v1%x_d, v2%x_d, v3%x_d, &
297 integer,
intent(in),
optional :: n
298 type(
field_t),
intent(inout) :: a
311 call add2(a%x, b%x, size)
318 integer,
intent(in),
optional :: n
319 type(
field_t),
intent(inout) :: a
320 type(
field_t),
intent(in) :: b, c
332 call add3(a%x, b%x, c%x, size)
339 integer,
intent(in),
optional :: n
340 type(
field_t),
intent(inout) :: a
341 type(
field_t),
intent(in) :: b, c, d
353 call add4(a%x, b%x, c%x, d%x, size)
360 integer,
intent(in),
optional :: n
361 type(
field_t),
intent(inout) :: a
362 type(
field_t),
intent(inout) :: b
374 call sub2(a%x, b%x, size)
381 integer,
intent(in),
optional :: n
382 type(
field_t),
intent(inout) :: a
396 call sub3(a%x, b%x, c%x, size)
405 integer,
intent(in),
optional :: n
406 type(
field_t),
intent(inout) :: a
407 type(
field_t),
intent(inout) :: b
408 real(kind=
rp),
intent(in) :: c1
420 call add2s1(a%x, b%x, c1, size)
428 integer,
intent(in),
optional :: n
429 type(
field_t),
intent(inout) :: a
430 type(
field_t),
intent(inout) :: b
431 real(kind=
rp),
intent(in) :: c1
443 call add2s2(a%x, b%x, c1, size)
450 integer,
intent(in),
optional :: n
451 type(
field_t),
intent(inout) :: a
453 real(kind=
rp),
intent(in) :: c1
472 integer,
intent(in),
optional :: n
473 type(
field_t),
intent(inout) :: a
475 real(kind=
rp),
intent(in) :: c
487 call cmult2(a%x, b%x, c, size)
494 integer,
intent(in),
optional :: n
495 type(
field_t),
intent(inout) :: a
516 integer,
intent(in),
optional :: n
517 type(
field_t),
intent(inout) :: a
530 call col2(a%x, b%x, size)
537 integer,
intent(in),
optional :: n
538 type(
field_t),
intent(inout) :: a
552 call col3(a%x, b%x, c%x, size)
559 integer,
intent(in),
optional :: n
560 type(
field_t),
intent(inout) :: a
574 call subcol3(a%x, b%x, c%x, size)
581 integer,
intent(in),
optional :: n
582 type(
field_t),
intent(inout) :: a
585 real(kind=
rp),
intent(in) :: c1, c2
597 call add3s2(a%x, b%x, c%x, c1, c2, size)
604 integer,
intent(in),
optional :: n
605 type(
field_t),
intent(inout) :: a
619 call addcol3(a%x, b%x, c%x, size)
626 integer,
intent(in),
optional :: n
627 type(
field_t),
intent(inout) :: a
630 real(kind=
rp),
intent(in) :: s
649 integer,
intent(in),
optional :: n
650 type(
field_t),
intent(inout) :: a
665 call addcol4(a%x, b%x, c%x, d%x, size)
671 integer,
intent(in),
optional :: n
685 sum =
glsum(a%x, size)
692 integer,
intent(in),
optional :: n
706 val =
glmax(a%x, size)
713 integer,
intent(in),
optional :: n
727 val =
glmin(a%x, size)
733 integer,
intent(in),
optional :: n
734 type(
field_t),
intent(in) :: a, b
735 real(kind=
rp) :: norm
747 norm =
glsc2(a%x, b%x, size)
753 integer,
intent(in),
optional :: n
754 type(
field_t),
intent(in) :: a, b, c
755 real(kind=
rp) :: norm
767 norm =
glsc3(a%x, b%x, c%x, size)
773 integer,
intent(in),
optional :: n
774 type(
field_t),
intent(in) :: a, b
775 real(kind=
rp) :: norm
801 integer,
intent(in) :: n, n_mask
802 real(kind=
rp),
dimension(n_mask),
intent(inout) :: a
804 integer,
dimension(0:n_mask) ::
mask
805 type(c_ptr) :: mask_d, a_d
824 type(
field_t),
intent(inout) :: a
825 real(kind=
rp),
dimension(:),
intent(inout) :: b
827 integer,
intent(in) :: n
828 type(c_ptr) :: mask_d, b_d
831 mask_d =
mask%get_d()
850 integer,
intent(in) :: n, n_mask
851 real(kind=
rp),
dimension(n_mask),
intent(in) :: b
852 type(
field_t),
intent(inout) :: a
853 integer,
dimension(0:n_mask) ::
mask
854 type(c_ptr) :: mask_d, b_d
869 integer,
intent(in),
optional :: n
870 type(
field_t),
intent(inout) :: a
883 call pwmax2(a%x, b%x, size)
891 integer,
intent(in),
optional :: n
892 type(
field_t),
intent(inout) :: a
906 call pwmax3(a%x, b%x, c%x, size)
913 integer,
intent(in),
optional :: n
914 type(
field_t),
intent(inout) :: a
915 real(kind=
rp),
intent(in) :: b
935 integer,
intent(in),
optional :: n
936 type(
field_t),
intent(inout) :: a
938 real(kind=
rp),
intent(in) :: c
950 call cpwmax3(a%x, b%x, c, size)
958 integer,
intent(in),
optional :: n
959 type(
field_t),
intent(inout) :: a
972 call pwmin2(a%x, b%x, size)
980 integer,
intent(in),
optional :: n
981 type(
field_t),
intent(inout) :: a
995 call pwmin3(a%x, b%x, c%x, size)
1002 integer,
intent(in),
optional :: n
1003 type(
field_t),
intent(inout) :: a
1004 real(kind=
rp),
intent(in) :: b
1007 if (
present(n))
then
1024 integer,
intent(in),
optional :: n
1025 type(
field_t),
intent(inout) :: a
1026 type(
field_t),
intent(in) :: b
1027 real(kind=
rp),
intent(in) :: c
1030 if (
present(n))
then
1039 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_addcol3s2(a_d, b_d, c_d, s, n, strm)
Returns .
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_addcol3s2(a, b, c, s, n)
Returns .
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 addcol3s2(a, b, c, s, n)
Returns .
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...