Skip to content

feat: add C implementation for blas/ext/base/ndarray/ctril - #16140

Open
yb175 wants to merge 5 commits into
stdlib-js:developfrom
yb175:feat/ndarray-ctril-c
Open

yb175 wants to merge 5 commits into
stdlib-js:developfrom
yb175:feat/ndarray-ctril-c

Conversation

@yb175

@yb175 yb175 commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Resolves part of #14819.

Description

What is the purpose of this pull request?

This pull request:

  • Adds a native C implementation for blas/ext/base/ndarray/ctril.
  • Retains the JavaScript fallback when the native addon is unavailable.
  • Adds native tests, C examples, and C benchmarks.
  • Uses a zero-dimensional int32 ndarray for the diagonal offset k.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

The int32 scalar approach follows the discussion in #14471 .

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

AI assistance was used to update tests and benchmarks, and prepare documentation.


@stdlib-js/reviewers

@yb175
yb175 requested a review from a team October 14, 2026 09:40
@stdlib-bot stdlib-bot added BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). Needs Review A pull request which needs code review. labels Oct 14, 2026
@stdlib-bot

stdlib-bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
blas/ext/base/ndarray/ctril $\\color{green}227/227$
$\\color{green}+0.00\\%$
$\\color{green}7/7$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{green}227/227$
$\\color{green}+0.00\\%$

The above coverage report was generated for the changes in this PR.

@AryanSharma48 AryanSharma48 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yb175 Left some comments on the initial pass

* - a two-dimensional input ndarray corresponding to `A`.
* - a two-dimensional output ndarray corresponding to `B`.
* - a zero-dimensional ndarray specifying the diagonal above which to ignore.
* - a zero-dimensional int32 ndarray specifying the diagonal above which to ignore.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* - a zero-dimensional int32 ndarray specifying the diagonal above which to ignore.
* - a zero-dimensional ndarray specifying the diagonal above which to ignore.

In PR for dtril, changing dtype to 'int32' was only applied to the code examples and tests (scalar2ndarray( 0, { 'dtype': 'int32' } )), not the prose parameter descriptions. Let's revert this back to maintain consistency across the ndarray BLAS packages.

*
* - a two-dimensional input ndarray corresponding to `A`.
* - a two-dimensional output ndarray corresponding to `B`.
* - a zero-dimensional int32 ndarray specifying the diagonal above which to ignore.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* - a zero-dimensional int32 ndarray specifying the diagonal above which to ignore.
* - a zero-dimensional ndarray specifying the diagonal above which to ignore.

- a two-dimensional output ndarray corresponding to `B`.
- a zero-dimensional ndarray specifying the diagonal above which to
ignore.
- a zero-dimensional int32 ndarray specifying the diagonal above which

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- a zero-dimensional int32 ndarray specifying the diagonal above which
- a zero-dimensional ndarray specifying the diagonal above which

* - a two-dimensional input ndarray corresponding to `A`.
* - a two-dimensional output ndarray corresponding to `B`.
* - a zero-dimensional ndarray specifying the diagonal above which to ignore.
* - a zero-dimensional int32 ndarray specifying the diagonal above which to ignore.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* - a zero-dimensional int32 ndarray specifying the diagonal above which to ignore.
* - a zero-dimensional ndarray specifying the diagonal above which to ignore.

*
* - a two-dimensional input ndarray corresponding to `A`.
* - a two-dimensional output ndarray corresponding to `B`.
* - a zero-dimensional int32 ndarray specifying the diagonal above which to ignore.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* - a zero-dimensional int32 ndarray specifying the diagonal above which to ignore.
* - a zero-dimensional ndarray specifying the diagonal above which to ignore.

- a two-dimensional input ndarray corresponding to `A`.
- a two-dimensional output ndarray corresponding to `B`.
- a zero-dimensional ndarray specifying the diagonal above which to ignore. A value equal to zero refers to the main diagonal, greater than zero refers to a diagonal above the main diagonal, and less than zero refers to a diagonal below the main diagonal.
- a zero-dimensional int32 ndarray specifying the diagonal above which to ignore. A value equal to zero refers to the main diagonal, greater than zero refers to a diagonal above the main diagonal, and less than zero refers to a diagonal below the main diagonal.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- a zero-dimensional int32 ndarray specifying the diagonal above which to ignore. A value equal to zero refers to the main diagonal, greater than zero refers to a diagonal above the main diagonal, and less than zero refers to a diagonal below the main diagonal.
- a zero-dimensional ndarray specifying the diagonal above which to ignore. A value equal to zero refers to the main diagonal, greater than zero refers to a diagonal above the main diagonal, and less than zero refers to a diagonal below the main diagonal.

