Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandr-Solovev committed Aug 23, 2024
1 parent fc4f2af commit 7ddd2d1
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions cpp/daal/src/externals/service_rng_mkl.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int uniformRNG(const size_t cn, size_t * r, void * stream, const size_t a, const
int nb = len / 2;
int nn = (int)n;
int * rr = (int *)r;
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, iRngUniform, (method, stream, nn, rr, na, nb), errcode);
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, iRngUniform, ((const MKL_INT)method, stream, (const MKL_INT)nn, rr, na, nb), errcode);

if (errcode != 0)
{
Expand All @@ -90,7 +90,7 @@ int uniformRNG(const size_t cn, size_t * r, void * stream, const size_t a, const
int nb = len / 2;
int nn = (int)n;
int * rr = (int *)r + n;
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, iRngUniform, (method, stream, nn, rr, na, nb), errcode);
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, iRngUniform, ((const MKL_INT)method, stream, (const MKL_INT)nn, rr, na, nb), errcode);

if (errcode != 0)
{
Expand All @@ -106,7 +106,7 @@ int uniformRNG(const size_t cn, size_t * r, void * stream, const size_t a, const
}
else
{
unsigned long long * cr = (unsigned long long *)r;
unsigned __int64 * cr = (unsigned __int64 *)r;

size_t len = b - a;
size_t rem = (size_t)(-1) % len;
Expand All @@ -118,9 +118,9 @@ int uniformRNG(const size_t cn, size_t * r, void * stream, const size_t a, const
{
dv = len;
for (int i = 0; i < 64; i++) dv /= 2.0;
int nn = (int)n;
unsigned long long * rr = cr;
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, iRngUniformBits64, (method, stream, nn, rr), errcode);
int nn = (int)n;
unsigned __int64 * rr = cr;
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, iRngUniformBits64, ((const MKL_INT)method, stream, (const MKL_INT)nn, (unsigned MKL_INT64 *)rr), errcode);

if (errcode != 0)
{
Expand All @@ -133,10 +133,10 @@ int uniformRNG(const size_t cn, size_t * r, void * stream, const size_t a, const
size_t pos = 0;
while (pos < cn)
{
n = cn - pos;
int nn = (int)n;
unsigned long long * rr = cr + pos;
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, iRngUniformBits64, (method, stream, nn, rr), errcode);
n = cn - pos;
int nn = (int)n;
unsigned __int64 * rr = cr + pos;
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, iRngUniformBits64, ((const MKL_INT)method, stream, (const MKL_INT)nn, (unsigned MKL_INT64 *)rr), errcode);

if (errcode != 0)
{
Expand Down Expand Up @@ -169,7 +169,7 @@ int uniformRNG(const size_t n, int * r, void * stream, const int a, const int b,
int errcode = 0;
int nn = (int)n;
int * rr = r;
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, iRngUniform, (method, stream, nn, rr, a, b), errcode);
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, iRngUniform, ((const MKL_INT)method, stream, (const MKL_INT)nn, rr, a, b), errcode);
return errcode;
}

Expand All @@ -179,7 +179,7 @@ int uniformRNG(const size_t n, float * r, void * stream, const float a, const fl
int errcode = 0;
int nn = (int)n;
float * rr = r;
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, sRngUniform, (method, stream, nn, rr, a, b), errcode);
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, sRngUniform, ((const MKL_INT)method, stream, (const MKL_INT)nn, rr, a, b), errcode);
return errcode;
}

Expand All @@ -189,7 +189,7 @@ int uniformRNG(const size_t n, double * r, void * stream, const double a, const
int errcode = 0;
int nn = (int)n;
double * rr = r;
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, dRngUniform, (method, stream, nn, rr, a, b), errcode);
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, dRngUniform, ((const MKL_INT)method, stream, (const MKL_INT)nn, rr, a, b), errcode);
return errcode;
}

