Skip to content

Commit 1c3b71c

Browse files
committed
Auto-generated commit
1 parent c41aa3e commit 1c3b71c

File tree

13 files changed

+201
-47
lines changed

13 files changed

+201
-47
lines changed

.gitattributes

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,27 @@
4040
*.mov binary
4141

4242
# Override what is considered "vendored" by GitHub's linguist:
43-
/deps/** linguist-vendored=false
44-
/lib/node_modules/** linguist-vendored=false linguist-generated=false
45-
test/fixtures/** linguist-vendored=false
46-
tools/** linguist-vendored=false
43+
/lib/node_modules/** -linguist-vendored -linguist-generated
4744

48-
# Override what is considered "documentation" by GitHub's linguist:
49-
examples/** linguist-documentation=false
45+
# Configure directories which should *not* be included in GitHub language statistics:
46+
/deps/** linguist-vendored
47+
/dist/** linguist-generated
48+
/workshops/** linguist-vendored
49+
50+
benchmark/** linguist-vendored
51+
docs/* linguist-documentation
52+
etc/** linguist-vendored
53+
examples/** linguist-documentation
54+
scripts/** linguist-vendored
55+
test/** linguist-vendored
56+
tools/** linguist-vendored
57+
58+
# Configure files which should *not* be included in GitHub language statistics:
59+
Makefile linguist-vendored
60+
*.mk linguist-vendored
61+
*.jl linguist-vendored
62+
*.py linguist-vendored
63+
*.R linguist-vendored
64+
65+
# Configure files which should be included in GitHub language statistics:
66+
docs/types/*.d.ts -linguist-documentation

CONTRIBUTORS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Adarsh Palaskar <adarshpalaskar99@gmail.com>
66
Aditya Sapra <adityaework@gmail.com>
77
AgPriyanshu18 <113460573+AgPriyanshu18@users.noreply.github.com>
8+
Aleksandr <112382387+alextes90@users.noreply.github.com>
89
Ali Salesi <ali_sal1381@yahoo.com>
910
Aman Bhansali <bhansali.1@iitj.ac.in>
1011
Amit Jimiwal <amitjimiwal45@gmail.com>
@@ -18,6 +19,7 @@ Chinmay Joshi <86140365+JawHawk@users.noreply.github.com>
1819
Christopher Dambamuromo <chridam@gmail.com>
1920
Dan Rose <danoftheroses@gmail.com>
2021
Daniel Killenberger <daniel.killenberger@gmail.com>
22+
Daniel Yu <40680511+Daniel777y@users.noreply.github.com>
2123
Dominik Moritz <domoritz@gmail.com>
2224
Dorrin Sotoudeh <dorrinsotoudeh123@gmail.com>
2325
EuniceSim142 <77243938+EuniceSim142@users.noreply.github.com>
@@ -69,8 +71,10 @@ Seyyed Parsa Neshaei <spneshaei@users.noreply.github.com>
6971
Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
7072
Shivam <11shivam00@gmail.com>
7173
Shraddheya Shendre <shendreshraddheya@gmail.com>
74+
Shubh Mehta <93862397+Shubh942@users.noreply.github.com>
7275
Shubham Mishra <shubh622005@gmail.com>
7376
Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com>
77+
Soumajit Chatterjee <121816890+soumajit23@users.noreply.github.com>
7478
Spandan Barve <contact@marsian.dev>
7579
Stephannie Jiménez Gacha <steff456@hotmail.com>
7680
Suraj kumar <125961509+kumarsuraj212003@users.noreply.github.com>
@@ -83,4 +87,5 @@ Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
8387
naveen <stupiddint@gmail.com>
8488
nishant-s7 <97207366+nishant-s7@users.noreply.github.com>
8589
orimiles5 <97595296+orimiles5@users.noreply.github.com>
90+
rainn <88160429+AmCodesLame@users.noreply.github.com>
8691
rei2hu <reimu@reimu.ws>

README.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,108 @@ console.log( y.get( y.length-1 ).toString() );
290290

291291
<!-- /.examples -->
292292

293+
<!-- C interface documentation. -->
294+
295+
* * *
296+
297+
<section class="c">
298+
299+
## C APIs
300+
301+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
302+
303+
<section class="intro">
304+
305+
</section>
306+
307+
<!-- /.intro -->
308+
309+
<!-- C usage documentation. -->
310+
311+
<section class="usage">
312+
313+
### Usage
314+
315+
```c
316+
#include "stdlib/blas/base/cswap.h"
317+
```
318+
319+
#### c_cswap( N, X, strideX, Y, strideY )
320+
321+
Interchanges two complex single-precision floating-point vectors.
322+
323+
```c
324+
float x[] = { 1.0f, 2.0f, 3.0f, 4.0f }; // interleaved real and imaginary components
325+
float y[] = { 5.0f, 6.0f, 7.0f, 8.0f };
326+
327+
c_cswap( 2, (void *)x, 1, (void *)Y, 1 );
328+
```
329+
330+
The function accepts the following arguments:
331+
332+
- **N**: `[in] CBLAS_INT` number of indexed elements.
333+
- **X**: `[out] void*` first input array.
334+
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
335+
- **Y**: `[out] void*` first input array.
336+
- **strideY**: `[in] CBLAS_INT` index increment for `Y`.
337+
338+
```c
339+
void c_cswap( const CBLAS_INT N, void *X, const CBLAS_INT strideX, void *Y, const CBLAS_INT strideY );
340+
```
341+
342+
</section>
343+
344+
<!-- /.usage -->
345+
346+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
347+
348+
<section class="notes">
349+
350+
</section>
351+
352+
<!-- /.notes -->
353+
354+
<!-- C API usage examples. -->
355+
356+
<section class="examples">
357+
358+
### Examples
359+
360+
```c
361+
#include "stdlib/blas/base/cswap.h"
362+
#include <stdio.h>
363+
364+
int main( void ) {
365+
// Create strided arrays:
366+
float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
367+
float y[] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
368+
369+
// Specify the number of elements:
370+
const int N = 4;
371+
372+
// Specify stride lengths:
373+
const int strideX = 1;
374+
const int strideY = -1;
375+
376+
// Copy elements:
377+
c_cswap( N, (void *)x, strideX, (void *)y, strideY );
378+
379+
// Print the result:
380+
for ( int i = 0; i < N; i++ ) {
381+
printf( "x[ %i ] = %f + %fj\n", i, x[ i*2 ], x[ (i*2)+1 ] );
382+
printf( "y[ %i ] = %f + %fj\n", i, y[ i*2 ], y[ (i*2)+1 ] );
383+
}
384+
}
385+
```
386+
387+
</section>
388+
389+
<!-- /.examples -->
390+
391+
</section>
392+
393+
<!-- /.c -->
394+
293395
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
294396
295397
<section class="related">

benchmark/c/benchmark.length.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
* limitations under the License.
1717
*/
1818

