From 397ce134bf9647317ce669fb8ef1b0357eb6e6f8 Mon Sep 17 00:00:00 2001 From: Borys Petrov Date: Tue, 12 May 2026 09:51:21 +0200 Subject: [PATCH 1/2] chore(rocRAND): removal of host device attributes from a deduction guide --- projects/rocrand/library/src/rng/threefry.hpp | 2 +- projects/rocrand/library/src/rng/utils/cpp_utils.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/rocrand/library/src/rng/threefry.hpp b/projects/rocrand/library/src/rng/threefry.hpp index c77956519bf8..d1bef8615cf3 100644 --- a/projects/rocrand/library/src/rng/threefry.hpp +++ b/projects/rocrand/library/src/rng/threefry.hpp @@ -165,7 +165,7 @@ struct generate_threefry while(index < vec_n) { const auto v = engine.next_leap(stride); - cpp_utils::vec_wrapper vs(v); + cpp_utils::vec_wrapper> vs(v); for(unsigned int s = 0; s < output_per_thread; s++) { for(unsigned int i = 0; i < input_width; i++) diff --git a/projects/rocrand/library/src/rng/utils/cpp_utils.hpp b/projects/rocrand/library/src/rng/utils/cpp_utils.hpp index 902f271e99fb..20d2b0b3d977 100644 --- a/projects/rocrand/library/src/rng/utils/cpp_utils.hpp +++ b/projects/rocrand/library/src/rng/utils/cpp_utils.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2023-2026 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -246,7 +246,7 @@ struct vec_wrapper }; template -__host__ __device__ vec_wrapper(V) -> vec_wrapper; +vec_wrapper(V) -> vec_wrapper; /// \brief Returns the maximum of its arguments. /// \note This function must be the choice in `__host__ __device__` and preferably on From fd371578e8f016dd5248d6ae36584883b4ac2ec9 Mon Sep 17 00:00:00 2001 From: Wayne Franz Date: Fri, 17 Jul 2026 12:11:02 -0400 Subject: [PATCH 2/2] Formatting changes for CI checks --- projects/rocrand/library/src/rng/threefry.hpp | 2 +- .../library/src/rng/utils/cpp_utils.hpp | 23 +++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/projects/rocrand/library/src/rng/threefry.hpp b/projects/rocrand/library/src/rng/threefry.hpp index d1bef8615cf3..59ab99bb11c1 100644 --- a/projects/rocrand/library/src/rng/threefry.hpp +++ b/projects/rocrand/library/src/rng/threefry.hpp @@ -164,7 +164,7 @@ struct generate_threefry size_t index = thread_id; while(index < vec_n) { - const auto v = engine.next_leap(stride); + const auto v = engine.next_leap(stride); cpp_utils::vec_wrapper> vs(v); for(unsigned int s = 0; s < output_per_thread; s++) { diff --git a/projects/rocrand/library/src/rng/utils/cpp_utils.hpp b/projects/rocrand/library/src/rng/utils/cpp_utils.hpp index 20d2b0b3d977..ced75889b97f 100644 --- a/projects/rocrand/library/src/rng/utils/cpp_utils.hpp +++ b/projects/rocrand/library/src/rng/utils/cpp_utils.hpp @@ -107,7 +107,8 @@ constexpr auto numeric_combinations(const std::array... inputs) } /// \brief Calculates greatest common divisor. -__host__ __device__ constexpr unsigned int gcd(const unsigned int a, const unsigned int b) +__host__ __device__ +constexpr unsigned int gcd(const unsigned int a, const unsigned int b) { if(a == 0) return b; @@ -117,7 +118,8 @@ __host__ __device__ constexpr unsigned int gcd(const unsigned int a, const unsig } /// \brief Calculates least common multiple -__host__ __device__ constexpr unsigned int lcm(const unsigned int a, const unsigned int b) +__host__ __device__ +constexpr unsigned int lcm(const unsigned int a, const unsigned int b) { if(a == 0 || b == 0) return 0; @@ -192,10 +194,14 @@ struct vec_wrapper { static_assert(is_vector_type_v, "vec_wrapper can only be used with vector types"); - __host__ __device__ explicit vec_wrapper(V vec) : m_vec(vec) {} + __host__ __device__ + explicit vec_wrapper(V vec) + : m_vec(vec) + {} template == 2, int> = 0> - __host__ __device__ auto& operator[](int idx) + __host__ __device__ + auto& operator[](int idx) { switch(idx) { @@ -206,7 +212,8 @@ struct vec_wrapper } template == 2, int> = 0> - __host__ __device__ const auto& operator[](int idx) const + __host__ __device__ + const auto& operator[](int idx) const { switch(idx) { @@ -217,7 +224,8 @@ struct vec_wrapper } template == 4, int> = 0> - __host__ __device__ auto& operator[](int idx) + __host__ __device__ + auto& operator[](int idx) { switch(idx) { @@ -230,7 +238,8 @@ struct vec_wrapper } template == 4, int> = 0> - __host__ __device__ const auto& operator[](int idx) const + __host__ __device__ + const auto& operator[](int idx) const { switch(idx) {