Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandr-Solovev committed Jan 21, 2025
1 parent 5c57b6d commit e3f45d3
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 18 deletions.
7 changes: 5 additions & 2 deletions cpp/daal/src/algorithms/engines/mcg59/mcg59_batch_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#include "src/externals/service_rng.h"
#include "src/data_management/service_numeric_table.h"

static const int leapfrogMethodErrcode = -1002;
static const int skipAheadMethodErrcode = -1003;

namespace daal
{
namespace algorithms
Expand Down Expand Up @@ -64,7 +67,7 @@ class BatchImpl : public algorithms::engines::mcg59::interface1::Batch<algorithm
{
int errcode = baseRng.leapfrog(threadNum, nThreads);
services::Status s;
if (errcode == __DAAL_RNG_ERROR_LEAPFROG_UNSUPPORTED)
if (errcode == leapfrogMethodErrcode)
s.add(ErrorLeapfrogUnsupported);
else if (errcode)
s.add(ErrorIncorrectErrorcodeFromGenerator);
Expand All @@ -75,7 +78,7 @@ class BatchImpl : public algorithms::engines::mcg59::interface1::Batch<algorithm
{
int errcode = baseRng.skipAhead(nSkip);
services::Status s;
if (errcode == __DAAL_RNG_ERROR_SKIPAHEAD_UNSUPPORTED)
if (errcode == skipAheadMethodErrcode)
s.add(ErrorSkipAheadUnsupported);
else if (errcode)
s.add(ErrorIncorrectErrorcodeFromGenerator);
Expand Down
7 changes: 5 additions & 2 deletions cpp/daal/src/algorithms/engines/mt19937/mt19937_batch_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#include "src/externals/service_rng.h"
#include "src/data_management/service_numeric_table.h"

static const int leapfrogMethodErrcode = -1002;
static const int skipAheadMethodErrcode = -1003;

namespace daal
{
namespace algorithms
Expand Down Expand Up @@ -64,7 +67,7 @@ class BatchImpl : public algorithms::engines::mt19937::interface1::Batch<algorit
{
int errcode = baseRng.leapfrog(threadNum, nThreads);
services::Status s;
if (errcode == __DAAL_RNG_ERROR_LEAPFROG_UNSUPPORTED)
if (errcode == leapfrogMethodErrcode)
s.add(ErrorLeapfrogUnsupported);
else if (errcode)
s.add(ErrorIncorrectErrorcodeFromGenerator);
Expand All @@ -75,7 +78,7 @@ class BatchImpl : public algorithms::engines::mt19937::interface1::Batch<algorit
{
int errcode = baseRng.skipAhead(nSkip);
services::Status s;
if (errcode == __DAAL_RNG_ERROR_SKIPAHEAD_UNSUPPORTED)
if (errcode == skipAheadMethodErrcode)
s.add(ErrorSkipAheadUnsupported);
else if (errcode)
s.add(ErrorIncorrectErrorcodeFromGenerator);
Expand Down
7 changes: 5 additions & 2 deletions cpp/daal/src/algorithms/engines/mt2203/mt2203_batch_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
#include "src/data_management/service_numeric_table.h"
#include "services/collection.h"

static const int leapfrogMethodErrcode = -1002;
static const int skipAheadMethodErrcode = -1003;

namespace daal
{
namespace algorithms
Expand Down Expand Up @@ -185,7 +188,7 @@ class BatchImpl : public algorithms::engines::mt2203::interface1::Batch<algorith
{
int errcode = _streams[i]->leapfrog(threadNum, nThreads);
services::Status s;
if (errcode == __DAAL_RNG_ERROR_LEAPFROG_UNSUPPORTED)
if (errcode == leapfrogMethodErrcode)
s.add(ErrorLeapfrogUnsupported);
else if (errcode)
s.add(ErrorIncorrectErrorcodeFromGenerator);
Expand All @@ -196,7 +199,7 @@ class BatchImpl : public algorithms::engines::mt2203::interface1::Batch<algorith
{
int errcode = _streams[i]->skipAhead(nSkip);
services::Status s;
if (errcode == __DAAL_RNG_ERROR_SKIPAHEAD_UNSUPPORTED)
if (errcode == skipAheadMethodErrcode)
s.add(ErrorSkipAheadUnsupported);
else if (errcode)
s.add(ErrorIncorrectErrorcodeFromGenerator);
Expand Down
4 changes: 0 additions & 4 deletions cpp/daal/src/externals/service_rng_mkl.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
#define __DAAL_RNG_METHOD_GAUSSIAN_BOXMULLER2 VSL_RNG_METHOD_GAUSSIAN_BOXMULLER2
#define __DAAL_RNG_METHOD_GAUSSIAN_ICDF VSL_RNG_METHOD_GAUSSIAN_ICDF

// Errors
#define __DAAL_RNG_ERROR_LEAPFROG_UNSUPPORTED -1002
#define __DAAL_RNG_ERROR_SKIPAHEAD_UNSUPPORTED -1003

namespace daal
{
namespace internal
Expand Down
4 changes: 0 additions & 4 deletions cpp/daal/src/externals/service_rng_openrng.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
#define __DAAL_RNG_METHOD_GAUSSIAN_BOXMULLER2 VSL_RNG_METHOD_GAUSSIAN_BOXMULLER2
#define __DAAL_RNG_METHOD_GAUSSIAN_ICDF VSL_RNG_METHOD_GAUSSIAN_ICDF

// Errors
#define __DAAL_RNG_ERROR_LEAPFROG_UNSUPPORTED -1002
#define __DAAL_RNG_ERROR_SKIPAHEAD_UNSUPPORTED -1003

namespace daal
{
namespace internal
Expand Down
4 changes: 0 additions & 4 deletions cpp/daal/src/externals/service_rng_ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@
#define __DAAL_RNG_METHOD_GAUSSIAN_BOXMULLER2 1 //VSL_RNG_METHOD_GAUSSIAN_BOXMULLER2
#define __DAAL_RNG_METHOD_GAUSSIAN_ICDF 2 //VSL_RNG_METHOD_GAUSSIAN_ICDF

// Errors
#define __DAAL_RNG_ERROR_LEAPFROG_UNSUPPORTED -1002
#define __DAAL_RNG_ERROR_SKIPAHEAD_UNSUPPORTED -1003

namespace daal
{
namespace internal
Expand Down

0 comments on commit e3f45d3

Please sign in to comment.