File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
lib/node_modules/@stdlib/strided/base/smskmap/benchmark/c Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -106,13 +106,16 @@ static float identity( const float x ) {
106106* @return elapsed time in seconds
107107*/
108108static double benchmark ( int iterations , int len ) {
109- uint8_t m [ len ];
110109 double elapsed ;
111- float x [ len ];
112- float y [ len ];
110+ uint8_t * m ;
111+ float * x ;
112+ float * y ;
113113 double t ;
114114 int i ;
115115
116+ m = (uint8_t * )malloc ( len * sizeof ( uint8_t ) );
117+ x = (float * )malloc ( len * sizeof ( float ) );
118+ y = (float * )malloc ( len * sizeof ( float ) );
116119 for ( i = 0 ; i < len ; i ++ ) {
117120 x [ i ] = ( rand_float ()* 200.0f ) - 100.0f ;
118121 m [ i ] = i % 2 ;
@@ -131,6 +134,9 @@ static double benchmark( int iterations, int len ) {
131134 if ( y [ i %len ] != y [ i %len ] ) {
132135 printf ( "should not return NaN\n" );
133136 }
137+ free ( m );
138+ free ( x );
139+ free ( y );
134140 return elapsed ;
135141}
136142
You can’t perform that action at this time.
0 commit comments