19-
/**
20-
* Benchmark `cswap`.
21-
*/
2219
#include "stdlib/blas/base/cswap.h"
2320
#include <stdlib.h>
2421
#include <stdio.h>

benchmark/fortran/benchmark.length.f

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@
1616
! limitations under the License.
1717
!<
1818

19-
!> Benchmark `cswap`.
20-
!
21-
! ## Notes
22-
!
23-
! - Written in "free form" Fortran 95.
24-
!
25-
!<
2619
program bench
2720
implicit none
2821
! ..
@@ -214,4 +207,4 @@ subroutine main()
214207
end do
215208
call print_summary( count, count )
216209
end subroutine main
217-
end program bench
210+
end program bench

examples/c/example.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
int main( void ) {
2323
// Create strided arrays:
24-
float x[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
25-
float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
24+
float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
25+
float y[] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
2626

2727
// Specify the number of elements:
2828
const int N = 4;

include/stdlib/blas/base/cswap.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#ifndef CSWAP_H
2323
#define CSWAP_H
2424

25+
#include "stdlib/blas/base/shared.h"
26+
2527
/*
2628
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
2729
*/
@@ -32,7 +34,7 @@ extern "C" {
3234
/**
3335
* Interchanges two complex single-precision floating-point vectors.
3436
*/
35-
void c_cswap( const int N, void *X, const int strideX, void *Y, const int strideY );
37+
void c_cswap( const CBLAS_INT N, void *X, const CBLAS_INT strideX, void *Y, const CBLAS_INT strideY );
3638

3739
#ifdef __cplusplus
3840
}

include/stdlib/blas/base/cswap_cblas.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#ifndef CSWAP_CBLAS_H
2323
#define CSWAP_CBLAS_H
2424

25+
#include "stdlib/blas/base/shared.h"
26+
2527
/*
2628
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
2729
*/
@@ -32,7 +34,7 @@ extern "C" {
3234
/**
3335
* Interchanges two complex single-precision floating-point vectors.
3436
*/
35-
void cblas_cswap( const int N, void *X, const int strideX, void *Y, const int strideY );
37+
void cblas_cswap( const CBLAS_INT N, void *X, const CBLAS_INT strideX, void *Y, const CBLAS_INT strideY );
3638

3739
#ifdef __cplusplus
3840
}

0 commit comments

Comments
 (0)