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?