Quantcast
Channel: Intel® Many Integrated Core Architecture
Viewing all articles
Browse latest Browse all 1347

_mm256_add_ps crashes program

$
0
0

Hello ,

I am using in my code something like:
 

int x , y;

float * TempD = (float*) _mm_malloc( N * sizeof(*TempD) ,64 );

__m256  * SIMDTempD = (__m256*) TempD;
__m256  * theX = (__m256*) X;
__m256  * theY = (__m256*) Y;
__m256i * theV = (__m256i*) V;
__m256i * theVoronoi = (__m256i*) Vor;

__m256 Xd ,Yd ,XdSquared ,YdSquared;

 

and then in a loop:
 

__m256i tempx = _mm256_set1_epi32( x );
__m256    xIdx  = _mm256_castsi256_ps( tempx );

__m256i tempy = _mm256_set1_epi32( y );
 __m256    yIdx  = _mm256_castsi256_ps( tempy );

Xd = _mm256_sub_ps( theX[ i ] , xIdx );
Yd = _mm256_sub_ps( theY[ i ] , yIdx );

distXSquared = _mm256_mul_ps( Xd , Xd );
distYSquared = _mm256_mul_ps( Yd , Yd );

SIMDTempD[ i ] = _mm256_add_ps( XdSquared , YdSquared );


 __m256 theMin = _mm256_min_ps( SIMDTempDistance[ i ]  , D );

 

When I run the code it gives :

*** glibc detected *** .. double free or corruption 

 

If I comment out the line :

SIMDTempD[ i ] = _mm256_add_ps( XdSquared , YdSquared );

then the code runs without a problem!

Am I missing something here?

 


Viewing all articles
Browse latest Browse all 1347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>