本文整理汇总了C++中ATL_AlignPtr函数的典型用法代码示例。如果您正苦于以下问题:C++ ATL_AlignPtr函数的具体用法?C++ ATL_AlignPtr怎么用?C++ ATL_AlignPtr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ATL_AlignPtr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cblas_cher2
void cblas_cher2(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
const int N, const void *alpha,
const void *X, const int incX,
const void *Y, const int incY, void *A, const int lda)
{
int info = 2000;
void *vx, *vy;
float *x0, *y0;
const float *x=X, *y=Y, *alp=alpha;
const float one[2]={ATL_rone, ATL_rzero};
#ifndef NoCblasErrorChecks
if (Order != CblasColMajor && Order != CblasRowMajor)
info = cblas_errprn(1, info, "Order must be %d or %d, but is set to %d",
CblasRowMajor, CblasColMajor, Order);
if (Uplo != CblasUpper && Uplo != CblasLower)
info = cblas_errprn(2, info, "UPLO must be %d or %d, but is set to %d",
CblasUpper, CblasLower, Uplo);
if (N < 0) info = cblas_errprn(3, info,
"N cannot be less than zero; is set to %d.", N);
if (!incX) info = cblas_errprn(6, info,
"incX cannot be zero; is set to %d.", incX);
if (!incY) info = cblas_errprn(8, info,
"incY cannot be zero; is set to %d.", incY);
if (lda < N || lda < 1)
info = cblas_errprn(10, info, "lda must be >= MAX(N,1): lda=%d N=%d",
lda, N);
if (info != 2000)
{
cblas_xerbla(info, "cblas_cher2", "");
return;
}
#endif
if (incX < 0) x += (1-N)*incX<<1;
if (incY < 0) y += (1-N)*incY<<1;
if (Order == CblasColMajor)
ATL_cher2(Uplo, N, alpha, x, incX, y, incY, A, lda);
else if (alp[0] != ATL_rzero || alp[1] != ATL_rzero)
{
vx = malloc(ATL_Cachelen + ATL_MulBySize(N));
vy = malloc(ATL_Cachelen + ATL_MulBySize(N));
ATL_assert(vx != NULL && vy != NULL);
x0 = ATL_AlignPtr(vx);
y0 = ATL_AlignPtr(vy);
ATL_cmoveConj(N, alpha, y, incY, y0, 1);
ATL_ccopyConj(N, x, incX, x0, 1);
ATL_cher2(( (Uplo == CblasUpper) ? CblasLower : CblasUpper ),
N, one, y0, 1, x0, 1, A, lda);
free(vx);
free(vy);
}
else ATL_cher2(( (Uplo == CblasUpper) ? CblasLower : CblasUpper ),
N, alpha, y, incY, x, incX, A, lda);
}
示例2: Mjoin
void Mjoin(Mjoin(Mjoin(PATL,herk),UploNM),N)
(const int N, const int K, const void *valpha, const void *A, const int lda,
const void *vbeta, void *C, const int ldc)
{
void *vc;
TYPE *c;
TYPE alpha[2];
const TYPE beta = *( (const TYPE *)vbeta );
const TYPE zero[2] = {0.0, 0.0};
alpha[0] = *( (const TYPE *)valpha );
if (K > HERK_Xover)
{
alpha[1] = 0.0;
vc = malloc(ATL_Cachelen+ATL_MulBySize(N)*N);
ATL_assert(vc);
c = ATL_AlignPtr(vc);
CgemmNC(N, N, K, alpha, A, lda, A, lda, zero, c, N);
if ( beta == 1.0 ) Mjoin(her_put,_b1)(N, c, vbeta, C, ldc);
else if ( beta == 0.0 ) Mjoin(her_put,_b0)(N, c, vbeta, C, ldc);
else Mjoin(her_put,_bXi0)(N, c, vbeta, C, ldc);
free(vc);
}
else Mjoin(PATL,refherk)(Uplo_, AtlasNoTrans, N, K, *alpha, A, lda,
beta, C, ldc);
}
示例3: Mjoin
int Mjoin(PATL,her2kLN)
#endif
#endif
(const int N, const int K, const void *valpha, const void *A, const int lda,
const void *B, const int ldb, const void *vbeta, void *C, const int ldc)
{
int i;
void *vc=NULL;
TYPE *c;
const TYPE beta =*( (const TYPE *)vbeta );
const TYPE zero[2]={0.0, 0.0};
i = ATL_MulBySize(N)*N;
if (i <= ATL_MaxMalloc) vc = malloc(ATL_Cachelen+i);
if (vc == NULL) return(1);
c = ATL_AlignPtr(vc);
#ifdef Transpose_
ATL_ammm(AtlasConjTrans, AtlasNoTrans, N, N, K, valpha, A, lda, B, ldb,
#else
ATL_ammm(AtlasNoTrans, AtlasConjTrans, N, N, K, valpha, A, lda, B, ldb,
#endif
zero, c, N);
if ( beta == 1.0 ) Mjoin(her2k_put,_b1)(N, c, vbeta, C, ldc);
else if ( beta == 0.0 ) Mjoin(her2k_put,_b0)(N, c, vbeta, C, ldc);
else Mjoin(her2k_put,_bXi0)(N, c, vbeta, C, ldc);
free(vc);
return(0);
}
示例4: Mjoin
void Mjoin(Mjoin(PATL,symmL),UploNM)
(const int M, const int N, const void *valpha, const void *A, const int lda,
const void *B, const int ldb, const void *vbeta, void *C, const int ldc)
{
#ifdef TREAL
const SCALAR alpha=*( (const SCALAR *)valpha );
const SCALAR beta =*( (const SCALAR *)vbeta );
const SCALAR one=1.0;
#else
#define alpha valpha
#define beta vbeta
#endif
TYPE *a;
void *va;
if (N > SYMM_Xover)
{
va = malloc(ATL_Cachelen + (ATL_MulBySize(M)*M));
ATL_assert(va);
a = ATL_AlignPtr(va);
#ifdef TREAL
if ( SCALAR_IS_ONE(alpha) )
Mjoin(Mjoin(Mjoin(PATL,sycopy),UploNM),_a1)(M, alpha, A, lda, a);
else Mjoin(Mjoin(Mjoin(PATL,sycopy),UploNM),_aX)(M, alpha, A, lda, a);
CgemmTN(M, N, M, one, a, M, B, ldb, beta, C, ldc);
#else
Mjoin(Mjoin(PATL,sycopy),UploNM)(M, A, lda, a);
CgemmTN(M, N, M, valpha, a, M, B, ldb, vbeta, C, ldc);
#endif
free(va);
}
else Mjoin(PATL,refsymm)(AtlasLeft, Uplo_, M, N, alpha, A, lda, B, ldb,
beta, C, ldc);
}
示例5: Mjoin
int Mjoin(PATL,syr2kLT)
#endif
(const int N, const int K, const void *valpha, const void *A, const int lda,
const void *B, const int ldb, const void *vbeta, void *C, const int ldc)
{
int i;
void *vc=NULL;
TYPE *c;
#ifdef TREAL
const SCALAR alpha=*( (const SCALAR *)valpha );
const SCALAR beta =*( (const SCALAR *)vbeta );
const SCALAR one=1.0, zero=0.0;
#else
#define alpha valpha
const TYPE *beta=vbeta;
const TYPE one[2]={1.0,0.0}, zero[2]={0.0,0.0};
#endif
i = ATL_MulBySize(N)*N;
if (i <= ATL_MaxMalloc) vc = malloc(ATL_Cachelen+i);
if (vc == NULL) return(1);
c = ATL_AlignPtr(vc);
CgemmTN(N, N, K, alpha, A, lda, B, ldb, zero, c, N);
if ( SCALAR_IS_ONE(beta) ) Mjoin(syr2k_put,_b1)(N, c, beta, C, ldc);
else if ( SCALAR_IS_ZERO(beta) ) Mjoin(syr2k_put,_b0)(N, c, beta, C, ldc);
#ifdef TCPLX
else if (SCALAR_IS_NONE(beta)) Mjoin(syr2k_put,_bn1)(N, c, beta, C, ldc);
else if (beta[1] == *zero) Mjoin(syr2k_put,_bXi0)(N, c, beta, C, ldc);
#endif
else Mjoin(syr2k_put,_bX)(N, c, beta, C, ldc);
free(vc);
return(0);
}
示例6: Mjoin
void Mjoin(Mjoin(Mjoin(PATL,syrk),UploNM),T)
(const int N, const int K, const void *valpha, const void *A, const int lda,
const void *vbeta, void *C, const int ldc)
{
void *vc;
TYPE *c;
#ifdef TREAL
const SCALAR alpha=*( (const SCALAR *)valpha );
const SCALAR beta =*( (const SCALAR *)vbeta );
const SCALAR one=1.0, zero=0.0;
#else
#define alpha valpha
const TYPE *beta=vbeta;
const TYPE one[2]={1.0,0.0}, zero[2]={0.0,0.0};
#endif
if (K > SYRK_Xover)
{
vc = malloc(ATL_Cachelen+ATL_MulBySize(N)*N);
ATL_assert(vc);
c = ATL_AlignPtr(vc);
CgemmTN(N, N, K, alpha, A, lda, A, lda, zero, c, N);
if ( SCALAR_IS_ONE(beta) ) Mjoin(syr_put,_b1)(N, c, beta, C, ldc);
else if ( SCALAR_IS_ZERO(beta) ) Mjoin(syr_put,_b0)(N, c, beta, C, ldc);
#ifdef TCPLX
else if ( SCALAR_IS_NONE(beta) )
Mjoin(syr_put,_bn1)(N, c, beta, C, ldc);
else if (beta[1] == *zero) Mjoin(syr_put,_bXi0)(N, c, beta, C, ldc);
#endif
else Mjoin(syr_put,_bX)(N, c, beta, C, ldc);
free(vc);
}
else Mjoin(PATL,refsyrk)(Uplo_, AtlasTrans, N, K, alpha, A, lda,
beta, C, ldc);
}
示例7: Mjoin
void Mjoin(Mjoin(PATL,symmR),UploNM)
(const int M, const int N, const void *valpha, const void *A, const int lda,
const void *B, const int ldb, const void *vbeta, void *C, const int ldc)
{
#ifdef TREAL
const SCALAR alpha=*( (const SCALAR *)valpha );
const SCALAR beta =*( (const SCALAR *)vbeta );
const SCALAR one=1.0;
#else
#define alpha valpha
#define beta vbeta
#endif
void *va;
TYPE *a;
if (M > SYMM_Xover)
{
va = malloc(ATL_Cachelen + ATL_MulBySize(N)*N);
ATL_assert(va);
a = ATL_AlignPtr(va);
#ifdef TREAL
if ( SCALAR_IS_ONE(alpha) )
Mjoin(Mjoin(Mjoin(PATL,sycopy),UploNM),_a1)(N, alpha, A, lda, a);
else Mjoin(Mjoin(Mjoin(PATL,sycopy),UploNM),_aX)(N, alpha, A, lda, a);
ATL_ammm(AtlasNoTrans, AtlasNoTrans, M, N, N, one, B, ldb, a, N, beta, C, ldc);
#else
Mjoin(Mjoin(PATL,sycopy),UploNM)(N, A, lda, a);
ATL_ammm(AtlasNoTrans, AtlasNoTrans, M, N, N, valpha, B, ldb, a, N, vbeta, C, ldc);
#endif
free(va);
}
else Mjoin(PATL,refsymm)(AtlasRight, Uplo_, M, N, alpha, A, lda, B, ldb,
beta, C, ldc);
}
示例8: Mjoin
void Mjoin(Mjoin(PATL,trmmL),ATLP)
(const int M, const int N, const void *valpha, const void *A, const int lda,
void *C, const int ldc)
{
#ifdef TREAL
const SCALAR alpha=*( (const SCALAR *)valpha );
const SCALAR one=1.0, zero=0.0;
#else
const TYPE zero[2]={0.0,0.0};
#define alpha valpha
#endif
void *va;
TYPE *a;
if (N > TRMM_Xover)
{
va = malloc(ATL_Cachelen + ATL_MulBySize(M)*M);
ATL_assert(va);
a = ATL_AlignPtr(va);
#ifdef TREAL
if ( SCALAR_IS_ONE(alpha) ) Mjoin(ATL_trcopy,_a1)(M, alpha, A, lda, a);
else Mjoin(ATL_trcopy,_aX)(M, alpha, A, lda, a);
CAgemmTN(M, N, M, one, a, M, C, ldc, zero, C, ldc);
#else
ATL_trcopy(M, A, lda, a);
CAgemmTN(M, N, M, valpha, a, M, C, ldc, zero, C, ldc);
#endif
free(va);
}
else Mjoin(PATL,reftrmm)(AtlasLeft, Uplo_, Trans_, Unit_, M, N, alpha,
A, lda, C, ldc);
}
示例9: cblas_zgerc
void cblas_zgerc(const enum CBLAS_ORDER Order, const int M, const int N,
const void *alpha, const void *X, const int incX,
const void *Y, const int incY, void *A, const int lda)
{
int info = 2000;
const double *x = X, *y = Y;
void *vy;
double *y0;
double one[2] = {ATL_rone, ATL_rzero};
#ifndef NoCblasErrorChecks
if (M < 0) info = cblas_errprn(2, info,
"M cannot be less than zero; is set to %d.", M);
if (N < 0) info = cblas_errprn(3, info,
"N cannot be less than zero; is set to %d.", N);
if (!incX) info = cblas_errprn(6, info,
"incX cannot be zero; is set to %d.", incX);
if (!incY) info = cblas_errprn(8, info,
"incY cannot be zero; is set to %d.", incY);
if (Order == CblasColMajor)
{
if (lda < M || lda < 1)
info = cblas_errprn(10, info, "lda must be >= MAX(M,1): lda=%d M=%d",
lda, M);
}
else if (Order == CblasRowMajor)
{
if (lda < N || lda < 1)
info = cblas_errprn(10, info, "lda must be >= MAX(N,1): lda=%d M=%d",
lda, N);
}
else
info = cblas_errprn(1, info, "Order must be %d or %d, but is set to %d",
CblasRowMajor, CblasColMajor, Order);
if (info != 2000)
{
cblas_xerbla(info, "cblas_zgerc", "");
return;
}
#endif
if (incX < 0) x += (1-M)*incX<<1;
if (incY < 0) y += (1-N)*incY<<1;
if (Order == CblasColMajor)
ATL_zgerc(M, N, alpha, x, incX, y, incY, A, lda);
else
{
vy = malloc(ATL_Cachelen + ATL_MulBySize(N));
ATL_assert(vy);
y0 = ATL_AlignPtr(vy);
ATL_zmoveConj(N, alpha, y, incY, y0, 1);
ATL_zgeru(N, M, one, y0, 1, x, incX, A, lda);
free(vy);
}
}
示例10: cblas_zher
void cblas_zher(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
const int N, const double alpha,
const void *X, const int incX, void *A, const int lda)
{
int info = 2000;
void *vx;
double one[2] = {ATL_rone, ATL_rzero};
double *x0;
const double *x=X;
#ifndef NoCblasErrorChecks
if (Order != CblasColMajor && Order != CblasRowMajor)
info = cblas_errprn(1, info, "Order must be %d or %d, but is set to %d",
CblasRowMajor, CblasColMajor, Order);
if (Uplo != CblasUpper && Uplo != CblasLower)
info = cblas_errprn(2, info, "UPLO must be %d or %d, but is set to %d",
CblasUpper, CblasLower, Uplo);
if (N < 0) info = cblas_errprn(3, info,
"N cannot be less than zero; is set to %d.", N);
if (!incX) info = cblas_errprn(6, info,
"incX cannot be zero; is set to %d.", incX);
if (lda < N || lda < 1)
info = cblas_errprn(8, info, "lda must be >= MAX(N,1): lda=%d N=%d",
lda, N);
if (info != 2000)
{
cblas_xerbla(info, "cblas_zher", "");
return;
}
#endif
if (incX < 0) x += (1-N)*incX<<1;
if (Order == CblasColMajor)
ATL_zher(Uplo, N, alpha, x, incX, A, lda);
else if (alpha != ATL_rzero)
{
vx = malloc(ATL_Cachelen + ATL_MulBySize(N));
ATL_assert(vx);
x0 = ATL_AlignPtr(vx);
ATL_zmoveConj(N, one, x, incX, x0, 1);
ATL_zher(( (Uplo == CblasUpper) ? CblasLower : CblasUpper ),
N, alpha, x0, 1, A, lda);
free(vx);
}
else
ATL_zher(( (Uplo == CblasUpper) ? CblasLower : CblasUpper ),
N, ATL_rzero, x, incX, A, lda);
}
示例11: ATL_flushcache
double ATL_flushcache(long long size)
/*
* flush cache by reading enough mem; note that if the compiler gets
* really smart, may be necessary to make vp a global variable so it
* can't figure out it's not being modified other than during setup;
* the fact that ATL_dzero is external will confuse most compilers
*/
{
static void *vp=NULL;
static long long N = 0;
double *cache;
double dret=0.0;
size_t i;
if (size < 0) /* flush cache */
{
ATL_assert(vp);
cache = ATL_AlignPtr(vp);
if (N > 0) for (i=0; i != N; i++) dret += cache[i];
}
else if (size > 0) /* initialize */
{
vp = malloc(ATL_Cachelen + size);
ATL_assert(vp);
N = size / sizeof(double);
cache = ATL_AlignPtr(vp);
ATL_dzero(N, cache, 1);
}
else if (size == 0) /* free cache */
{
if (vp) free(vp);
vp = NULL;
N = 0;
}
return(dret);
}
示例12: Mjoin
void Mjoin(Mjoin(PATL,hemmL),UploNM)
(const int M, const int N, const void *alpha, const void *A, const int lda,
const void *B, const int ldb, const void *beta, void *C, const int ldc)
{
TYPE *a;
void *va;
if (N > HEMM_Xover)
{
va = malloc(ATL_Cachelen + (ATL_MulBySize(M)*M));
ATL_assert(va);
a = ATL_AlignPtr(va);
Mjoin(Mjoin(PATL,hecopy),UploNM)(M, A, lda, a);
ATL_ammm(AtlasNoTrans, AtlasNoTrans, M, N, M, alpha, a, M, B, ldb,
beta, C, ldc);
free(va);
}
else Mjoin(PATL,refhemm)(AtlasLeft, Uplo_, M, N, alpha, A, lda, B, ldb,
beta, C, ldc);
}
示例13: ATL_ptflushcache
double ATL_ptflushcache(long long size)
/*
* flush cache by reading enough mem; note that if the compiler gets
* really smart, may be necessary to make vp a global variable so it
* can't figure out it's not being modified other than during setup;
* the fact that ATL_dzero is external will confuse most compilers
*/
{
static void *vp=NULL;
static double *cache=NULL;
double dret=0.0;
static long long i, N = 0;
ATL_FC fct[ATL_NTHREADS];
if (size < 0) /* flush cache */
{
ATL_assert(cache);
for (i=0; i < ATL_NTHREADS; i++)
{
fct[i].N = N;
fct[i].dp = cache+i*N;
}
ATL_goparallel(ATL_NTHREADS, ATL_DoWorkFC, fct, NULL);
}
else if (size > 0) /* initialize */
{
vp = malloc(ATL_Cachelen + (size * ATL_NTHREADS));
ATL_assert(vp);
cache = ATL_AlignPtr(vp);
N = size / sizeof(double);
ATL_dzero(N*ATL_NTHREADS, cache, 1);
}
else if (size == 0) /* free cache */
{
if (vp) free(vp);
vp = cache = NULL;
N = 0;
}
return(dret);
}
示例14: Mjoin
void Mjoin(Mjoin(PATL,trsmR),ATLP)
(const int M, const int N, const void *valpha, const void *A, const int lda,
void *C, const int ldc)
{
const TYPE *alpha=valpha;
#ifdef TREAL
#if defined(Transpose_) || defined(ConjTrans_)
if ( M > (N<<2) )
{
void *va;
TYPE *a;
va = malloc(ATL_Cachelen + (ATL_MulBySize(N*N)));
ATL_assert(va);
a = ATL_AlignPtr(va);
#ifdef TREAL
Mjoin(ATL_trcopy,_a1)(N, ATL_rone, A, lda, a);
#else
ATL_trcopy(N, A, lda, a);
#endif
Mjoin(Mjoin(PATL,trsmKR),ATLPt)(M, N, *alpha, a, N, C, ldc);
free(va);
}
else Mjoin(PATL,reftrsm)(AtlasRight, Uplo_, Trans_, Unit_, M, N, *alpha,
A, lda, C, ldc);
#else
Mjoin(Mjoin(PATL,trsmKR),ATLP)(M, N, *alpha, A, lda, C, ldc);
#endif
#else
if (M > (N<<2) && N <= 4)
Mjoin(PATL,CtrsmKR)(Uplo_, Trans_, Unit_, M, N, valpha, A, lda, C, ldc);
else
Mjoin(PATL,reftrsm)(AtlasRight, Uplo_, Trans_, Unit_, M, N, alpha,
A, lda, C, ldc);
#endif
}
示例15: Mjoin
int Mjoin(PC2F,ormrq)
(const enum CBLAS_SIDE Side, const enum CBLAS_TRANSPOSE TA,
ATL_CINT M, ATL_CINT N, ATL_CINT K, TYPE *A, ATL_CINT lda, TYPE *TAU,
TYPE *C, ATL_CINT ldc)
{
TYPE work[2];
void *vp;
TYPE *wrk;
ATL_INT lwrk;
int iret;
/*
* Query routine for optimal workspace, allocate it, and call routine with it
*/
ATL_assert(!Mjoin(PC2F,ormrq_wrk)(Side, TA, M, N, K, A, lda, TAU, C, ldc,
work, -1));
lwrk = work[0];
vp = malloc(ATL_MulBySize(lwrk) + ATL_Cachelen);
ATL_assert(vp);
wrk = ATL_AlignPtr(vp);
iret = Mjoin(PC2F,ormrq_wrk)(Side, TA, M, N, K, A, lda, TAU, C, ldc,
wrk, lwrk);
free(vp);
return(iret);
}