41 use,
intrinsic :: iso_c_binding
47 real(kind=
rp),
allocatable :: x(:)
49 type(c_ptr) :: x_d = c_null_ptr
51 integer,
private :: n = 0
82 integer,
intent(in) :: n
85 call cfill(v%x, 0.0_rp, n)
95 integer,
intent(in) :: n
98 if (a%n .eq. n)
return
113 if (
allocated(v%x))
then
117 if (c_associated(v%x_d))
then
141 call copy(v%x, w%x, v%n)
149 real(kind=
rp),
intent(in) :: s
154 call cfill(v%x, s, v%n)
Map a Fortran array to a device (allocate and associate)
subroutine, public device_copy(a_d, b_d, n, strm)
Copy a vector .
subroutine, public device_cfill(a_d, c, n, strm)
Set all elements to a constant c .
Device abstraction, common interface for various accelerators.
subroutine, public device_free(x_d)
Deallocate memory on the device.
subroutine, public cfill(a, c, n)
Set all elements to a constant c .
subroutine, public copy(a, b, n)
Copy a vector .
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
subroutine vector_init(v, n)
Initialise a vector of size n.
subroutine vector_assign_scalar(v, s)
Assignment .
subroutine vector_free(v)
Deallocate a vector.
pure integer function vector_size(v)
Return the number of entries in the vector.
subroutine vector_allocate(a, n)
Vector allocation without initialisation.
subroutine vector_assign_vector(v, w)
Assignment .