Skip to content

Commit 0d09cce

Browse files
authored
bench: add const qualifiers
Signed-off-by: Athan <[email protected]>
1 parent 07c6072 commit 0d09cce

File tree

1 file changed

+48
-48
lines changed
  • lib/node_modules/@stdlib/ndarray/base/bind2vind/benchmark/c

1 file changed

+48
-48
lines changed

lib/node_modules/@stdlib/ndarray/base/bind2vind/benchmark/c/benchmark.c

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ static double benchmark1( void ) {
9999
double t;
100100
int i;
101101

102-
int64_t ndims = 3;
102+
const int64_t ndims = 3;
103103
const int64_t shape[] = { 10, 10, 10 };
104104
const int64_t strides[] = { 100, -10, 1 };
105-
int64_t offset = 90;
106-
int64_t len = 1000;
105+
const int64_t offset = 90;
106+
const int64_t len = 1000;
107107

108108
t = tic();
109109
for ( i = 0; i < ITERATIONS; i++ ) {
@@ -133,11 +133,11 @@ static double benchmark2( void ) {
133133
double t;
134134
int i;
135135

136-
int64_t ndims = 3;
136+
const int64_t ndims = 3;
137137
const int64_t shape[] = { 10, 10, 10 };
138138
const int64_t strides[] = { 1, -10, 100 };
139-
int64_t offset = 90;
140-
int64_t len = 1000;
139+
const int64_t offset = 90;
140+
const int64_t len = 1000;
141141

142142
t = tic();
143143
for ( i = 0; i < ITERATIONS; i++ ) {
@@ -167,11 +167,11 @@ static double benchmark3( void ) {
167167
double t;
168168
int i;
169169

170-
int64_t ndims = 3;
170+
const int64_t ndims = 3;
171171
const int64_t shape[] = { 10, 10, 10 };
172172
const int64_t strides[] = { 100, 10, 1 };
173-
int64_t offset = 0;
174-
int64_t len = 1000;
173+
const int64_t offset = 0;
174+
const int64_t len = 1000;
175175

176176
t = tic();
177177
for ( i = 0; i < ITERATIONS; i++ ) {
@@ -201,11 +201,11 @@ static double benchmark4( void ) {
201201
double t;
202202
int i;
203203

204-
int64_t ndims = 3;
204+
const int64_t ndims = 3;
205205
const int64_t shape[] = { 10, 10, 10 };
206206
const int64_t strides[] = { 1, 10, 100 };
207-
int64_t offset = 0;
208-
int64_t len = 1000;
207+
const int64_t offset = 0;
208+
const int64_t len = 1000;
209209

210210
t = tic();
211211
for ( i = 0; i < ITERATIONS; i++ ) {
@@ -235,11 +235,11 @@ static double benchmark5( void ) {
235235
double t;
236236
int i;
237237

238-
int64_t ndims = 3;
238+
const int64_t ndims = 3;
239239
const int64_t shape[] = { 10, 10, 10 };
240240
const int64_t strides[] = { 100, -10, 1 };
241-
int64_t offset = 90;
242-
int64_t len = 1000;
241+
const int64_t offset = 90;
242+
const int64_t len = 1000;
243243

244244
t = tic();
245245
for ( i = 0; i < ITERATIONS; i++ ) {
@@ -269,11 +269,11 @@ static double benchmark6( void ) {
269269
double t;
270270
int i;
271271

272-
int64_t ndims = 3;
272+
const int64_t ndims = 3;
273273
const int64_t shape[] = { 10, 10, 10 };
274274
const int64_t strides[] = { 1, -10, 100 };
275-
int64_t offset = 90;
276-
int64_t len = 1000;
275+
const int64_t offset = 90;
276+
const int64_t len = 1000;
277277

278278
t = tic();
279279
for ( i = 0; i < ITERATIONS; i++ ) {
@@ -303,11 +303,11 @@ static double benchmark7( void ) {
303303
double t;
304304
int i;
305305

306-
int64_t ndims = 3;
306+
const int64_t ndims = 3;
307307
const int64_t shape[] = { 10, 10, 10 };
308308
const int64_t strides[] = { 100, 10, 1 };
309-
int64_t offset = 0;
310-
int64_t len = 1000;
309+
const int64_t offset = 0;
310+
const int64_t len = 1000;
311311

312312
t = tic();
313313
for ( i = 0; i < ITERATIONS; i++ ) {
@@ -337,11 +337,11 @@ static double benchmark8( void ) {
337337
double t;
338338
int i;
339339

340-
int64_t ndims = 3;
340+
const int64_t ndims = 3;
341341
const int64_t shape[] = { 10, 10, 10 };
342342
const int64_t strides[] = { 1, 10, 100 };
343-
int64_t offset = 0;
344-
int64_t len = 1000;
343+
const int64_t offset = 0;
344+
const int64_t len = 1000;
345345

346346
t = tic();
347347
for ( i = 0; i < ITERATIONS; i++ ) {
@@ -371,11 +371,11 @@ static double benchmark9( void ) {
371371
double t;
372372
int i;
373373

374-
int64_t ndims = 3;
374+
const int64_t ndims = 3;
375375
const int64_t shape[] = { 10, 10, 10 };
376376
const int64_t strides[] = { 100, -10, 1 };
377-
int64_t offset = 90;
378-
int64_t len = 1000;
377+
const int64_t offset = 90;
378+
const int64_t len = 1000;
379379

380380
t = tic();
381381
for ( i = 0; i < ITERATIONS; i++ ) {
@@ -405,11 +405,11 @@ static double benchmark10( void ) {
405405
double t;
406406
int i;
407407

408-
int64_t ndims = 3;
408+
const int64_t ndims = 3;
409409
const int64_t shape[] = { 10, 10, 10 };
410410
const int64_t strides[] = { 1, -10, 100 };
411-
int64_t offset = 90;
412-
int64_t len = 1000;
411+
const int64_t offset = 90;
412+
const int64_t len = 1000;
413413

414414
t = tic();
415415
for ( i = 0; i < ITERATIONS; i++ ) {
@@ -439,11 +439,11 @@ static double benchmark11( void ) {
439439
double t;
440440
int i;
441441

442-
int64_t ndims = 3;
442+
const int64_t ndims = 3;
443443
const int64_t shape[] = { 10, 10, 10 };
444444
const int64_t strides[] = { 100, 10, 1 };
445-
int64_t offset = 0;
446-
int64_t len = 1000;
445+
const int64_t offset = 0;
446+
const int64_t len = 1000;
447447

448448
t = tic();
449449
for ( i = 0; i < ITERATIONS; i++ ) {
@@ -473,11 +473,11 @@ static double benchmark12( void ) {
473473
double t;
474474
int i;
475475

476-
int64_t ndims = 3;
476+
const int64_t ndims = 3;
477477
const int64_t shape[] = { 10, 10, 10 };
478478
const int64_t strides[] = { 1, 10, 100 };
479-
int64_t offset = 0;
480-
int64_t len = 1000;
479+
const int64_t offset = 0;
480+
const int64_t len = 1000;
481481

482482
t = tic();
483483
for ( i = 0; i < ITERATIONS; i++ ) {
@@ -507,11 +507,11 @@ static double benchmark13( void ) {
507507
double t;
508508
int i;
509509

510-
int64_t ndims = 3;
510+
const int64_t ndims = 3;
511511
const int64_t shape[] = { 10, 10, 10 };
512512
const int64_t strides[] = { 100, -10, 1 };
513-
int64_t offset = 90;
514-
int64_t len = 1000;
513+
const int64_t offset = 90;
514+
const int64_t len = 1000;
515515

516516
t = tic();
517517
for ( i = 0; i < ITERATIONS; i++ ) {
@@ -541,11 +541,11 @@ static double benchmark14( void ) {
541541
double t;
542542
int i;
543543

544-
int64_t ndims = 3;
544+
const int64_t ndims = 3;
545545
const int64_t shape[] = { 10, 10, 10 };
546546
const int64_t strides[] = { 1, -10, 100 };
547-
int64_t offset = 90;
548-
int64_t len = 1000;
547+
const int64_t offset = 90;
548+
const int64_t len = 1000;
549549

550550
t = tic();
551551
for ( i = 0; i < ITERATIONS; i++ ) {
@@ -575,11 +575,11 @@ static double benchmark15( void ) {
575575
double t;
576576
int i;
577577

578-
int64_t ndims = 3;
578+
const int64_t ndims = 3;
579579
const int64_t shape[] = { 10, 10, 10 };
580580
const int64_t strides[] = { 100, 10, 1 };
581-
int64_t offset = 0;
582-
int64_t len = 1000;
581+
const int64_t offset = 0;
582+
const int64_t len = 1000;
583583

584584
t = tic();
585585
for ( i = 0; i < ITERATIONS; i++ ) {
@@ -609,11 +609,11 @@ static double benchmark16( void ) {
609609
double t;
610610
int i;
611611

612-
int64_t ndims = 3;
612+
const int64_t ndims = 3;
613613
const int64_t shape[] = { 10, 10, 10 };
614614
const int64_t strides[] = { 1, 10, 100 };
615-
int64_t offset = 0;
616-
int64_t len = 1000;
615+
const int64_t offset = 0;
616+
const int64_t len = 1000;
617617

618618
t = tic();
619619
for ( i = 0; i < ITERATIONS; i++ ) {

0 commit comments

Comments
 (0)