43 use num_types,
only: rp
44 use vector,
only: vector_t
45 use neko_config,
only: neko_bcknd_device
66 type(vector_t),
intent(inout) :: s
67 type(vector_t),
intent(in) :: x
68 real(kind=rp),
intent(in) :: xmin, xmax
69 integer,
intent(in),
optional :: n
79 if (n_local .lt. 1)
return
81 if (neko_bcknd_device .eq. 1)
then
104 type(vector_t),
intent(inout) :: delta
105 type(vector_t),
intent(in) :: x, x1, x2
106 real(kind=rp),
intent(in) :: dec, inc, dmin, dmax
107 integer,
intent(in),
optional :: n
113 n_local = delta%size()
117 if (n_local .lt. 1)
return
119 if (neko_bcknd_device .eq. 1)
then
121 dec, inc, dmin, dmax, n_local)
124 dec, inc, dmin, dmax, n_local)
146 type(vector_t),
intent(inout) :: x_new
147 type(vector_t),
intent(in) :: x, s, delta
148 real(kind=rp),
intent(in) :: psi, smax, xmin, xmax
149 integer,
intent(in),
optional :: n
155 n_local = x_new%size()
159 if (n_local .lt. 1)
return
161 if (neko_bcknd_device .eq. 1)
then
163 psi, smax, xmin, xmax, n_local)
166 psi, smax, xmin, xmax, n_local)
Device backend dispatch for the steepest-descent optimizer kernels.
subroutine, public device_sd_update_move_limits(delta_d, x_d, x1_d, x2_d, dec, inc, dmin, dmax, n)
Adapt the move limits on the device (Eq. D23).
subroutine, public device_sd_update_design(x_new_d, x_d, s_d, delta_d, psi, smax, xmin, xmax, n)
Move-limited, box-constrained design update on the device (Eq. D24).
subroutine, public device_sd_direction(s_d, x_d, xmin, xmax, n)
Bound-projected steepest-descent direction on the device (Eq. D22).
CPU backend for the steepest-descent optimizer kernels.
subroutine, public sd_direction_cpu(s, x, xmin, xmax, n)
Bound-projected steepest-descent direction on CPU (Eq. D22).
subroutine, public sd_update_move_limits_cpu(delta, x, x1, x2, dec, inc, dmin, dmax, n)
Adapt the move limits on CPU (Eq. D23).
subroutine, public sd_update_design_cpu(x_new, x, s, delta, psi, smax, xmin, xmax, n)
Move-limited, box-constrained design update on CPU (Eq. D24).
Vector-level kernels of the steepest-descent optimizer.
subroutine, public sd_update_move_limits(delta, x, x1, x2, dec, inc, dmin, dmax, n)
Adapt the move limits (Eq. D23).
subroutine, public sd_update_design(x_new, x, s, delta, psi, smax, xmin, xmax, n)
Move-limited, box-constrained design update (Eq. D24).
subroutine, public sd_direction(s, x, xmin, xmax, n)
Bound-projected steepest-descent direction (Eq. D22).