Sponsored Content
Full Discussion: Vectorization
Special Forums UNIX and Linux Applications High Performance Computing Vectorization Post 302895149 by a3mlord on Friday 28th of March 2014 05:03:17 PM
Old 03-28-2014
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.
 
SoSwitchElement(3)						       Coin							SoSwitchElement(3)

NAME
SoSwitchElement - The SoSwitchElement class is yet to be documented. FIXME: write doc. SYNOPSIS
#include <Inventor/elements/SoSwitchElement.h> Inherits SoInt32Element. Public Member Functions virtual void init (SoState *state) FIXME: write doc. Static Public Member Functions static SoType getClassTypeId (void) static int getClassStackIndex (void) static void * createInstance (void) static void initClass (void) static void set (SoState *const state, SoNode *const node, const int32_t index) FIXME: write doc. static void set (SoState *const state, const int32_t index) FIXME: write doc. static int32_t get (SoState *const state) FIXME: write doc. static int32_t getDefault () FIXME: write doc. Protected Member Functions virtual ~SoSwitchElement () Additional Inherited Members Detailed Description The SoSwitchElement class is yet to be documented. FIXME: write doc. Constructor &; Destructor Documentation SoSwitchElement::~SoSwitchElement (void) [protected], [virtual] The destructor. Member Function Documentation SoType SoSwitchElement::getClassTypeId (void) [static] This static method returns the class type. Reimplemented from SoInt32Element. int SoSwitchElement::getClassStackIndex (void) [static] This static method returns the state stack index for the class. Reimplemented from SoInt32Element. void * SoSwitchElement::createInstance (void) [static] This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. void SoSwitchElement::initClass (void) [static] This static method initializes static data for the SoSwitchElement class. Reimplemented from SoInt32Element. Author Generated automatically by Doxygen for Coin from the source code. Version 3.1.3 Wed May 23 2012 SoSwitchElement(3)
All times are GMT -4. The time now is 11:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy