Unix/Linux Go Back    


High Performance Computing Message Passing Interface (MPI) programming and tuning, MPI library installation and management, parallel administration tools, cluster monitoring, cluster optimization, and more HPC topics.

Vectorization

High Performance Computing


Tags
c++, performance, sse, vectorize

Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 03-28-2014   -   Original Discussion by a3mlord
a3mlord a3mlord is offline
Registered User
 
Join Date: Mar 2014
Last Activity: 29 March 2014, 12:29 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Signal Vectorization

Hi,

I have the following vectorized code:

Code:
long valor = 0, i=0;

 __m128i vsum, vecPi, vecCi, vecQCi;

 vsum = _mm_set1_epi32(0);

 int32_t * const pA = A->data;
 int32_t * const pB = B->data;

 int sumDot[1];

 for( ; i<SIZE-3 ;i+=4){

 vecPi = _mm_loadu_si128((__m128i *)&(pA)[i] );
 vecCi = _mm_loadu_si128((__m128i *)&(pB)[i] );
 vecQCi = _mm_mullo_epi32(vecPi,vecCi);
 vsum = _mm_add_epi32(vsum,vecQCi);

 } 
 vsum = _mm_hadd_epi32(vsum, vsum);
 vsum = _mm_hadd_epi32(vsum, vsum);
 _mm_storeu_si128((__m128i *)&(sumDot), vsum);

 for( ; i<SIZE; i++)
 valor += A->data[i] * B->data[i];   valor += sumDot[0];

However, as I get overflows, I need to handle those cases. Could you please help me with that?

Thanks

Last edited by bartus11; 03-28-2014 at 06:06 PM.. Reason: Please use [code][/code] tags.
Sponsored Links
    #2  
Old Unix and Linux 03-28-2014   -   Original Discussion by a3mlord
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 21 November 2017, 3:22 PM EST
Location: Saskatchewan
Posts: 22,518
Thanks: 1,154
Thanked 4,273 Times in 3,946 Posts
What compiler is this?
Sponsored Links
    #3  
Old Unix and Linux 03-29-2014   -   Original Discussion by a3mlord
a3mlord a3mlord is offline
Registered User
 
Join Date: Mar 2014
Last Activity: 29 March 2014, 12:29 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
ipcp and g++, I use both.

---------- Post updated 03-29-14 at 11:29 AM ---------- Previous update was 03-28-14 at 04:52 PM ----------

Someone?
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes



All times are GMT -4. The time now is 08:45 AM.