From cb2f7f63dd850e3991eac36a72668cb2b0fd79c3 Mon Sep 17 00:00:00 2001 From: "Martyanov, Ivan" Date: Mon, 23 Dec 2024 03:07:10 -0800 Subject: [PATCH] feedback --- include/oneapi/math/rng/device/detail/geometric_impl.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/oneapi/math/rng/device/detail/geometric_impl.hpp b/include/oneapi/math/rng/device/detail/geometric_impl.hpp index 755564bba..99749c65a 100644 --- a/include/oneapi/math/rng/device/detail/geometric_impl.hpp +++ b/include/oneapi/math/rng/device/detail/geometric_impl.hpp @@ -64,7 +64,7 @@ class distribution_base> { std::is_same_v, double, float>::type; - auto uni_res = engine.generate(FpType(0.0), FpType(1.0)); + FpType uni_res = engine.generate(FpType(0.0), FpType(1.0)); FpType inv_ln = ln_wrapper(FpType(1.0) - p_); inv_ln = FpType(1.0) / inv_ln; if constexpr (EngineType::vec_size == 1) { @@ -72,8 +72,9 @@ class distribution_base> { } else { sycl::vec vec_out; - for (int i = 0; i < EngineType::vec_size; i++) + for (int i = 0; i < EngineType::vec_size; i++) { vec_out[i] = static_cast(sycl::floor(ln_wrapper(uni_res[i]) * inv_ln)); + } return vec_out; } } @@ -84,8 +85,8 @@ class distribution_base> { std::is_same_v, double, float>::type; - auto uni_res = engine.generate_single(FpType(0.0), FpType(1.0)); - float inv_ln = ln_wrapper(FpType(1.0) - p_); + FpType uni_res = engine.generate_single(FpType(0.0), FpType(1.0)); + FpType inv_ln = ln_wrapper(FpType(1.0) - p_); inv_ln = FpType(1.0) / inv_ln; return static_cast(sycl::floor(ln_wrapper(uni_res) * inv_ln)); }