Skip to content

Commit 9509466

Browse files
Merge branch 'develop' into bench-csrot-dynamic-alloc
2 parents 9ae9916 + 9125c9c commit 9509466

File tree

2 files changed

+28
-24
lines changed

2 files changed

+28
-24
lines changed

lib/node_modules/@stdlib/blas/base/ccopy/benchmark/c/benchmark.length.c

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ static double benchmark2( int iterations, int len ) {
138138
float *y;
139139
double t;
140140
int i;
141+
<<<<<<< HEAD
142+
=======
143+
144+
>>>>>>> 9125c9c2ad97f1b875413af6a594b831bce940f8
141145
x = (float *) malloc( len * 2 * sizeof( float ) );
142146
y = (float *) malloc( len * 2 * sizeof( float ) );
143147
for ( i = 0; i < len; i++ ) {
@@ -158,26 +162,14 @@ static double benchmark2( int iterations, int len ) {
158162
if ( y[ 0 ] != y[ 0 ] ) {
159163
printf( "should not return NaN\n" );
160164
}
165+
<<<<<<< HEAD
161166
free(x);
162167
free(y);
163-
return elapsed;
164-
}
165-
166-
/**
167-
* Main execution sequence.
168-
*/
169-
int main( void ) {
170-
double elapsed;
171-
int count;
172-
int iter;
173-
int len;
174-
int i;
175-
int j;
176-
177-
// Use the current time to seed the random number generator:
178-
srand( time( NULL ) );
179-
180-
print_version();
168+
=======
169+
free( x );
170+
free( y );
171+
>>>>>>> 9125c9c2ad97f1b875413af6a594b831bce940f8
172+
rsion();
181173
count = 0;
182174
for ( i = MIN; i <= MAX; i++ ) {
183175
len = pow( 10, i );

lib/node_modules/@stdlib/blas/base/csrot/benchmark/c/benchmark.length.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,21 @@ static float rand_float( void ) {
9797
static double benchmark1( int iterations, int len ) {
9898
double elapsed;
9999
float *x;
100+
<<<<<<< HEAD
100101
float *y;
101102
double t;
102103
int i;
103104

104105
x = (float *) malloc( len * 2 * sizeof( float ) );
105106
y = (float *) malloc( len * 2 * sizeof( float ) );
107+
=======
108+
109+
float *y;
110+
double t;
111+
int i;
112+
x = (float *)( malloc( len * 2 * sizeof( float ) ) );
113+
y = (float *)( malloc( len * 2 * sizeof( float ) ) );
114+
>>>>>>> 9125c9c2ad97f1b875413af6a594b831bce940f8
106115
for ( i = 0; i < len; i++ ) {
107116
x[ i ] = ( rand_float()*10000.0f ) - 5000.0f;
108117
x[ i+1 ] = ( rand_float()*10000.0f ) - 5000.0f;
@@ -139,11 +148,14 @@ static double benchmark2( int iterations, int len ) {
139148
float *y;
140149
double t;
141150
int i;
151+
<<<<<<< HEAD
142152
x = (float *) malloc( len * 2 * sizeof( float ) );
143153
y = (float *) malloc( len * 2 * sizeof( float ) );
144-
for ( i = 0; i < len; i++ ) {
145-
x[ i ] = ( rand_float()*10000.0f ) - 5000.0f;
146-
x[ i+1 ] = ( rand_float()*10000.0f ) - 5000.0f;
154+
=======
155+
x = (float *)( malloc( len * 2 * sizeof( float ) ) );
156+
y = (float *)( malloc( len * 2 * sizeof( float ) ) );
157+
>>>>>>> 9125c9c2ad97f1b875413af6a594b831bce940f8
158+
= ( rand_float()*10000.0f ) - 5000.0f;
147159
y[ i ] = ( rand_float()*10000.0f ) - 5000.0f;
148160
y[ i+1 ] = ( rand_float()*10000.0f ) - 5000.0f;
149161
}
@@ -159,16 +171,16 @@ static double benchmark2( int iterations, int len ) {
159171
if ( y[ 0 ] != y[ 0 ] ) {
160172
printf( "should not return NaN\n" );
161173
}
162-
free( x );
163-
free( y );
164174
return elapsed;
165175
}
166176

167177
/**
168178
* Main execution sequence.
169179
*/
170180
int main( void ) {
171-
double elapsed;
181+
double elapsed
182+
free( x );
183+
free( y );;
172184
int count;
173185
int iter;
174186
int len;

0 commit comments

Comments
 (0)