34 use,
intrinsic :: iso_c_binding, only: c_ptr, c_int
38 use mpi_f08,
only: mpi_sum, mpi_in_place, mpi_allreduce
76 type(c_ptr) :: a_d, b_d
85 call neko_error(
'no device backend configured')
91 type(c_ptr) :: a_d, b_d, mask_d
100 call neko_error(
'no device backend configured')
105 type(c_ptr) :: a_d, b_d, mask_d
112 call neko_error(
'No OpenCL bcknd, masked red copy')
114 call neko_error(
'no device backend configured')
122 real(kind=
rp),
intent(in) :: c
124 type(c_ptr) :: mask_d
133 call neko_error(
'No device backend configured')
148 call neko_error(
'No device backend configured')
156 real(kind=
rp),
parameter :: one = 1.0_rp
157 #if HAVE_HIP || HAVE_CUDA || HAVE_OPENCL
160 call neko_error(
'No device backend configured')
167 real(kind=
rp),
intent(in) :: c
176 call neko_error(
'No device backend configured')
182 type(c_ptr) :: a_d, b_d
183 real(kind=
rp),
intent(in) :: c
192 call neko_error(
'No device backend configured')
199 real(kind=
rp),
intent(in) :: c
208 call neko_error(
'No device backend configured')
216 real(kind=
rp),
intent(in) :: c
225 call neko_error(
'No device backend configured')
232 real(kind=
rp),
intent(in) :: c
241 call neko_error(
'No device backend configured')
247 type(c_ptr) :: a_d, b_d
256 call neko_error(
'No device backend configured')
261 type(c_ptr) :: a_d, b_d, c_d, d_d
264 call hip_add4(a_d, b_d, c_d, d_d, n)
270 call neko_error(
'No device backend configured')
275 type(c_ptr) :: a_d, b_d
285 call neko_error(
'No device backend configured')
292 type(c_ptr) :: a_d, b_d
302 call neko_error(
'No device backend configured')
308 type(c_ptr) :: a_d, b_d
318 call neko_error(
'No device backend configured')
324 type(c_ptr) :: a_d, b_d, c_d
333 call neko_error(
'No device backend configured')
339 type(c_ptr) :: a_d, b_d, c_d
340 real(kind=
rp) :: c1, c2
349 call neko_error(
'No device backend configured')
364 call neko_error(
'No device backend configured')
370 type(c_ptr) :: a_d, b_d
379 call neko_error(
'No device backend configured')
385 type(c_ptr) :: a_d, b_d
394 call neko_error(
'No device backend configured')
400 type(c_ptr) :: a_d, b_d, c_d
409 call neko_error(
'No device backend configured')
415 type(c_ptr) :: a_d, b_d, c_d
424 call neko_error(
'No device backend configured')
430 type(c_ptr) :: a_d, b_d
439 call neko_error(
'No device backend configured')
445 type(c_ptr) :: a_d, b_d, c_d
454 call neko_error(
'No device backend configured')
460 type(c_ptr) :: a_d, b_d, c_d
469 call neko_error(
'No device backend configured')
475 type(c_ptr) :: a_d, b_d, c_d, d_d
484 call neko_error(
'No device backend configured')
491 type(c_ptr) :: dot_d, u1_d, u2_d, u3_d, v1_d, v2_d, v3_d
494 call hip_vdot3(dot_d, u1_d, u2_d, u3_d, v1_d, v2_d, v3_d, n)
496 call cuda_vdot3(dot_d, u1_d, u2_d, u3_d, v1_d, v2_d, v3_d, n)
498 call opencl_vdot3(dot_d, u1_d, u2_d, u3_d, v1_d, v2_d, v3_d, n)
500 call neko_error(
'No device backend configured')
508 type(c_ptr) :: u1_d, u2_d, u3_d
509 type(c_ptr) :: v1_d, v2_d, v3_d
510 type(c_ptr) :: w1_d, w2_d, w3_d
513 call hip_vcross(u1_d, u2_d, u3_d, v1_d, v2_d, v3_d, &
516 call cuda_vcross(u1_d, u2_d, u3_d, v1_d, v2_d, v3_d, &
521 call neko_error(
'No device backend configured')
528 type(c_ptr) :: u_d, v_d, w_d
540 call neko_error(
'No device backend configured')
546 type(c_ptr) :: a_d, b_d, c_d
556 call neko_error(
'No device backend configured')
559 #ifndef HAVE_DEVICE_MPI
561 call mpi_allreduce(mpi_in_place, res, 1, &
568 type(c_ptr),
value :: w_d, v_d_d, mult_d
569 integer(c_int) :: j, n
579 call neko_error(
'No device backend configured')
582 #ifndef HAVE_DEVICE_MPI
584 call mpi_allreduce(mpi_in_place, h, j, &
591 type(c_ptr),
value :: y_d, x_d_d, a_d
592 integer(c_int) :: j, n
600 call neko_error(
'No device backend configured')
606 type(c_ptr) :: a_d, b_d
616 call neko_error(
'No device backend configured')
619 #ifndef HAVE_DEVICE_MPI
621 call mpi_allreduce(mpi_in_place, res, 1, &
639 call neko_error(
'No device backend configured')
642 #ifndef HAVE_DEVICE_MPI
644 call mpi_allreduce(mpi_in_place, res, 1, &
651 integer,
intent(in) :: n
658 call neko_error(
'OPENCL is not implemented for device_absval')
660 call neko_error(
'No device backend configured')
671 type(c_ptr) :: a_d, b_d
675 call neko_error(
'No HIP backend for device_pwmax_vec2')
679 call neko_error(
'No OpenCL backend for device_pwmax_vec2')
681 call neko_error(
'No device backend configured')
688 type(c_ptr) :: a_d, b_d, c_d
692 call neko_error(
'No HIP backend for device_pwmax_vec3')
696 call neko_error(
'No OpenCL backend for device_pwmax_vec3')
698 call neko_error(
'No device backend configured')
707 real(kind=
rp),
intent(in) :: c
711 call neko_error(
'No HIP backend for device_pwmax_sca2')
715 call neko_error(
'No OpenCL backend for device_pwmax_sca2')
717 call neko_error(
'No device backend configured')
725 type(c_ptr) :: a_d, b_d
726 real(kind=
rp),
intent(in) :: c
730 call neko_error(
'No HIP backend for device_pwmax_sca3')
734 call neko_error(
'No OpenCL backend for device_pwmax_sca3')
736 call neko_error(
'No device backend configured')
747 type(c_ptr) :: a_d, b_d
751 call neko_error(
'No HIP backend for device_pwmin_vec2')
755 call neko_error(
'No OpenCL backend for device_pwmin_vec2')
757 call neko_error(
'No device backend configured')
764 type(c_ptr) :: a_d, b_d, c_d
768 call neko_error(
'No HIP backend for device_pwmin_vec3')
772 call neko_error(
'No OpenCL backend for device_pwmin_vec3')
774 call neko_error(
'No device backend configured')
783 real(kind=
rp),
intent(in) :: c
787 call neko_error(
'No HIP backend for device_pwmin_sca2')
791 call neko_error(
'No OpenCL backend for device_pwmin_sca2')
793 call neko_error(
'No device backend configured')
801 type(c_ptr) :: a_d, b_d
802 real(kind=
rp),
intent(in) :: c
806 call neko_error(
'No HIP backend for device_pwmin_sca3')
810 call neko_error(
'No OpenCL backend for device_pwmin_sca3')
812 call neko_error(
'No device backend configured')
type(mpi_comm) neko_comm
MPI communicator.
type(mpi_datatype) mpi_real_precision
MPI type for working precision of REAL types.
integer pe_size
MPI size of communicator.
subroutine, public device_add2(a_d, b_d, n)
Vector addition .
subroutine device_pwmax_sca2(a_d, c, n)
Compute the point-wise maximum of a vector and a scalar .
subroutine, public device_addcol3(a_d, b_d, c_d, n)
Returns .
subroutine, public device_col2(a_d, b_d, n)
Vector multiplication .
subroutine, public device_add2s1(a_d, b_d, c1, n)
subroutine, public device_rzero(a_d, n)
Zero a real vector.
real(kind=rp) function, public device_vlsc3(u_d, v_d, w_d, n)
Compute multiplication sum .
subroutine, public device_rone(a_d, n)
Set all elements to one.
subroutine, public device_add2s2(a_d, b_d, c1, n)
Vector addition with scalar multiplication (multiplication on first argument)
subroutine device_pwmax_vec2(a_d, b_d, n)
Compute the point-wise maximum of two vectors .
subroutine, public device_invcol1(a_d, n)
Invert a vector .
subroutine, public device_col3(a_d, b_d, c_d, n)
Vector multiplication with 3 vectors .
subroutine, public device_add4(a_d, b_d, c_d, d_d, n)
subroutine, public device_cadd(a_d, c, n)
Add a scalar to vector .
subroutine, public device_masked_red_copy(a_d, b_d, mask_d, n, m)
subroutine, public device_vdot3(dot_d, u1_d, u2_d, u3_d, v1_d, v2_d, v3_d, n)
Compute a dot product (3-d version) assuming vector components etc.
subroutine, public device_cmult2(a_d, b_d, c, n)
Multiplication by constant c .
subroutine, public device_vcross(u1_d, u2_d, u3_d, v1_d, v2_d, v3_d, w1_d, w2_d, w3_d, n)
Compute a cross product (3-d version) assuming vector components etc.
subroutine, public device_cmult(a_d, c, n)
Multiplication by constant c .
subroutine device_pwmax_sca3(a_d, b_d, c, n)
Compute the point-wise maximum of a vector and a scalar .
subroutine, public device_absval(a_d, n)
subroutine, public device_masked_copy(a_d, b_d, mask_d, n, m)
Copy a masked vector .
subroutine device_pwmax_vec3(a_d, b_d, c_d, n)
Compute the point-wise maximum of two vectors .
subroutine, public device_add2s2_many(y_d, x_d_d, a_d, j, n)
subroutine device_pwmin_sca3(a_d, b_d, c, n)
Compute the point-wise minimum of a vector and a scalar .
subroutine, public device_cfill_mask(a_d, c, size, mask_d, mask_size)
Fill a constant to a masked vector. .
real(kind=rp) function, public device_glsc2(a_d, b_d, n)
Weighted inner product .
subroutine, public device_sub3(a_d, b_d, c_d, n)
Vector subtraction .
real(kind=rp) function, public device_glsc3(a_d, b_d, c_d, n)
Weighted inner product .
subroutine, public device_add3(a_d, b_d, c_d, n)
Vector addition .
subroutine device_pwmin_vec3(a_d, b_d, c_d, n)
Compute the point-wise minimum of two vectors .
real(kind=rp) function, public device_glsum(a_d, n)
Sum a vector of length n.
subroutine, public device_cadd2(a_d, b_d, c, n)
Add a scalar to vector .
subroutine, public device_copy(a_d, b_d, n)
Copy a vector .
subroutine, public device_add3s2(a_d, b_d, c_d, c1, c2, n)
Returns .
subroutine, public device_subcol3(a_d, b_d, c_d, n)
Returns .
subroutine, public device_glsc3_many(h, w_d, v_d_d, mult_d, j, n)
subroutine, public device_sub2(a_d, b_d, n)
Vector substraction .
subroutine, public device_cfill(a_d, c, n)
Set all elements to a constant c .
subroutine, public device_addcol4(a_d, b_d, c_d, d_d, n)
Returns .
subroutine device_pwmin_sca2(a_d, c, n)
Compute the point-wise minimum of a vector and a scalar .
subroutine device_pwmin_vec2(a_d, b_d, n)
Compute the point-wise minimum of two vectors .
subroutine, public device_invcol2(a_d, b_d, n)
Vector division .
subroutine, public device_addsqr2s2(a_d, b_d, c1, n)
Returns .
integer, parameter, public c_rp
integer, parameter, public rp
Global precision used in computations.