Comment on lines +197 to +204
The function accepts an ordered list of ndarrays:
- **arrays**: `[in] struct ndarray**` containing `A`, `B`, and `k` in that order.
- `[in]` two-dimensional complex64 input ndarray `A`.
- `[out]` two-dimensional complex64 output ndarray `B`.
- `[in]` zero-dimensional int32 ndarray `k`, the diagonal offset.
The `k` value must be representable as an int32. A value of zero selects the main diagonal; positive values include diagonals above it, and negative values include diagonals below it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The function accepts an ordered list of ndarrays:
- **arrays**: `[in] struct ndarray**` containing `A`, `B`, and `k` in that order.
- `[in]` two-dimensional complex64 input ndarray `A`.
- `[out]` two-dimensional complex64 output ndarray `B`.
- `[in]` zero-dimensional int32 ndarray `k`, the diagonal offset.
The `k` value must be representable as an int32. A value of zero selects the main diagonal; positive values include diagonals above it, and negative values include diagonals below it.
The function accepts the following arguments:
- **arrays**: `[in] struct ndarray**` list containing the following ndarrays:
- `[in] struct ndarray*` a two-dimensional input ndarray.
- `[inout] struct ndarray*` a two-dimensional output ndarray.
- `[in] struct ndarray*` a zero-dimensional ndarray specifying the diagonal above which to ignore. A value equal to zero refers to the main diagonal, greater than zero refers to a diagonal above the main diagonal, and less than zero refers to a diagonal below the main diagonal.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following dtril:

  • Use the canonical intro phrasing "The function accepts the following arguments:".
  • Document B as [inout] because elements outside the lower triangular region are left unmodified.
  • Include struct ndarray* type annotations on each sub-item.
  • Keep the diagonal description inline as in dtril.

