开发者

Array of sse type: Segmentation Fault

开发者 https://www.devze.com 2023-02-15 01:15 出处:网络
today I tried to initialize an array of the sse type __m128d. Unfortunately it didn\'t work - why? Is it generally impossible to create arrays of sse types (since they are register types?). The follow

today I tried to initialize an array of the sse type __m128d. Unfortunately it didn't work - why? Is it generally impossible to create arrays of sse types (since they are register types?). The following code segfaults at the assignment in the loop.

__m128d* _buffers = new __m128d[32];
for(int i=0;i<32;i++)
    _buffers[i] = _mm_setzero_pd();

R开发者_如何学JAVAegards + Boom


You must use _mm_malloc() or _aligned_malloc(), depending on what's the preferred function name on your compiler. __m128[di] in combination with new is almost always bad mojo.

0

精彩评论

暂无评论...
验证码 换一张
取 消