Expand All @@ -199,7 +199,7 @@ int uniformBits32RNG(const size_t n, unsigned int * r, void * stream, const int
int errcode = 0;
int nn = (int)n;
unsigned int * rr = r;
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, iRngUniformBits32, (method, stream, nn, rr), errcode);
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, iRngUniformBits32, ((const MKL_INT)method, stream, (const MKL_INT)nn, rr), errcode);
return errcode;
}

Expand All @@ -213,7 +213,7 @@ int gaussianRNG(const size_t n, float * r, void * stream, const float a, const f
int errcode = 0;
int nn = (int)n;
float * rr = r;
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, sRngGaussian, (method, stream, nn, rr, a, sigma), errcode);
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, sRngGaussian, ((const MKL_INT)method, stream, (const MKL_INT)nn, rr, a, sigma), errcode);
return errcode;
}

Expand All @@ -223,7 +223,7 @@ int gaussianRNG(const size_t n, double * r, void * stream, const double a, const
int errcode = 0;
int nn = (int)n;
double * rr = r;
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, dRngGaussian, (method, stream, nn, rr, a, sigma), errcode);
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, dRngGaussian, ((const MKL_INT)method, stream, (const MKL_INT)nn, rr, a, sigma), errcode);
return errcode;
}

Expand All @@ -237,7 +237,7 @@ int bernoulliRNG(const size_t n, int * r, void * stream, const double p, const i
int errcode = 0;
int nn = (int)n;
int * rr = r;
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, iRngBernoulli, (method, stream, nn, rr, p), errcode);
__DAAL_VSLFN_CALL_NR_WHILE(fpk_vsl_kernel, iRngBernoulli, ((const MKL_INT)method, stream, (const MKL_INT)nn, rr, p), errcode);
return errcode;
}

Expand All @@ -252,7 +252,7 @@ class BaseRNG : public BaseRNGIface<cpu>
{
_seed[0] = seed;
int errcode = 0;
__DAAL_VSLFN_CALL_NR(fpk_vsl_sub_kernel, vslNewStreamEx, (&_stream, brngId, 1, &seed), errcode);
__DAAL_VSLFN_CALL_NR(fpk_vsl_sub_kernel, vslNewStreamEx, (&_stream, (const MKL_INT)brngId, (const MKL_INT)1, &seed), errcode);
}
}

Expand All @@ -270,7 +270,7 @@ class BaseRNG : public BaseRNGIface<cpu>
}
}
int errcode = 0;
__DAAL_VSLFN_CALL_NR(fpk_vsl_sub_kernel, vslNewStreamEx, (&_stream, brngId, n, seed), errcode);
__DAAL_VSLFN_CALL_NR(fpk_vsl_sub_kernel, vslNewStreamEx, (&_stream, (const MKL_INT)brngId, (const MKL_INT)n, seed), errcode);
}
}

Expand All @@ -284,7 +284,7 @@ class BaseRNG : public BaseRNGIface<cpu>
_seed[i] = other._seed[i];
}
int errcode = 0;
__DAAL_VSLFN_CALL_NR(fpk_vsl_sub_kernel, vslNewStreamEx, (&_stream, _brngId, _seedSize, _seed), errcode);
__DAAL_VSLFN_CALL_NR(fpk_vsl_sub_kernel, vslNewStreamEx, (&_stream, (const MKL_INT)_brngId, (const MKL_INT)_seedSize, _seed), errcode);
if (!errcode) __DAAL_VSLFN_CALL_NR(fpk_vsl_sub_kernel, vslCopyStreamState, (_stream, other._stream), errcode);
}
}
Expand Down Expand Up @@ -321,7 +321,7 @@ class BaseRNG : public BaseRNGIface<cpu>
int leapfrog(size_t threadNum, size_t nThreads)
{
int errcode = 0;
__DAAL_VSLFN_CALL_NR(fpk_vsl_sub_kernel, vslLeapfrogStream, (_stream, threadNum, nThreads), errcode);
__DAAL_VSLFN_CALL_NR(fpk_vsl_sub_kernel, vslLeapfrogStream, (_stream, (const MKL_INT)threadNum, (const MKL_INT)nThreads), errcode);
return errcode;
}

Expand Down

0 comments on commit 7ddd2d1

Please sign in to comment.