From 9fd5353976d535b8026523178ef9cb0aed1a8eee Mon Sep 17 00:00:00 2001 From: Fuad Hasibul Hasan Date: Fri, 13 Dec 2024 19:26:04 +0000 Subject: [PATCH] docstring for HostWrite ctor --- src/Omega_h_array.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Omega_h_array.hpp b/src/Omega_h_array.hpp index e688a41af..a5d1e7a23 100644 --- a/src/Omega_h_array.hpp +++ b/src/Omega_h_array.hpp @@ -162,7 +162,21 @@ class HostWrite { using value_type = T; HostWrite() = default; HostWrite(LO size_in, std::string const& name = ""); + + /** + * \brief Constructs a HostWrite object with specified size, offset, and stride. + * + * \param size_in The number of entries in the array. + * \param offset The initial value to set for the first entry of the array. + * \param stride The difference between the values of consecutive entries in the array. + * \param name The name of the array for identification purposes (default is an empty string). + * + * This constructor initializes a HostWrite array with the given size, setting the first entry to the specified offset, + * and each subsequent entry to the previous entry's value plus the stride. The array is given a name for identification. + * For example, `HostWrite h_write(10, 7.0, 0.0);` will create a write array of size 10 and all filled with 7.0. + */ HostWrite(LO size_in, T offset, T stride, std::string const& name = ""); + HostWrite(Write write_in); HostWrite(std::initializer_list l, std::string const& name = ""); Write write() const;