QDP++
include
scalarsite_generic
generic_blas_local_sumsq.h
Go to the documentation of this file.
1
// $Id: generic_blas_local_sumsq.h,v 1.3 2009-09-15 20:48:41 bjoo Exp $
2
7
8
#ifndef QDP_GENERIC_BLAS_LOCAL_SUMSQ
9
#define QDP_GENERIC_BLAS_LOCAL_SUMSQ
10
11
12
namespace
QDP
{
13
14
// (Double) (*out) = || (Vector) In ||^2 (local to node)
15
inline
16
void
local_sumsq
(
DOUBLE
*Out,
REAL
*In,
int
n_3vec)
17
{
18
19
double
result;
20
double
i1;
21
22
int
len = 24*n_3vec;
23
24
// QDPIO::cout << "Len = " << len << endl;
25
int
counter;
26
result = 0;
27
28
if
( n_3vec > 0 ) {
29
#pragma omp parallel for reduction(+:result) private(i1)
30
for
(counter=0; counter < len; counter++) {
31
i1 = (double)In[counter];
32
result += i1*i1;
33
}
34
}
35
36
*Out=(
DOUBLE
)result;
37
}
38
39
40
}
// namespace QDP;
41
42
#endif
// guard
QDP::REAL
REAL32 REAL
Definition
qdp_scalarsite_defs.h:28
QDP::DOUBLE
REAL64 DOUBLE
Definition
qdp_scalarsite_defs.h:29
QDP
Yet another random number generator.
Definition
qdp_bgq_threadbind.cc:16
QDP::local_sumsq
void local_sumsq(DOUBLE *Out, REAL *In, int n_3vec)
Definition
generic_blas_local_sumsq.h:16
Generated by
1.16.1