TABLE OF CONTENTS


ABINIT/m_xg_kokkos [ Modules ]

[ Top ] [ Modules ]

NAME

  m_xg_kokkos

FUNCTION

 This provides iso_c_binding wrappers to kokkos implementation of some of the
 computational routines located in m_xg

COPYRIGHT

  Copyright (C) 2016-2024 ABINIT group
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

NOTES

SOURCE

 19 #if defined HAVE_CONFIG_H
 20 #include "config.h"
 21 #endif
 22 
 23 #include "abi_common.h"
 24 
 25 module m_xg_kokkos
 26 
 27   use, intrinsic :: iso_c_binding
 28 
 29   implicit none
 30 
 31   interface
 32 
 33     ! ========================================================================
 34     ! ========================================================================
 35     subroutine computeBatchedDotProduct_scalar(x_ptr, y_ptr, res_ptr, nx, ny, ldim) &
 36       & bind(c, name='computeBatchedDotProduct_scalar_kokkos_cpp')
 37       use, intrinsic :: iso_c_binding
 38       implicit none
 39       type(c_ptr)            , value             :: x_ptr
 40       type(c_ptr)            , value             :: y_ptr
 41       type(c_ptr)            , value             :: res_ptr
 42       integer(kind=c_int32_t), value, intent(in) :: nx
 43       integer(kind=c_int32_t), value, intent(in) :: ny
 44       integer(kind=c_int32_t), value, intent(in) :: ldim
 45     end subroutine computeBatchedDotProduct_scalar
 46 
 47     subroutine computeBatchedDotProduct_cplx(x_ptr, y_ptr, res_ptr, nx, ny, ldim) &
 48       & bind(c, name='computeBatchedDotProduct_cplx_kokkos_cpp')
 49       use, intrinsic :: iso_c_binding
 50       implicit none
 51       type(c_ptr)            , value             :: x_ptr
 52       type(c_ptr)            , value             :: y_ptr
 53       type(c_ptr)            , value             :: res_ptr
 54       integer(kind=c_int32_t), value, intent(in) :: nx
 55       integer(kind=c_int32_t), value, intent(in) :: ny
 56       integer(kind=c_int32_t), value, intent(in) :: ldim
 57     end subroutine computeBatchedDotProduct_cplx
 58 
 59     subroutine computeBatchedDotProduct_cplx_scalar(x_ptr, y_ptr, res_ptr, nx, ny, ldim) &
 60       & bind(c, name='computeBatchedDotProduct_cplx_scalar_kokkos_cpp')
 61       use, intrinsic :: iso_c_binding
 62       implicit none
 63       type(c_ptr)            , value             :: x_ptr
 64       type(c_ptr)            , value             :: y_ptr
 65       type(c_ptr)            , value             :: res_ptr
 66       integer(kind=c_int32_t), value, intent(in) :: nx
 67       integer(kind=c_int32_t), value, intent(in) :: ny
 68       integer(kind=c_int32_t), value, intent(in) :: ldim
 69     end subroutine computeBatchedDotProduct_cplx_scalar
 70 
 71     ! ========================================================================
 72     ! ========================================================================
 73     subroutine computeMax_scalar(x_ptr, size, res) &
 74       & bind(c, name='computeMax_scalar_kokkos_cpp')
 75       use, intrinsic :: iso_c_binding
 76       implicit none
 77       type(c_ptr)            , value                :: x_ptr
 78       integer(kind=c_int32_t), value, intent(in)    :: size
 79       real(c_double),                 intent(inout) :: res
 80     end subroutine computeMax_scalar
 81 
 82     subroutine computeMax_complex(x_ptr, size, res) &
 83       & bind(c, name='computeMax_complex_kokkos_cpp')
 84       use, intrinsic :: iso_c_binding
 85       implicit none
 86       type(c_ptr)            , value                :: x_ptr
 87       integer(kind=c_int32_t), value, intent(in)    :: size
 88       real(c_double),                 intent(inout) :: res
 89     end subroutine computeMax_complex
 90 
 91     ! ========================================================================
 92     ! ========================================================================
 93     subroutine computeMin_scalar(x_ptr, size, res) &
 94       & bind(c, name='computeMin_scalar_kokkos_cpp')
 95       use, intrinsic :: iso_c_binding
 96       implicit none
 97       type(c_ptr)            , value                :: x_ptr
 98       integer(kind=c_int32_t), value, intent(in)    :: size
 99       real(c_double),                 intent(inout) :: res
