Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Apr 27, 2024
1 parent 0ee6072 commit d58699f
Show file tree
Hide file tree
Showing 12 changed files with 202 additions and 66 deletions.
29 changes: 23 additions & 6 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,27 @@
*.mov binary

# Override what is considered "vendored" by GitHub's linguist:
/deps/** linguist-vendored=false
/lib/node_modules/** linguist-vendored=false linguist-generated=false
test/fixtures/** linguist-vendored=false
tools/** linguist-vendored=false
/lib/node_modules/** -linguist-vendored -linguist-generated

# Override what is considered "documentation" by GitHub's linguist:
examples/** linguist-documentation=false
# Configure directories which should *not* be included in GitHub language statistics:
/deps/** linguist-vendored
/dist/** linguist-generated
/workshops/** linguist-vendored

benchmark/** linguist-vendored
docs/* linguist-documentation
etc/** linguist-vendored
examples/** linguist-documentation
scripts/** linguist-vendored
test/** linguist-vendored
tools/** linguist-vendored

# Configure files which should *not* be included in GitHub language statistics:
Makefile linguist-vendored
*.mk linguist-vendored
*.jl linguist-vendored
*.py linguist-vendored
*.R linguist-vendored

# Configure files which should be included in GitHub language statistics:
docs/types/*.d.ts -linguist-documentation
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Chinmay Joshi <[email protected]>
Christopher Dambamuromo <[email protected]>
Dan Rose <[email protected]>
Daniel Killenberger <[email protected]>
Daniel Yu <[email protected]>
Dominik Moritz <[email protected]>
Dorrin Sotoudeh <[email protected]>
EuniceSim142 <[email protected]>
Expand Down
95 changes: 95 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,101 @@ console.log( out );

<!-- /.examples -->

<!-- C interface documentation. -->

* * *

<section class="c">

## C APIs

<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->

<section class="intro">

</section>

<!-- /.intro -->

<!-- C usage documentation. -->

<section class="usage">

### Usage

```c
#include "stdlib/blas/base/dasum.h"
```

#### c_dasum( N, X, stride )

Computes the sum of absolute values.

```c
const double x[] = { 1.0, 2.0, 3.0, 4.0 };

double v = c_dasum( 4, x, 1 );
// returns 10.0
```
The function accepts the following arguments:
- **N**: `[in] CBLAS_INT` number of indexed elements.
- **X**: `[in] void*` input array.
- **stride**: `[in] CBLAS_INT` index increment for `X`.
```c
double c_dasum( const CBLAS_INT N, const double *X, const CBLAS_INT stride );
```

</section>

<!-- /.usage -->

<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="notes">

</section>

<!-- /.notes -->

<!-- C API usage examples. -->

<section class="examples">

### Examples

```c
#include "stdlib/blas/base/dasum.h"
#include <stdio.h>

int main( void ) {
// Create a strided array:
const double x[] = { 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 };

// Specify the number of elements:
const int N = 8;

// Specify a stride:
const int strideX = 1;

// Compute the sum of absolute values:
double sum = c_dasum( N, x, strideX );

// Print the result:
printf( "sum: %lf\n", sum );
}
```
</section>
<!-- /.examples -->
</section>
<!-- /.c -->
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
<section class="related">
Expand Down
3 changes: 0 additions & 3 deletions benchmark/c/benchmark.length.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
* limitations under the License.
*/

/**
* Benchmark `dasum`.
*/
#include "stdlib/blas/base/dasum.h"
#include <stdlib.h>
#include <stdio.h>
Expand Down
9 changes: 1 addition & 8 deletions benchmark/fortran/benchmark.length.f
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@
! limitations under the License.
!<

!> Benchmark `dasum`.
!
! ## Notes
!
! - Written in "free form" Fortran 95.
!
!<
program bench
implicit none
! ..
Expand Down Expand Up @@ -214,4 +207,4 @@ subroutine main()
end do
call print_summary( count, count )
end subroutine main
end program bench
end program bench
4 changes: 3 additions & 1 deletion include/stdlib/blas/base/dasum.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#ifndef DASUM_H
#define DASUM_H

#include "stdlib/blas/base/shared.h"

/*
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
*/
Expand All @@ -32,7 +34,7 @@ extern "C" {
/**
* Computes the sum of absolute values.
*/
double c_dasum( const int N, const double *X, const int stride );
double c_dasum( const CBLAS_INT N, const double *X, const CBLAS_INT stride );

#ifdef __cplusplus
}
Expand Down
4 changes: 3 additions & 1 deletion include/stdlib/blas/base/dasum_cblas.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#ifndef DASUM_CBLAS_H
#define DASUM_CBLAS_H

#include "stdlib/blas/base/shared.h"

/*
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
*/
Expand All @@ -32,7 +34,7 @@ extern "C" {
/**
* Computes the sum of absolute values.
*/
double cblas_dasum( const int N, const double *X, const int stride );
double cblas_dasum( const CBLAS_INT N, const double *X, const CBLAS_INT stride );

#ifdef __cplusplus
}
Expand Down
Loading

0 comments on commit d58699f

Please sign in to comment.