Comment on lines +37 to +61
void stdlib_blas_ext_ctril( const struct ndarray *arrays[] ) {
const struct ndarray *A = arrays[ 0 ];
const struct ndarray *B = arrays[ 1 ];
const struct ndarray *karr = arrays[ 2 ];

const int64_t *shape = stdlib_ndarray_shape( A );
const CBLAS_INT M = (CBLAS_INT)shape[ 0 ];
const CBLAS_INT N = (CBLAS_INT)shape[ 1 ];

const CBLAS_INT strideA1 = (CBLAS_INT)stdlib_ndarray_stride_elements( A, 0 );
const CBLAS_INT strideA2 = (CBLAS_INT)stdlib_ndarray_stride_elements( A, 1 );
const CBLAS_INT offsetA = (CBLAS_INT)stdlib_ndarray_offset_elements( A );
const CBLAS_INT strideB1 = (CBLAS_INT)stdlib_ndarray_stride_elements( B, 0 );
const CBLAS_INT strideB2 = (CBLAS_INT)stdlib_ndarray_stride_elements( B, 1 );
const CBLAS_INT offsetB = (CBLAS_INT)stdlib_ndarray_offset_elements( B );

int32_t k;
if ( stdlib_ndarray_get_int32( karr, NULL, &k ) != 0 ) {
return;
}

const stdlib_complex64_t *dataA = (const stdlib_complex64_t *)stdlib_ndarray_data( A );
stdlib_complex64_t *dataB = (stdlib_complex64_t *)stdlib_ndarray_data( B );
API_SUFFIX(stdlib_strided_ctril_ndarray)( M, N, k, dataA, strideA1, strideA2, offsetA, dataB, strideB1, strideB2, offsetB );
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void stdlib_blas_ext_ctril( const struct ndarray *arrays[] ) {
const struct ndarray *A = arrays[ 0 ];
const struct ndarray *B = arrays[ 1 ];
const struct ndarray *karr = arrays[ 2 ];
const int64_t *shape = stdlib_ndarray_shape( A );
const CBLAS_INT M = (CBLAS_INT)shape[ 0 ];
const CBLAS_INT N = (CBLAS_INT)shape[ 1 ];
const CBLAS_INT strideA1 = (CBLAS_INT)stdlib_ndarray_stride_elements( A, 0 );
const CBLAS_INT strideA2 = (CBLAS_INT)stdlib_ndarray_stride_elements( A, 1 );
const CBLAS_INT offsetA = (CBLAS_INT)stdlib_ndarray_offset_elements( A );
const CBLAS_INT strideB1 = (CBLAS_INT)stdlib_ndarray_stride_elements( B, 0 );
const CBLAS_INT strideB2 = (CBLAS_INT)stdlib_ndarray_stride_elements( B, 1 );
const CBLAS_INT offsetB = (CBLAS_INT)stdlib_ndarray_offset_elements( B );
int32_t k;
if ( stdlib_ndarray_get_int32( karr, NULL, &k ) != 0 ) {
return;
}
const stdlib_complex64_t *dataA = (const stdlib_complex64_t *)stdlib_ndarray_data( A );
stdlib_complex64_t *dataB = (stdlib_complex64_t *)stdlib_ndarray_data( B );
API_SUFFIX(stdlib_strided_ctril_ndarray)( M, N, k, dataA, strideA1, strideA2, offsetA, dataB, strideB1, strideB2, offsetB );
}
void stdlib_blas_ext_ctril( const struct ndarray *arrays[] ) {
const struct ndarray *A = arrays[ 0 ];
const struct ndarray *B = arrays[ 1 ];
const struct ndarray *karr = arrays[ 2 ];
const int64_t *shape = stdlib_ndarray_shape( A );
const CBLAS_INT M = (CBLAS_INT)shape[ 0 ];
const CBLAS_INT N = (CBLAS_INT)shape[ 1 ];
const CBLAS_INT strideA1 = (CBLAS_INT)stdlib_ndarray_stride_elements( A, 0 );
const CBLAS_INT strideA2 = (CBLAS_INT)stdlib_ndarray_stride_elements( A, 1 );
const CBLAS_INT offsetA = (CBLAS_INT)stdlib_ndarray_offset_elements( A );
const CBLAS_INT strideB1 = (CBLAS_INT)stdlib_ndarray_stride_elements( B, 0 );
const CBLAS_INT strideB2 = (CBLAS_INT)stdlib_ndarray_stride_elements( B, 1 );
const CBLAS_INT offsetB = (CBLAS_INT)stdlib_ndarray_offset_elements( B );
const stdlib_complex64_t *dataA;
stdlib_complex64_t *dataB;
int32_t k;
if ( stdlib_ndarray_get_int32( karr, NULL, &k ) != 0 ) {
return;
}
dataA = (const stdlib_complex64_t *)stdlib_ndarray_data( A );
dataB = (stdlib_complex64_t *)stdlib_ndarray_data( B );
API_SUFFIX(stdlib_strided_ctril_ndarray)( M, N, (CBLAS_INT)k, dataA, strideA1, strideA2, offsetA, dataB, strideB1, strideB2, offsetB );
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To adhere to C89/C90 standards, let's move all variable declarations to the top of the function before any statements (avoiding declarations after the if check). Also, let's explicitly cast k to (CBLAS_INT)k when calling the strided function.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please align benchmark.length.c with the canonical C benchmark pattern in merged PR #15659 . Standard stdlib C benchmarks use the static double benchmark( int iterations, int N ) signature, standard printf( "should not return NaN\n" ) on stdout, and regular TAP summary via print_summary( count, count ) without custom int *passed parameters.

@yb175

yb175 commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @AryanSharma48 for review , fixed first pass comments !

static double benchmark( int iterations, int len ) {
enum STDLIB_NDARRAY_INDEX_MODE imode;
static double benchmark( int iterations, int N ) {
int n = N;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
int n = N;
* @param n number of matrix rows and columns
* @return elapsed time in seconds
*/
static double benchmark( int iterations, int n ) {

shape[ 1 ] = n;
strides[ 0 ] = (int64_t)n * STDLIB_NDARRAY_COMPLEX64_BYTES_PER_ELEMENT;
strides[ 1 ] = STDLIB_NDARRAY_COMPLEX64_BYTES_PER_ELEMENT;
kstrides[ 0 ] = STDLIB_NDARRAY_INT32_BYTES_PER_ELEMENT;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
kstrides[ 0 ] = STDLIB_NDARRAY_INT32_BYTES_PER_ELEMENT;
kstrides[ 0 ] = 0;

elapsed = benchmark( iter, len );
printf( "# c::%s:size=%d\n", NAME, n*n );
elapsed = benchmark( iter, n );
print_results( iter, elapsed );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing TAP ok line.

Suggested change
print_results( iter, elapsed );
print_results( iter, elapsed );
printf( "ok %d benchmark finished\n", count );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var ctril = require( './../lib/main.js' );

- a zero-dimensional ndarray specifying the diagonal above which to
ignore.
- a zero-dimensional ndarray specifying the diagonal above which
to ignore.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the original wrapping.

Suggested change
to ignore.
- a zero-dimensional ndarray specifying the diagonal above which to
ignore.

#include "stdlib/ndarray/index_modes.h"
#include "stdlib/ndarray/orders.h"
#include "stdlib/ndarray/base/bytes_per_element.h"
#include "stdlib/complex/float32/ctor.h"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include "stdlib/complex/float32/ctor.h"
#include "stdlib/complex/float32/ctor.h"
#include "stdlib/complex/float32/real.h"
#include "stdlib/complex/float32/imag.h"

2 * STDLIB_NDARRAY_COMPLEX64_BYTES_PER_ELEMENT,
STDLIB_NDARRAY_COMPLEX64_BYTES_PER_ELEMENT
};
int64_t kstrides[] = { STDLIB_NDARRAY_INT32_BYTES_PER_ELEMENT };

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
int64_t kstrides[] = { STDLIB_NDARRAY_INT32_BYTES_PER_ELEMENT };
int64_t kstrides[] = { 0 };

for ( int i = 0; i < 4; i++ ) {
stdlib_complex64_parts_t parts;
parts.value = dataB[ i ];
printf( "dataB[ %i ] = (%f, %f)\n", i, parts.parts[ 0 ], parts.parts[ 1 ] );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the accessors.

Suggested change
printf( "dataB[ %i ] = (%f, %f)\n", i, parts.parts[ 0 ], parts.parts[ 1 ] );
printf( "dataB[ %i ] = (%f, %f)\n", i, stdlib_complex64_real( dataB[ i ] ), stdlib_complex64_imag( dataB[ i ] ) );

Comment on lines +33 to +40
*
* ## Notes
*
* - The function expects the following ndarrays:
*
* - a two-dimensional input ndarray corresponding to `A`.
* - a two-dimensional output ndarray corresponding to `B`.
* - a zero-dimensional int32 ndarray specifying the diagonal above which to ignore.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Headers only keep the one-line description.

Suggested change
*
* ## Notes
*
* - The function expects the following ndarrays:
*
* - a two-dimensional input ndarray corresponding to `A`.
* - a two-dimensional output ndarray corresponding to `B`.
* - a zero-dimensional int32 ndarray specifying the diagonal above which to ignore.

Comment on lines +38 to +61
const struct ndarray *A = arrays[ 0 ];
const struct ndarray *B = arrays[ 1 ];
const struct ndarray *karr = arrays[ 2 ];

const int64_t *shape = stdlib_ndarray_shape( A );
const CBLAS_INT M = (CBLAS_INT)shape[ 0 ];
const CBLAS_INT N = (CBLAS_INT)shape[ 1 ];

const CBLAS_INT strideA1 = (CBLAS_INT)stdlib_ndarray_stride_elements( A, 0 );
const CBLAS_INT strideA2 = (CBLAS_INT)stdlib_ndarray_stride_elements( A, 1 );
const CBLAS_INT offsetA = (CBLAS_INT)stdlib_ndarray_offset_elements( A );
const CBLAS_INT strideB1 = (CBLAS_INT)stdlib_ndarray_stride_elements( B, 0 );
const CBLAS_INT strideB2 = (CBLAS_INT)stdlib_ndarray_stride_elements( B, 1 );
const CBLAS_INT offsetB = (CBLAS_INT)stdlib_ndarray_offset_elements( B );
const stdlib_complex64_t *dataA;
stdlib_complex64_t *dataB;
int32_t k;
if ( stdlib_ndarray_get_int32( karr, NULL, &k ) != 0 ) {
return;
}

dataA = (const stdlib_complex64_t *)stdlib_ndarray_data( A );
dataB = (stdlib_complex64_t *)stdlib_ndarray_data( B );
API_SUFFIX(stdlib_strided_ctril_ndarray)( M, N, (CBLAS_INT)k, dataA, strideA1, strideA2, offsetA, dataB, strideB1, strideB2, offsetB );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged packages read k directly (e.g. zwxsa), same as ztril.

Suggested change
const struct ndarray *A = arrays[ 0 ];
const struct ndarray *B = arrays[ 1 ];
const struct ndarray *karr = arrays[ 2 ];
const int64_t *shape = stdlib_ndarray_shape( A );
const CBLAS_INT M = (CBLAS_INT)shape[ 0 ];
const CBLAS_INT N = (CBLAS_INT)shape[ 1 ];
const CBLAS_INT strideA1 = (CBLAS_INT)stdlib_ndarray_stride_elements( A, 0 );
const CBLAS_INT strideA2 = (CBLAS_INT)stdlib_ndarray_stride_elements( A, 1 );
const CBLAS_INT offsetA = (CBLAS_INT)stdlib_ndarray_offset_elements( A );
const CBLAS_INT strideB1 = (CBLAS_INT)stdlib_ndarray_stride_elements( B, 0 );
const CBLAS_INT strideB2 = (CBLAS_INT)stdlib_ndarray_stride_elements( B, 1 );
const CBLAS_INT offsetB = (CBLAS_INT)stdlib_ndarray_offset_elements( B );
const stdlib_complex64_t *dataA;
stdlib_complex64_t *dataB;
int32_t k;
if ( stdlib_ndarray_get_int32( karr, NULL, &k ) != 0 ) {
return;
}
dataA = (const stdlib_complex64_t *)stdlib_ndarray_data( A );
dataB = (stdlib_complex64_t *)stdlib_ndarray_data( B );
API_SUFFIX(stdlib_strided_ctril_ndarray)( M, N, (CBLAS_INT)k, dataA, strideA1, strideA2, offsetA, dataB, strideB1, strideB2, offsetB );
const struct ndarray *A = arrays[ 0 ];
const struct ndarray *B = arrays[ 1 ];
int32_t k;
stdlib_ndarray_get_int32( arrays[ 2 ], NULL, &k );
const CBLAS_INT M = stdlib_ndarray_dimension( A, 0 );
const CBLAS_INT N = stdlib_ndarray_dimension( A, 1 );
const CBLAS_INT strideA1 = stdlib_ndarray_stride_elements( A, 0 );
const CBLAS_INT strideA2 = stdlib_ndarray_stride_elements( A, 1 );
const CBLAS_INT offsetA = stdlib_ndarray_offset_elements( A );
const CBLAS_INT strideB1 = stdlib_ndarray_stride_elements( B, 0 );
const CBLAS_INT strideB2 = stdlib_ndarray_stride_elements( B, 1 );
const CBLAS_INT offsetB = stdlib_ndarray_offset_elements( B );
const stdlib_complex64_t *dataA = (const stdlib_complex64_t *)stdlib_ndarray_data( A );
stdlib_complex64_t *dataB = (stdlib_complex64_t *)stdlib_ndarray_data( B );
API_SUFFIX(stdlib_strided_ctril_ndarray)( M, N, k, dataA, strideA1, strideA2, offsetA, dataB, strideB1, strideB2, offsetB );

"@stdlib/ndarray/orders",
"@stdlib/ndarray/base/bytes-per-element"
"@stdlib/ndarray/base/bytes-per-element",
"@stdlib/complex/float32/ctor"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"@stdlib/complex/float32/ctor"
"@stdlib/complex/float32/ctor",
"@stdlib/complex/float32/real",
"@stdlib/complex/float32/imag"


## C APIs

<section class="intro">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<section class="intro">
<!-- 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">


<!-- /.intro -->

<section class="usage">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<section class="usage">
<!-- C usage documentation. -->
<section class="usage">

#include <stdlib.h>
#include <stdio.h>

int main( void ) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The usage block should be a short snippet without int main(), like in zwxsa.


<!-- /.usage -->

<section class="notes">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


<!-- /.notes -->

<section class="examples">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<section class="examples">
<!-- C API usage examples. -->
<section class="examples">

#include <stdlib.h>
#include <stdio.h>

int main( void ) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should match examples/c/example.c exactly (comments and blank lines are missing).

@ujjwalv01 ujjwalv01 added the Needs Changes Pull request which needs changes before being merged. label Oct 14, 2026
@ujjwalv01

Copy link
Copy Markdown
Member

@yb175 Left a few suggestions, PTAL ;

@yb175

yb175 commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

@ujjwalv01 done the requested changes , please have a look !

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). Needs Changes Pull request which needs changes before being merged. Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants