Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
rusty1s committed Nov 11, 2024
1 parent c63e087 commit f69ee53
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions pyg_lib/csrc/random/cpu/rand_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,20 @@ class RandintEngine {
for (auto& val : dst)
val = static_cast<int>((*this)(beg, end));
};
#if WITH_MKL_BLAS()
const bool use_fallback_func = count > std::numeric_limits<MKL_INT>::max();
if (use_fallback_func) {
fallback_func(beg, end, result);
} else {
const auto b = static_cast<int>(beg);
const auto e = static_cast<int>(end);
const auto c = static_cast<MKL_INT>(count);
viRngUniform(VSL_RNG_METHOD_UNIFORM_STD, stream_, c, result.data(), b, e);
}
#else
// #if WITH_MKL_BLAS()
// const bool use_fallback_func = count >
// std::numeric_limits<MKL_INT>::max(); if (use_fallback_func) {
// fallback_func(beg, end, result);
// } else {
// const auto b = static_cast<int>(beg);
// const auto e = static_cast<int>(end);
// const auto c = static_cast<MKL_INT>(count);
// viRngUniform(VSL_RNG_METHOD_UNIFORM_STD, stream_, c, result.data(),
// b, e);
// }
// #else
fallback_func(beg, end, result);
#endif
// #endif
return result;
}

Expand Down

0 comments on commit f69ee53

Please sign in to comment.