Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
Loading...
Searching...
No Matches
device_steepest_descent Module Reference

Device backend dispatch for the steepest-descent optimizer kernels. More...

Functions/Subroutines

subroutine, public device_sd_direction (s_d, x_d, xmin, xmax, n)
 Bound-projected steepest-descent direction on the device (Eq. D22).
 
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).
 

Detailed Description

Binds the CUDA and HIP launch wrappers in bcknd/device/{cuda,hip} and exposes one backend-independent wrapper per kernel. The formulas are those of steepest_descent_cpu.

Function/Subroutine Documentation

◆ device_sd_direction()

subroutine, public device_steepest_descent::device_sd_direction ( type(c_ptr)  s_d,
type(c_ptr)  x_d,
real(kind=rp), intent(in)  xmin,
real(kind=rp), intent(in)  xmax,
integer, intent(in)  n 
)
Parameters
s_dDevice pointer to the gradient on entry, and to the projected direction on exit.
x_dDevice pointer to the design variables.
[in]xminLower bound of the design variables.
[in]xmaxUpper bound of the design variables.
[in]nNumber of design variables.

Definition at line 158 of file device_steepest_descent.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ device_sd_update_design()

subroutine, public device_steepest_descent::device_sd_update_design ( type(c_ptr)  x_new_d,
type(c_ptr)  x_d,
type(c_ptr)  s_d,
type(c_ptr)  delta_d,
real(kind=rp), intent(in)  psi,
real(kind=rp), intent(in)  smax,
real(kind=rp), intent(in)  xmin,
real(kind=rp), intent(in)  xmax,
integer, intent(in)  n 
)
Parameters
x_new_dDevice pointer to the updated design variables.
x_dDevice pointer to the current design variables.
s_dDevice pointer to the bound-projected direction.
delta_dDevice pointer to the move limits.
[in]psiStep length.
[in]smaxGlobal maximum of the absolute value of the direction.
[in]xminLower bound of the design variables.
[in]xmaxUpper bound of the design variables.
[in]nNumber of design variables.

Definition at line 217 of file device_steepest_descent.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ device_sd_update_move_limits()

subroutine, public device_steepest_descent::device_sd_update_move_limits ( type(c_ptr)  delta_d,
type(c_ptr)  x_d,
type(c_ptr)  x1_d,
type(c_ptr)  x2_d,
real(kind=rp), intent(in)  dec,
real(kind=rp), intent(in)  inc,
real(kind=rp), intent(in)  dmin,
real(kind=rp), intent(in)  dmax,
integer, intent(in)  n 
)
Parameters
delta_dDevice pointer to the move limits, updated in place.
x_dDevice pointer to the design variables at the current iteration.
x1_dDevice pointer to the design variables one iteration back.
x2_dDevice pointer to the design variables two iterations back.
[in]decFactor applied on oscillation.
[in]incFactor applied on monotone progress.
[in]dminSmallest allowed move limit.
[in]dmaxLargest allowed move limit.
[in]nNumber of design variables.

Definition at line 184 of file device_steepest_descent.f90.

Here is the call graph for this function:
Here is the caller graph for this function: