11#:include "common.fypp"
2+ #:set I_KINDS_TYPES = list(zip(INT_KINDS, INT_TYPES, INT_KINDS))
23#:set R_KINDS_TYPES = list(zip(REAL_KINDS, REAL_TYPES, REAL_SUFFIX))
34#:set C_KINDS_TYPES = list(zip(CMPLX_KINDS, CMPLX_TYPES, CMPLX_SUFFIX))
4- #:set RC_KINDS_TYPES = R_KINDS_TYPES + C_KINDS_TYPES
55#:set RANKS = range(2, MAXRANK + 1)
66
77module stdlib_intrinsics
@@ -25,27 +25,27 @@ module stdlib_intrinsics
2525 !! The `N-D` interfaces calls upon the `(N-1)-D` implementation.
2626 !! Supported data types include `real` and `complex`.
2727 !!
28- #:for rk, rt, rs in RC_KINDS_TYPES
29- pure module function stdlib_sum_1d_${rs }$(a) result(s)
30- ${rt },ドル intent(in) :: a(:)
31- ${rt }$ :: s
28+ #:for k, t, s in I_KINDS_TYPES + R_KINDS_TYPES + C_KINDS_TYPES
29+ pure module function stdlib_sum_1d_${s }$(a) result(s)
30+ ${t },ドル intent(in) :: a(:)
31+ ${t }$ :: s
3232 end function
33- pure module function stdlib_sum_1d_${rs }$_mask(a,mask) result(s)
34- ${rt },ドル intent(in) :: a(:)
33+ pure module function stdlib_sum_1d_${s }$_mask(a,mask) result(s)
34+ ${t },ドル intent(in) :: a(:)
3535 logical, intent(in) :: mask(:)
36- ${rt }$ :: s
36+ ${t }$ :: s
3737 end function
3838 #:for rank in RANKS
39- pure module function stdlib_sum_${rank}$d_${rs }$( x, mask ) result( s )
40- ${rt },ドル intent(in) :: x${ranksuffix(rank)}$
39+ pure module function stdlib_sum_${rank}$d_${s }$( x, mask ) result( s )
40+ ${t },ドル intent(in) :: x${ranksuffix(rank)}$
4141 logical, intent(in), optional :: mask${ranksuffix(rank)}$
42- ${rt }$ :: s
42+ ${t }$ :: s
4343 end function
44- pure module function stdlib_sum_${rank}$d_dim_${rs }$( x , dim, mask ) result( s )
45- ${rt },ドル intent(in) :: x${ranksuffix(rank)}$
44+ pure module function stdlib_sum_${rank}$d_dim_${s }$( x , dim, mask ) result( s )
45+ ${t },ドル intent(in) :: x${ranksuffix(rank)}$
4646 integer, intent(in):: dim
4747 logical, intent(in), optional :: mask${ranksuffix(rank)}$
48- ${rt }$ :: s${reduced_shape('x', rank, 'dim')}$
48+ ${t }$ :: s${reduced_shape('x', rank, 'dim')}$
4949 end function
5050 #:endfor
5151 #:endfor
@@ -66,27 +66,27 @@ module stdlib_intrinsics
6666 !! The `N-D` interfaces calls upon the `(N-1)-D` implementation.
6767 !! Supported data types include `real` and `complex`.
6868 !!
69- #:for rk, rt, rs in RC_KINDS_TYPES
70- pure module function stdlib_sum_kahan_1d_${rs }$(a) result(s)
71- ${rt },ドル intent(in) :: a(:)
72- ${rt }$ :: s
69+ #:for k, t, s in R_KINDS_TYPES + C_KINDS_TYPES
70+ pure module function stdlib_sum_kahan_1d_${s }$(a) result(s)
71+ ${t },ドル intent(in) :: a(:)
72+ ${t }$ :: s
7373 end function
74- pure module function stdlib_sum_kahan_1d_${rs }$_mask(a,mask) result(s)
75- ${rt },ドル intent(in) :: a(:)
74+ pure module function stdlib_sum_kahan_1d_${s }$_mask(a,mask) result(s)
75+ ${t },ドル intent(in) :: a(:)
7676 logical, intent(in) :: mask(:)
77- ${rt }$ :: s
77+ ${t }$ :: s
7878 end function
7979 #:for rank in RANKS
80- pure module function stdlib_sum_kahan_${rank}$d_${rs }$( x, mask ) result( s )
81- ${rt },ドル intent(in) :: x${ranksuffix(rank)}$
80+ pure module function stdlib_sum_kahan_${rank}$d_${s }$( x, mask ) result( s )
81+ ${t },ドル intent(in) :: x${ranksuffix(rank)}$
8282 logical, intent(in), optional :: mask${ranksuffix(rank)}$
83- ${rt }$ :: s
83+ ${t }$ :: s
8484 end function
85- pure module function stdlib_sum_kahan_${rank}$d_dim_${rs }$( x , dim, mask ) result( s )
86- ${rt },ドル intent(in) :: x${ranksuffix(rank)}$
85+ pure module function stdlib_sum_kahan_${rank}$d_dim_${s }$( x , dim, mask ) result( s )
86+ ${t },ドル intent(in) :: x${ranksuffix(rank)}$
8787 integer, intent(in):: dim
8888 logical, intent(in), optional :: mask${ranksuffix(rank)}$
89- ${rt }$ :: s${reduced_shape('x', rank, 'dim')}$
89+ ${t }$ :: s${reduced_shape('x', rank, 'dim')}$
9090 end function
9191 #:endfor
9292 #:endfor
@@ -106,11 +106,11 @@ module stdlib_intrinsics
106106 !! The 1-D base implementation follows a chunked approach for optimizing performance and increasing accuracy.
107107 !! Supported data types include `real` and `complex`.
108108 !!
109- #:for rk, rt, rs in RC_KINDS_TYPES
110- pure module function stdlib_dot_product_${rs }$(a,b) result(p)
111- ${rt },ドル intent(in) :: a(:)
112- ${rt },ドル intent(in) :: b(:)
113- ${rt }$ :: p
109+ #:for k, t, s in I_KINDS_TYPES + R_KINDS_TYPES + C_KINDS_TYPES
110+ pure module function stdlib_dot_product_${s }$(a,b) result(p)
111+ ${t },ドル intent(in) :: a(:)
112+ ${t },ドル intent(in) :: b(:)
113+ ${t }$ :: p
114114 end function
115115 #:endfor
116116 end interface
@@ -129,43 +129,43 @@ module stdlib_intrinsics
129129 !! The implementation follows a chunked approach combined with a kahan kernel for optimizing performance and increasing accuracy.
130130 !! Supported data types include `real` and `complex`.
131131 !!
132- #:for rk, rt, rs in RC_KINDS_TYPES
133- pure module function stdlib_dot_product_kahan_${rs }$(a,b) result(p)
134- ${rt },ドル intent(in) :: a(:)
135- ${rt },ドル intent(in) :: b(:)
136- ${rt }$ :: p
132+ #:for k, t, s in R_KINDS_TYPES + C_KINDS_TYPES
133+ pure module function stdlib_dot_product_kahan_${s }$(a,b) result(p)
134+ ${t },ドル intent(in) :: a(:)
135+ ${t },ドル intent(in) :: b(:)
136+ ${t }$ :: p
137137 end function
138138 #:endfor
139139 end interface
140140 public :: stdlib_dot_product_kahan
141141
142142 interface kahan_kernel
143- #:for rk, rt, rs in RC_KINDS_TYPES
144- module procedure :: kahan_kernel_${rs }$
145- module procedure :: kahan_kernel_m_${rs }$
143+ #:for k, t, s in R_KINDS_TYPES + C_KINDS_TYPES
144+ module procedure :: kahan_kernel_${s }$
145+ module procedure :: kahan_kernel_m_${s }$
146146 #:endfor
147147 end interface
148148 public :: kahan_kernel
149149
150150contains
151151
152- #:for rk, rt, rs in RC_KINDS_TYPES
153- elemental subroutine kahan_kernel_${rs }$(a,s,c)
154- ${rt },ドル intent(in) :: a
155- ${rt },ドル intent(inout) :: s
156- ${rt },ドル intent(inout) :: c
157- ${rt }$ :: t, y
152+ #:for k, t, s in R_KINDS_TYPES + C_KINDS_TYPES
153+ elemental subroutine kahan_kernel_${s }$(a,s,c)
154+ ${t },ドル intent(in) :: a
155+ ${t },ドル intent(inout) :: s
156+ ${t },ドル intent(inout) :: c
157+ ${t }$ :: t, y
158158 y = a - c
159159 t = s + y
160160 c = (t - s) - y
161161 s = t
162162end subroutine
163- elemental subroutine kahan_kernel_m_${rs }$(a,s,c,m)
164- ${rt },ドル intent(in) :: a
165- ${rt },ドル intent(inout) :: s
166- ${rt },ドル intent(inout) :: c
163+ elemental subroutine kahan_kernel_m_${s }$(a,s,c,m)
164+ ${t },ドル intent(in) :: a
165+ ${t },ドル intent(inout) :: s
166+ ${t },ドル intent(inout) :: c
167167 logical, intent(in) :: m
168- ${rt }$ :: t, y
168+ ${t }$ :: t, y
169169 y = a - c
170170 t = s + y
171171 c = (t - s) - y
0 commit comments