Skip to content

Commit

Permalink
clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
iMartyan committed Dec 13, 2024
1 parent 74191fe commit 80d9785
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions include/oneapi/math/rng/device/detail/geometric_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ class distribution_base<oneapi::math::rng::device::geometric<IntType, Method>> {
auto generate(EngineType& engine) ->
typename std::conditional<EngineType::vec_size == 1, IntType,
sycl::vec<IntType, EngineType::vec_size>>::type {
using FpType =
typename std::conditional<std::is_same_v<IntType, std::uint64_t> ||
std::is_same_v<IntType, std::int64_t>,
double, float>::type;
using FpType = typename std::conditional<std::is_same_v<IntType, std::uint64_t> ||
std::is_same_v<IntType, std::int64_t>,
double, float>::type;

auto uni_res = engine.generate(FpType(0.0), FpType(1.0));
FpType inv_ln = ln_wrapper(FpType(1.0) - p_);
Expand All @@ -81,6 +80,10 @@ class distribution_base<oneapi::math::rng::device::geometric<IntType, Method>> {

template <typename EngineType>
IntType generate_single(EngineType& engine) {
using FpType = typename std::conditional<std::is_same_v<IntType, std::uint64_t> ||
std::is_same_v<IntType, std::int64_t>,
double, float>::type;

auto uni_res = engine.generate_single(FpType(0.0), FpType(1.0));
float inv_ln = ln_wrapper(FpType(1.0) - p_);
inv_ln = FpType(1.0) / inv_ln;
Expand Down
2 changes: 1 addition & 1 deletion include/oneapi/math/rng/device/distributions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ class geometric : detail::distribution_base<geometric<IntType, Method>> {

static_assert(std::is_same<IntType, std::int32_t>::value ||
std::is_same<IntType, std::uint32_t>::value ||
std::is_same<IntType, std::int64_t>::value ||
std::is_same<IntType, std::int64_t>::value ||
std::is_same<IntType, std::uint64_t>::value,
"oneMath: rng/geometric: type is not supported");

Expand Down

0 comments on commit 80d9785

Please sign in to comment.