2828namespace Oro
2929{
3030
31- // / @brief A helper function that casts an address of a pointer to the device memory to a void pointer to be used as an argument for kernel calls.
31+ // / @brief A helper function that casts an address of a pointer to the device memory to a void pointer to be used as an argument for kernel calls.
3232// / @tparam T The type of the element stored in the device memory.
3333// / @param ptr The address of a pointer to the device memory.
3434// / @return A void pointer.
@@ -44,8 +44,8 @@ class GpuMemory final
4444 public:
4545 GpuMemory () = default ;
4646
47- // / @brief Allocate the device memory with the given size .
48- // / @param init_size The initial size which represents the number of elements.
47+ // / @brief Allocate the elements on the device memory .
48+ // / @param init_size The initial container size which represents the number of elements.
4949 explicit GpuMemory ( const size_t init_size )
5050 {
5151 OrochiUtils::malloc ( m_data, init_size );
@@ -61,9 +61,9 @@ class GpuMemory final
6161
6262 GpuMemory& operator =( GpuMemory&& other ) noexcept
6363 {
64- GpuMemory tmp ( std::move ( * this ) );
64+ GpuMemory tmp ( std::move ( other ) );
6565
66- swap ( *this , other );
66+ swap ( *this , tmp );
6767
6868 return *this ;
6969 }
@@ -79,8 +79,8 @@ class GpuMemory final
7979 m_capacity = 0ULL ;
8080 }
8181
82- // / @brief Get the size of the device memory .
83- // / @return The size of the device memory .
82+ // / @brief Get the container size which represents the number of elements .
83+ // / @return The container size which represents the number of elements .
8484 size_t size () const noexcept { return m_size; }
8585
8686 // / @brief Get the pointer to the device memory.
@@ -91,9 +91,9 @@ class GpuMemory final
9191 // / @return The address of the pointer to the device memory.
9292 T* const * address () const noexcept { return &m_data; }
9393
94- // / @brief Resize the device memory . Its capacity is unchanged if the new size is smaller than the current one.
94+ // / @brief Resize the container . Its capacity is unchanged if the new size is smaller than the current one.
9595 // / The old data should be considered invalid to be used after the function is called unless @c copy is set to True.
96- // / @param new_size The new memory size after the function is called.
96+ // / @param new_size The new container size which represents the number of elements after the function is called.
9797 // / @param copy If true, the function will copy the data to the newly created memory space as well.
9898 void resize ( const size_t new_size, const bool copy = false ) noexcept
9999 {
@@ -113,8 +113,8 @@ class GpuMemory final
113113 *this = std::move ( tmp );
114114 }
115115
116- // / @brief Asynchronous version of ' resize' using a given Orochi stream.
117- // / @param new_size The new memory size after the function is called.
116+ // / @brief Asynchronous version of @c resize using a given Orochi stream.
117+ // / @param new_size The new container size which represents the number of elements after the function is called.
118118 // / @param copy If true, the function will copy the data to the newly created memory space as well.
119119 // / @param stream The Orochi stream used for the underlying operations.
120120 void resizeAsync ( const size_t new_size, const bool copy = false , oroStream stream = 0 ) noexcept
@@ -138,7 +138,7 @@ class GpuMemory final
138138 // / @brief Reset the memory space so that all bits inside are cleared to zero.
139139 void reset () noexcept { OrochiUtils::memset ( m_data, 0 , m_size * sizeof ( T ) ); }
140140
141- // / @brief Asynchronous version of ' reset' using a given Orochi stream.
141+ // / @brief Asynchronous version of @c reset using a given Orochi stream.
142142 // / @param stream The Orochi stream used for the underlying operations.
143143 void resetAsync ( oroStream stream = 0 ) noexcept { OrochiUtils::memsetAsync ( m_data, 0 , m_size * sizeof ( T ), stream ); }
144144
0 commit comments