100     end subroutine computeMin_scalar
101 
102     subroutine computeMin_complex(x_ptr, size, res) &
103       & bind(c, name='computeMin_complex_kokkos_cpp')
104       use, intrinsic :: iso_c_binding
105       implicit none
106       type(c_ptr)            , value                :: x_ptr
107       integer(kind=c_int32_t), value, intent(in)    :: size
108       real(c_double),                 intent(inout) :: res
109     end subroutine computeMin_complex
110 
111     ! ========================================================================
112     ! ========================================================================
113     subroutine computeMaxloc_scalar(x_ptr, size, res) &
114       & bind(c, name='computeMaxloc_scalar_kokkos_cpp')
115       use, intrinsic :: iso_c_binding
116       implicit none
117       type(c_ptr)            , value                :: x_ptr
118       integer(kind=c_int32_t), value, intent(in)    :: size
119       integer(c_int32_t),             intent(inout) :: res
120     end subroutine computeMaxloc_scalar
121 
122     subroutine computeMaxloc_complex(x_ptr, size, res) &
123       & bind(c, name='computeMaxloc_complex_kokkos_cpp')
124       use, intrinsic :: iso_c_binding
125       implicit none
126       type(c_ptr)            , value                :: x_ptr
127       integer(kind=c_int32_t), value, intent(in)    :: size
128       integer(c_int32_t),             intent(inout) :: res
129     end subroutine computeMaxloc_complex
130 
131     subroutine computeMaxloc_scalar_2d(x_ptr, nx, ny, res_ptr) &
132       & bind(c, name='computeMaxloc_scalar_2d_kokkos_cpp')
133       use, intrinsic :: iso_c_binding
134       implicit none
135       type(c_ptr)            , value                :: x_ptr    ! double
136       integer(kind=c_int32_t), value, intent(in)    :: nx
137       integer(kind=c_int32_t), value, intent(in)    :: ny
138       type(c_ptr)            , value                :: res_ptr  ! int32_t
139     end subroutine computeMaxloc_scalar_2d
140 
141     subroutine computeMaxloc_complex_2d(x_ptr, nx, ny, res_ptr) &
142       & bind(c, name='computeMaxloc_complex_2d_kokkos_cpp')
143       use, intrinsic :: iso_c_binding
144       implicit none
145       type(c_ptr)            , value                :: x_ptr    ! cplx_t
146       integer(kind=c_int32_t), value, intent(in)    :: nx
147       integer(kind=c_int32_t), value, intent(in)    :: ny
148       type(c_ptr)            , value                :: res_ptr  ! int32_t
149     end subroutine computeMaxloc_complex_2d
150 
151     ! ========================================================================
152     ! ========================================================================
153     subroutine computeMinloc_scalar(x_ptr, size, res) &
154       & bind(c, name='computeMinloc_scalar_kokkos_cpp')
155       use, intrinsic :: iso_c_binding
156       implicit none
157       type(c_ptr)            , value                :: x_ptr
158       integer(kind=c_int32_t), value, intent(in)    :: size
159       integer(c_int32_t),             intent(inout) :: res
160     end subroutine computeMinloc_scalar
161 
162     subroutine computeMinloc_complex(x_ptr, size, res) &
163       & bind(c, name='computeMinloc_complex_kokkos_cpp')
164       use, intrinsic :: iso_c_binding
165       implicit none
166       type(c_ptr)            , value                :: x_ptr
167       integer(kind=c_int32_t), value, intent(in)    :: size
168       integer(c_int32_t),             intent(inout) :: res
169     end subroutine computeMinloc_complex
170 
171     subroutine computeMinloc_scalar_2d(x_ptr, nx, ny, res_ptr) &
172       & bind(c, name='computeMinloc_scalar_2d_kokkos_cpp')
173       use, intrinsic :: iso_c_binding
174       implicit none
175       type(c_ptr)            , value                :: x_ptr    ! double
176       integer(kind=c_int32_t), value, intent(in)    :: nx
177       integer(kind=c_int32_t), value, intent(in)    :: ny
178       type(c_ptr)            , value                :: res_ptr  ! int32_t
179     end subroutine computeMinloc_scalar_2d
180 
181     subroutine computeMinloc_complex_2d(x_ptr, nx, ny, res_ptr) &
182       & bind(c, name='computeMinloc_complex_2d_kokkos_cpp')
183       use, intrinsic :: iso_c_binding
184       implicit none
185       type(c_ptr)            , value                :: x_ptr    ! cplx_t
186       integer(kind=c_int32_t), value, intent(in)    :: nx
187       integer(kind=c_int32_t), value, intent(in)    :: ny
188       type(c_ptr)            , value                :: res_ptr  ! int32_t
189     end subroutine computeMinloc_complex_2d
190 
191     ! ========================================================================
192     ! ========================================================================
193     subroutine computeColwiseDivision_scalar(x_ptr, y_ptr, size, res_ptr) &
194       & bind(c, name='computeColwiseDivision_scalar_kokkos_cpp')
195       use, intrinsic :: iso_c_binding
196       implicit none
197       type(c_ptr)            , value                :: x_ptr
198       type(c_ptr)            , value                :: y_ptr
199       integer(kind=c_int32_t), value, intent(in)    :: size
200       type(c_ptr)            , value                :: res_ptr
201     end subroutine computeColwiseDivision_scalar
202 
203     subroutine computeColwiseDivision_complex(x_ptr, y_ptr, size, res_ptr) &
204       & bind(c, name='computeColwiseDivision_complex_kokkos_cpp')
205       use, intrinsic :: iso_c_binding
206       implicit none
207       type(c_ptr)            , value                :: x_ptr
208       type(c_ptr)            , value                :: y_ptr
209       integer(kind=c_int32_t), value, intent(in)    :: size
210       type(c_ptr)            , value                :: res_ptr
211     end subroutine computeColwiseDivision_complex
212 
213     ! ========================================================================
214     ! ========================================================================
215     subroutine compute_colwiseCymax_scalar(A_ptr, da_ptr, B_ptr, W_ptr, rows, cols, ldim) &
216       & bind(c, name='compute_colwiseCymax_scalar_kokkos_cpp')
217       use, intrinsic :: iso_c_binding
218       implicit none
219       type(c_ptr)            , value             :: A_ptr
220       type(c_ptr)            , value             :: da_ptr
221       type(c_ptr)            , value             :: B_ptr
222       type(c_ptr)            , value             :: W_ptr
223       integer(kind=c_int32_t), value, intent(in) :: rows, cols, ldim
224     end subroutine compute_colwiseCymax_scalar
225 
226     subroutine compute_colwiseCymax_cplx(A_ptr, da_ptr, B_ptr, W_ptr, rows, cols, ldim) &
227       & bind(c, name='compute_colwiseCymax_cplx_kokkos_cpp')
228       use, intrinsic :: iso_c_binding
229       implicit none
230       type(c_ptr)            , value             :: A_ptr
231       type(c_ptr)            , value             :: da_ptr
232       type(c_ptr)            , value             :: B_ptr
233       type(c_ptr)            , value             :: W_ptr
234       integer(kind=c_int32_t), value, intent(in) :: rows, cols, ldim
235     end subroutine compute_colwiseCymax_cplx
236 
237     ! ========================================================================
238     ! ========================================================================
239     subroutine compute_colwiseMul_scalar_scalar(data_ptr, vec_ptr, shift, rows, cols, ldim, vec_size) &
240       & bind(c, name='compute_colwiseMul_scalar_scalar_kokkos_cpp')
241       use, intrinsic :: iso_c_binding
242       implicit none
243       type(c_ptr)            , value             :: data_ptr
244       type(c_ptr)            , value             :: vec_ptr
245       integer(kind=c_int32_t), value, intent(in) :: shift, rows, cols, ldim, vec_size
246     end subroutine compute_colwiseMul_scalar_scalar
247 
248     subroutine compute_colwiseMul_cplx_scalar(data_ptr, vec_ptr, shift, rows, cols, ldim, vec_size) &
249       & bind(c, name='compute_colwiseMul_cplx_scalar_kokkos_cpp')
250       use, intrinsic :: iso_c_binding
251       implicit none
252       type(c_ptr)            , value             :: data_ptr
253       type(c_ptr)            , value             :: vec_ptr
254       integer(kind=c_int32_t), value, intent(in) :: shift, rows, cols, ldim, vec_size
255     end subroutine compute_colwiseMul_cplx_scalar
256 
257     subroutine compute_colwiseMul_cplx_cplx(data_ptr, vec_ptr, shift, rows, cols, ldim, vec_size) &
258       & bind(c, name='compute_colwiseMul_cplx_cplx_kokkos_cpp')
259       use, intrinsic :: iso_c_binding
260       implicit none
261       type(c_ptr)            , value             :: data_ptr
262       type(c_ptr)            , value             :: vec_ptr
263       integer(kind=c_int32_t), value, intent(in) :: shift, rows, cols, ldim, vec_size
264     end subroutine compute_colwiseMul_cplx_cplx
265 
266   end interface
267 
268 contains