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.
 
ntp_adjtime(2)							   System Calls 						    ntp_adjtime(2)

NAME
ntp_adjtime - adjust local clock parameters SYNOPSIS
#include <sys/timex.h> int ntp_adjtime(struct timex *tptr); DESCRIPTION
The ntp_adjtime() function adjusts the parameters used to discipline the local clock, according to the values in the struct timex pointed to by tptr. Before returning, it fills in the structure with the most recent values kept in the kernel. The adjustment is effected in part by speeding up or slowing down the clock, as necessary, and in part by phase-locking onto a once-per second pulse (PPS) provided by a driver, if available. struct timex { uint32_t modes; /* clock mode bits (w) */ int32_t offset; /* time offset (us) (rw) */ int32_t freq; /* frequency offset (scaled ppm) (rw) */ int32_t maxerror; /* maximum error (us) (rw) */ int32_t esterror; /* estimated error (us) (rw) */ int32_t status; /* clock status bits (rw) */ int32_t constant; /* pll time constant (rw) */ int32_t precision; /* clock precision (us) (r) */ int32_t tolerance; /* clock frequency tolerance (scaled ppm) (r) */ int32_t ppsfreq; /* pps frequency (scaled ppm) (r) */ int32_t jitter; /* pps jitter (us) (r) */ int32_t shift; /* interval duration (s) (shift) (r) */ int32_t stabil; /* pps stability (scaled ppm) (r) */ int32_t jitcnt; /* jitter limit exceeded (r) */ int32_t calcnt; /* calibration intervals (r) */ int32_t errcnt; /* calibration errors (r) */ int32_t stbcnt; /* stability limit exceeded (r) */ }; RETURN VALUES
Upon successful completion, ntp_adjtime() returns the current clock state (see <sys/timex.h>). Otherwise, it returns -1 and sets errno to indicate the error. ERRORS
The ntp_adjtime() function will fail if: EFAULT The tptr argument is an invalid pointer. EINVAL The constant member of the structure pointed to by tptr is less than 0 or greater than 30. EPERM The {PRIV_SYS_TIME} privilege is not asserted in the effective set of the calling process. SEE ALSO
xntpd(1M), ntp_gettime(2), privileges(5) SunOS 5.11 1 Feb 2003 ntp_adjtime(2)
All times are GMT -4. The time now is 06:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy