Skip to content

Commit 6143c6c

Browse files
committed
removing unnecessary comments
1 parent cca829a commit 6143c6c

File tree

3 files changed

+1
-24
lines changed

3 files changed

+1
-24
lines changed

include/umpire/op/dispatch.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ struct op_caller {
210210
check_memset_bounds(src, src_record, length);
211211
#endif
212212
} else if constexpr (std::is_same_v<Op<resource::host_platform>, device_memset<resource::host_platform>>) {
213-
// For device_memset, we expect args to be {value, size}
214213
#ifdef UMPIRE_ENABLE_BOUNDS_CHECKS
215214
std::size_t length = get_arg<1>(args...);
216215
check_memset_bounds(src, src_record, length);
@@ -238,7 +237,6 @@ struct op_caller {
238237
check_memset_bounds(src, src_record, length);
239238
#endif
240239
} else if constexpr (std::is_same_v<Op<resource::host_platform>, device_memset<resource::host_platform>>) {
241-
// For device_memset, we expect args to be {value, size}
242240
#ifdef UMPIRE_ENABLE_BOUNDS_CHECKS
243241
std::size_t length = get_arg<1>(args...);
244242
check_memset_bounds(src, src_record, length);

include/umpire/op/hip.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ namespace detail {
1616
* \param data Pointer to the array
1717
* \param value The value to set each element to
1818
* \param count The number of elements to set
19-
*
20-
* Example: If data is an int array with 10 elements and value is 5,
21-
* this will set all 10 ints to the value 5.
2219
*/
2320
template <typename T>
2421
__global__ void umpire_device_memset_kernel(T* data, T value, std::size_t count)
@@ -31,12 +28,6 @@ __global__ void umpire_device_memset_kernel(T* data, T value, std::size_t count)
3128
}
3229
}
3330

34-
/**
35-
* @brief Implementation of device_memset - compiled as HIP code
36-
*
37-
* This implementation is in the .cpp file (not header) because it uses
38-
* hipLaunchKernelGGL, which requires HIP compiler support.
39-
*/
4031
template <typename T>
4132
void device_memset(T* ptr, T value, std::size_t count)
4233
{
@@ -52,7 +43,6 @@ void device_memset(T* ptr, T value, std::size_t count)
5243
grid_size = max_blocks;
5344
}
5445

55-
// Launch kernel to set elements (not bytes)
5646
hipLaunchKernelGGL(umpire_device_memset_kernel<T>, dim3(grid_size), dim3(block_size), 0, 0,
5747
ptr, value, count);
5848

@@ -71,7 +61,6 @@ void device_memset(T* ptr, T value, std::size_t count)
7161
}
7262

7363
// Explicit template instantiations for common types
74-
// Add more instantiations here as needed for your use cases
7564
template __global__ void umpire_device_memset_kernel<char>(char*, char, std::size_t);
7665
template __global__ void umpire_device_memset_kernel<unsigned char>(unsigned char*, unsigned char, std::size_t);
7766
template __global__ void umpire_device_memset_kernel<short>(short*, short, std::size_t);

include/umpire/op/hip.hpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace umpire {
1313
namespace op {
1414

15-
// Forward declaration of device kernel (defined in hip.cpp with explicit instantiations)
1615
namespace detail {
1716
template <typename T>
1817
__global__ void umpire_device_memset_kernel(T* data, T value, std::size_t count);
@@ -189,12 +188,8 @@ inline void memset(T* ptr, int value, std::size_t count)
189188
*
190189
* @tparam T Type of array elements
191190
* @param ptr Pointer to array
192-
* @param value Value to set each element to (will be cast to type T)
191+
* @param value Value to set each element to
193192
* @param count Number of elements to set
194-
*
195-
* @note Example: device_memset(int_array, 5, 10) sets 10 ints to value 5
196-
* @note The kernel must be explicitly instantiated in hip.cpp for type T
197-
* @note Implementation is in hip.cpp (compiled as HIP code)
198193
*/
199194
template <typename T>
200195
void device_memset(T* ptr, T value, std::size_t count);
@@ -455,15 +450,10 @@ struct device_memset<resource::hip_platform> {
455450
/**
456451
* @brief HIP synchronous device memset using kernel
457452
*
458-
* Sets each element of the array to the specified value using a HIP device kernel.
459-
* Unlike standard memset which sets bytes, this sets typed elements.
460-
*
461453
* @tparam T Type of array elements
462454
* @param ptr Pointer to array
463455
* @param val Value to set each element to
464456
* @param len Number of elements to set
465-
*
466-
* @note Example: exec(int_array, 5, 10) sets 10 ints to value 5
467457
*/
468458
template <typename T>
469459
static void exec(T* ptr, T val, std::size_t len) noexcept

0 commit comments

Comments
 (0)