Use new naming scheme

[ROCm/rocshmem commit: fd8dbc7fb6]
このコミットが含まれているのは:
Brandon Potter
2024-11-25 14:12:15 -06:00
コミット 913ce47ef1
179個のファイルの変更5250行の追加5251行の削除
+25 -25
ファイルの表示
@@ -24,17 +24,17 @@ using namespace rocshmem;
/* Declare the template with a generic implementation */
template <typename T>
__device__ void wg_alltoall(roc_shmem_ctx_t ctx, roc_shmem_team_t team, T *dest,
__device__ void wg_alltoall(rocshmem_ctx_t ctx, rocshmem_team_t team, T *dest,
const T *source, int nelem) {
return;
}
/* Define templates to call ROC_SHMEM */
/* Define templates to call rocSHMEM */
#define ALLTOALL_DEF_GEN(T, TNAME) \
template <> \
__device__ void wg_alltoall<T>(roc_shmem_ctx_t ctx, roc_shmem_team_t team, \
__device__ void wg_alltoall<T>(rocshmem_ctx_t ctx, rocshmem_team_t team, \
T * dest, const T *source, int nelem) { \
roc_shmem_ctx_##TNAME##_wg_alltoall(ctx, team, dest, source, nelem); \
rocshmem_ctx_##TNAME##_wg_alltoall(ctx, team, dest, source, nelem); \
}
ALLTOALL_DEF_GEN(float, float)
@@ -52,7 +52,7 @@ ALLTOALL_DEF_GEN(unsigned int, uint)
ALLTOALL_DEF_GEN(unsigned long, ulong)
ALLTOALL_DEF_GEN(unsigned long long, ulonglong)
roc_shmem_team_t team_alltoall_world_dup;
rocshmem_team_t team_alltoall_world_dup;
/******************************************************************************
* DEVICE TEST KERNEL
@@ -60,20 +60,20 @@ roc_shmem_team_t team_alltoall_world_dup;
template <typename T1>
__global__ void AlltoallTest(int loop, int skip, uint64_t *timer,
T1 *source_buf, T1 *dest_buf, int size,
ShmemContextType ctx_type, roc_shmem_team_t team) {
__shared__ roc_shmem_ctx_t ctx;
ShmemContextType ctx_type, rocshmem_team_t team) {
__shared__ rocshmem_ctx_t ctx;
roc_shmem_wg_init();
roc_shmem_wg_ctx_create(ctx_type, &ctx);
rocshmem_wg_init();
rocshmem_wg_ctx_create(ctx_type, &ctx);
int n_pes = roc_shmem_ctx_n_pes(ctx);
int n_pes = rocshmem_ctx_n_pes(ctx);
__syncthreads();
uint64_t start;
for (int i = 0; i < loop + skip; i++) {
if (i == skip && hipThreadIdx_x == 0) {
start = roc_shmem_timer();
start = rocshmem_timer();
}
wg_alltoall<T1>(ctx, team,
dest_buf, // T* dest
@@ -84,11 +84,11 @@ __global__ void AlltoallTest(int loop, int skip, uint64_t *timer,
__syncthreads();
if (hipThreadIdx_x == 0) {
timer[hipBlockIdx_x] = roc_shmem_timer() - start;
timer[hipBlockIdx_x] = rocshmem_timer() - start;
}
roc_shmem_wg_ctx_destroy(&ctx);
roc_shmem_wg_finalize();
rocshmem_wg_ctx_destroy(&ctx);
rocshmem_wg_finalize();
}
/******************************************************************************
@@ -99,24 +99,24 @@ AlltoallTester<T1>::AlltoallTester(
TesterArguments args, std::function<void(T1 &, T1 &, T1)> f1,
std::function<std::pair<bool, std::string>(const T1 &, T1)> f2)
: Tester(args), init_buf{f1}, verify_buf{f2} {
int n_pes = roc_shmem_team_n_pes(ROC_SHMEM_TEAM_WORLD);
source_buf = (T1 *)roc_shmem_malloc(args.max_msg_size * sizeof(T1) * n_pes);
dest_buf = (T1 *)roc_shmem_malloc(args.max_msg_size * sizeof(T1) * n_pes);
int n_pes = rocshmem_team_n_pes(ROCSHMEM_TEAM_WORLD);
source_buf = (T1 *)rocshmem_malloc(args.max_msg_size * sizeof(T1) * n_pes);
dest_buf = (T1 *)rocshmem_malloc(args.max_msg_size * sizeof(T1) * n_pes);
}
template <typename T1>
AlltoallTester<T1>::~AlltoallTester() {
roc_shmem_free(source_buf);
roc_shmem_free(dest_buf);
rocshmem_free(source_buf);
rocshmem_free(dest_buf);
}
template <typename T1>
void AlltoallTester<T1>::preLaunchKernel() {
int n_pes = roc_shmem_team_n_pes(ROC_SHMEM_TEAM_WORLD);
int n_pes = rocshmem_team_n_pes(ROCSHMEM_TEAM_WORLD);
bw_factor = sizeof(T1) * n_pes;
team_alltoall_world_dup = ROC_SHMEM_TEAM_INVALID;
roc_shmem_team_split_strided(ROC_SHMEM_TEAM_WORLD, 0, 1, n_pes, nullptr, 0,
team_alltoall_world_dup = ROCSHMEM_TEAM_INVALID;
rocshmem_team_split_strided(ROCSHMEM_TEAM_WORLD, 0, 1, n_pes, nullptr, 0,
&team_alltoall_world_dup);
}
@@ -135,12 +135,12 @@ void AlltoallTester<T1>::launchKernel(dim3 gridSize, dim3 blockSize, int loop,
template <typename T1>
void AlltoallTester<T1>::postLaunchKernel() {
roc_shmem_team_destroy(team_alltoall_world_dup);
rocshmem_team_destroy(team_alltoall_world_dup);
}
template <typename T1>
void AlltoallTester<T1>::resetBuffers(uint64_t size) {
int n_pes = roc_shmem_team_n_pes(ROC_SHMEM_TEAM_WORLD);
int n_pes = rocshmem_team_n_pes(ROCSHMEM_TEAM_WORLD);
for (int i = 0; i < n_pes; i++) {
for (int j = 0; j < size; j++) {
init_buf(source_buf[i * size + j], dest_buf[i * size + j], (T1)i);
@@ -150,7 +150,7 @@ void AlltoallTester<T1>::resetBuffers(uint64_t size) {
template <typename T1>
void AlltoallTester<T1>::verifyResults(uint64_t size) {
int n_pes = roc_shmem_team_n_pes(ROC_SHMEM_TEAM_WORLD);
int n_pes = rocshmem_team_n_pes(ROCSHMEM_TEAM_WORLD);
for (int i = 0; i < n_pes; i++) {
for (int j = 0; j < size; j++) {
auto r = verify_buf(dest_buf[i * size + j], i);