Fix ROCm 6.4 warnings (#47)

* Removed __AMDGCN_WAVEFRONT_SIZE

* Added unit test to validate WF_SIZE
此提交包含在:
Yiltan authored and GitHub committed 2025-02-24 13:34:13 -05:00
1 父節點 57d60aa727
當前提交 487e5b7d0f
8 file changed
+100 -41

No files matched your search

+3 -2
查看文件
@@ -26,6 +26,7 @@
#include <cassert>
#include "array.hpp"
#include "../constants.hpp"
namespace rocshmem {
@@ -148,8 +149,8 @@ __device__ void Array<TYPE>::zero_thread_dump() {
template <typename TYPE>
__device__ void Array<TYPE>::any_thread_dump() {
Identity id{};
for (int i = 0; i < __AMDGCN_WAVEFRONT_SIZE; i++) {
if ((id.local_thread_id() % __AMDGCN_WAVEFRONT_SIZE) == i) {
for (int i = 0; i < WF_SIZE; i++) {
if ((id.local_thread_id() % WF_SIZE) == i) {
while (atomicCAS(GLOBAL_DEVICE_PRINT_LOCK, 0, 1) == 1) {
}
+2 -6
查看文件
@@ -21,14 +21,10 @@
*****************************************************************************/
#include "share_strategy.hpp"
#include "../constants.hpp"
namespace rocshmem {
/*
* @brief The warp (wave-front) size.
*/
static constexpr uint64_t WARP_SIZE = __AMDGCN_WAVEFRONT_SIZE;
__device__ uint64_t Block::lane_id() {
/*
* amd_detail/device_functions.h::__lane_id()
@@ -202,7 +198,7 @@ __device__ uint64_t Block::active_logical_lane_id() {
}
__device__ uint64_t Block::broadcast_up(uint64_t fetch_value) {
for (unsigned i = 0; i < WARP_SIZE; i++) {
for (unsigned i = 0; i < WF_SIZE; i++) {
uint64_t temp = __shfl_up(fetch_value, i);
if (temp) {
fetch_value = temp;
+3 -3
查看文件
@@ -470,9 +470,9 @@ __device__ uint64_t active_logical_lane_id() {
}
__device__ uint64_t broadcast_lds(bool lowest_active, uint64_t value) {
constexpr size_t SIZE = 1024 / __AMDGCN_WAVEFRONT_SIZE;
constexpr size_t SIZE = 1024 / WF_SIZE;
__shared__ uint64_t value_per_warp[SIZE];
auto wavefront_number {get_flat_block_id() / __AMDGCN_WAVEFRONT_SIZE};
auto wavefront_number {get_flat_block_id() / WF_SIZE};
if (lowest_active) {
value_per_warp[wavefront_number] = value;
__threadfence_block();
@@ -481,7 +481,7 @@ __device__ uint64_t broadcast_lds(bool lowest_active, uint64_t value) {
}
__device__ uint64_t broadcast_shfl_up(uint64_t value) {
for (unsigned i{0}; i < __AMDGCN_WAVEFRONT_SIZE; i++) {
for (unsigned i{0}; i < WF_SIZE; i++) {
uint64_t temp{__shfl_up(value, i)};
if (temp) {
value = temp;