Skip to content

Commit aaa68bc

Browse files
committed
add comments
1 parent 14be974 commit aaa68bc

File tree

3 files changed

+52
-6
lines changed

3 files changed

+52
-6
lines changed

src/stdlib_intrinsics.fypp

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,27 @@
44
#:set RC_KINDS_TYPES = R_KINDS_TYPES + C_KINDS_TYPES
55
#:set RANKS = range(2, MAXRANK + 1)
66

7-
! This module is based on https://github.com/jalvesz/fast_math
87
module stdlib_intrinsics
98
!!Replacement for certain Fortran intrinsic functions offering either faster and/or more accurate implementations.
109
!! ([Specification](../page/specs/stdlib_intrinsics.html))
1110
use stdlib_kinds
1211
implicit none
1312
private
1413

15-
interface stdlib_sum
14+
interface stdlib_sum
15+
!! version: experimental
16+
!!
17+
!!### Summary
18+
!! Sum elements of rank N arrays.
19+
!! ([Specification](../page/specs/stdlib_intrinsics.html#stdlib_sum))
20+
!!
21+
!!### Description
22+
!!
23+
!! This interface provides standard conforming call for sum of elements of any rank.
24+
!! The 1-D base implementation follows a chunked approach for optimizing performance and increasing accuracy.
25+
!! The `N-D` interfaces calls upon the `(N-1)-D` implementation.
26+
!! Supported data types include `real` and `complex`.
27+
!!
1628
#:for rk, rt, rs in RC_KINDS_TYPES
1729
pure module function stdlib_sum_1d_${rs}$(a) result(s)
1830
${rt}$, intent(in) :: a(:)
@@ -41,6 +53,18 @@ module stdlib_intrinsics
4153
public :: stdlib_sum
4254

4355
interface stdlib_sum_kahan
56+
!! version: experimental
57+
!!
58+
!!### Summary
59+
!! Sum elements of rank 1 arrays.
60+
!! ([Specification](../page/specs/stdlib_intrinsics.html#stdlib_sum_kahan))
61+
!!
62+
!!### Description
63+
!!
64+
!! This interface provides standard conforming call for sum of elements of rank 1.
65+
!! The 1-D base implementation follows a chunked approach combined with a kahan kernel for optimizing performance and increasing accuracy.
66+
!! Supported data types include `real` and `complex`.
67+
!!
4468
#:for rk, rt, rs in RC_KINDS_TYPES
4569
pure module function stdlib_sum_kahan_1d_${rs}$(a) result(s)
4670
${rt}$, intent(in) :: a(:)
@@ -56,6 +80,18 @@ module stdlib_intrinsics
5680
public :: stdlib_sum_kahan
5781

5882
interface stdlib_dot_product
83+
!! version: experimental
84+
!!
85+
!!### Summary
86+
!! dot_product of rank 1 arrays.
87+
!! ([Specification](../page/specs/stdlib_intrinsics.html#stdlib_dot_product))
88+
!!
89+
!!### Description
90+
!!
91+
!! compute the dot_product of rank 1 arrays.
92+
!! The 1-D base implementation follows a chunked approach for optimizing performance and increasing accuracy.
93+
!! Supported data types include `real` and `complex`.
94+
!!
5995
#:for rk, rt, rs in RC_KINDS_TYPES
6096
pure module function stdlib_dot_product_${rs}$(a,b) result(p)
6197
${rt}$, intent(in) :: a(:)
@@ -67,6 +103,18 @@ module stdlib_intrinsics
67103
public :: stdlib_dot_product
68104

69105
interface stdlib_dot_product_kahan
106+
!! version: experimental
107+
!!
108+
!!### Summary
109+
!! dot_product of rank 1 arrays.
110+
!! ([Specification](../page/specs/stdlib_intrinsics.html#stdlib_dot_product_kahan))
111+
!!
112+
!!### Description
113+
!!
114+
!! compute the dot_product of rank 1 arrays.
115+
!! The implementation follows a chunked approach combined with a kahan kernel for optimizing performance and increasing accuracy.
116+
!! Supported data types include `real` and `complex`.
117+
!!
70118
#:for rk, rt, rs in RC_KINDS_TYPES
71119
pure module function stdlib_dot_product_kahan_${rs}$(a,b) result(p)
72120
${rt}$, intent(in) :: a(:)

src/stdlib_intrinsics_dot_product.fypp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ ${expression}$
1111
#:endif
1212
#:enddef
1313

14-
! This module is based on https://github.com/jalvesz/fast_math
1514
submodule(stdlib_intrinsics) stdlib_intrinsics_dot_product
1615
!!Replacement for certain Fortran intrinsic functions offering either faster and/or more accurate implementations.
1716
!! ([Specification](../page/specs/stdlib_intrinsics.html))
@@ -22,7 +21,7 @@ submodule(stdlib_intrinsics) stdlib_intrinsics_dot_product
2221
integer, parameter :: chunk = 64
2322

2423
contains
25-
24+
! This implementation is based on https://github.com/jalvesz/fast_math
2625
#:for k1, t1, s1 in RC_KINDS_TYPES
2726
pure module function stdlib_dot_product_${s1}$(a,b) result(p)
2827
${t1}$, intent(in) :: a(:)

src/stdlib_intrinsics_sum.fypp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
#:set RC_KINDS_TYPES = R_KINDS_TYPES + C_KINDS_TYPES
55
#:set RANKS = range(2, MAXRANK + 1)
66

7-
! This module is based on https://github.com/jalvesz/fast_math
87
submodule(stdlib_intrinsics) stdlib_intrinsics_sum
9-
!!Replacement for certain Fortran intrinsic functions offering either faster and/or more accurate implementations.
108
!! ([Specification](../page/specs/stdlib_intrinsics.html))
119
use stdlib_kinds
1210
use stdlib_constants
@@ -17,6 +15,7 @@ submodule(stdlib_intrinsics) stdlib_intrinsics_sum
1715
contains
1816

1917
!================= 1D Base implementations ============
18+
! This implementation is based on https://github.com/jalvesz/fast_math
2019
#:for rk, rt, rs in RC_KINDS_TYPES
2120
pure module function stdlib_sum_1d_${rs}$(a) result(s)
2221
${rt}$, intent(in) :: a(:)

0 commit comments

Comments
 (0)