Use new naming scheme
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
#include <memory>
|
||||
#include <thread> // NOLINT
|
||||
|
||||
#include "roc_shmem/roc_shmem.hpp"
|
||||
#include "rocshmem/rocshmem.hpp"
|
||||
#include "../atomic_return.hpp"
|
||||
#include "../backend_type.hpp"
|
||||
#include "../context_incl.hpp"
|
||||
@@ -42,13 +42,13 @@
|
||||
|
||||
namespace rocshmem {
|
||||
|
||||
extern roc_shmem_ctx_t ROC_SHMEM_HOST_CTX_DEFAULT;
|
||||
extern rocshmem_ctx_t ROCSHMEM_HOST_CTX_DEFAULT;
|
||||
|
||||
ROBackend::ROBackend(MPI_Comm comm)
|
||||
: profiler_proxy_(MAX_NUM_BLOCKS), Backend() {
|
||||
type = BackendType::RO_BACKEND;
|
||||
|
||||
if (auto maximum_num_contexts_str = getenv("ROC_SHMEM_MAX_NUM_CONTEXTS")) {
|
||||
if (auto maximum_num_contexts_str = getenv("ROCSHMEM_MAX_NUM_CONTEXTS")) {
|
||||
std::stringstream sstream(maximum_num_contexts_str);
|
||||
sstream >> maximum_num_contexts_;
|
||||
}
|
||||
@@ -83,14 +83,14 @@ ROBackend::ROBackend(MPI_Comm comm)
|
||||
|
||||
default_host_ctx = std::make_unique<ROHostContext>(this, 0);
|
||||
|
||||
ROC_SHMEM_HOST_CTX_DEFAULT.ctx_opaque = default_host_ctx.get();
|
||||
ROCSHMEM_HOST_CTX_DEFAULT.ctx_opaque = default_host_ctx.get();
|
||||
|
||||
team_world_proxy_ = new ROTeamProxy<HIPAllocator>(
|
||||
this, transport_->get_world_comm(), my_pe, num_pes);
|
||||
team_tracker.set_team_world(team_world_proxy_->get());
|
||||
|
||||
ROC_SHMEM_TEAM_WORLD =
|
||||
reinterpret_cast<roc_shmem_team_t>(team_world_proxy_->get());
|
||||
ROCSHMEM_TEAM_WORLD =
|
||||
reinterpret_cast<rocshmem_team_t>(team_world_proxy_->get());
|
||||
|
||||
default_block_handle_proxy_ = DefaultBlockHandleProxyT(
|
||||
bp->g_ret, bp->atomic_ret, &queue_, &ipcImpl, hdp_proxy_.get());
|
||||
@@ -120,7 +120,7 @@ ROBackend::~ROBackend() {
|
||||
CHECK_HIP(hipFree(ctx_array));
|
||||
}
|
||||
|
||||
__device__ bool ROBackend::create_ctx(int64_t options, roc_shmem_ctx_t *ctx) {
|
||||
__device__ bool ROBackend::create_ctx(int64_t options, rocshmem_ctx_t *ctx) {
|
||||
ROContext *ctx_;
|
||||
|
||||
auto pop_result = ctx_free_list.get()->pop_front();
|
||||
@@ -133,11 +133,11 @@ __device__ bool ROBackend::create_ctx(int64_t options, roc_shmem_ctx_t *ctx) {
|
||||
return true;
|
||||
}
|
||||
|
||||
__device__ void ROBackend::destroy_ctx(roc_shmem_ctx_t *ctx) {
|
||||
__device__ void ROBackend::destroy_ctx(rocshmem_ctx_t *ctx) {
|
||||
ctx_free_list.get()->push_back(static_cast<ROContext *>(ctx->ctx_opaque));
|
||||
}
|
||||
|
||||
void ROBackend::team_destroy(roc_shmem_team_t team) {
|
||||
void ROBackend::team_destroy(rocshmem_team_t team) {
|
||||
ROTeam *team_obj{get_internal_ro_team(team)};
|
||||
|
||||
team_obj->~ROTeam();
|
||||
@@ -148,7 +148,7 @@ void ROBackend::create_new_team(Team *parent_team,
|
||||
TeamInfo *team_info_wrt_parent,
|
||||
TeamInfo *team_info_wrt_world, int num_pes,
|
||||
int my_pe_in_new_team, MPI_Comm team_comm,
|
||||
roc_shmem_team_t *new_team) {
|
||||
rocshmem_team_t *new_team) {
|
||||
transport_->createNewTeam(this, parent_team, team_info_wrt_parent,
|
||||
team_info_wrt_world, num_pes, my_pe_in_new_team,
|
||||
team_comm, new_team);
|
||||
|
||||
@@ -85,20 +85,20 @@ class ROBackend : public Backend {
|
||||
void create_new_team(Team *parent_team, TeamInfo *team_info_wrt_parent,
|
||||
TeamInfo *team_info_wrt_world, int num_pes,
|
||||
int my_pe_in_new_team, MPI_Comm team_comm,
|
||||
roc_shmem_team_t *new_team) override;
|
||||
rocshmem_team_t *new_team) override;
|
||||
|
||||
/**
|
||||
* @copydoc Backend::team_destroy(roc_shmem_team_t)
|
||||
* @copydoc Backend::team_destroy(rocshmem_team_t)
|
||||
*/
|
||||
void team_destroy(roc_shmem_team_t team) override;
|
||||
void team_destroy(rocshmem_team_t team) override;
|
||||
|
||||
__device__ bool create_ctx(int64_t options, roc_shmem_ctx_t *ctx);
|
||||
__device__ bool create_ctx(int64_t options, rocshmem_ctx_t *ctx);
|
||||
|
||||
/**
|
||||
* @brief Destroy a `roc_shmem_ctx_t` context and returns it back to the
|
||||
* @brief Destroy a `rocshmem_ctx_t` context and returns it back to the
|
||||
* context free list.
|
||||
*/
|
||||
__device__ void destroy_ctx(roc_shmem_ctx_t *ctx);
|
||||
__device__ void destroy_ctx(rocshmem_ctx_t *ctx);
|
||||
|
||||
/**
|
||||
* @copydoc Backend::ctx_create
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#ifndef LIBRARY_SRC_REVERSE_OFFLOAD_CONTEXT_PROXY_HPP_
|
||||
#define LIBRARY_SRC_REVERSE_OFFLOAD_CONTEXT_PROXY_HPP_
|
||||
|
||||
#include "roc_shmem/roc_shmem.hpp"
|
||||
#include "rocshmem/rocshmem.hpp"
|
||||
#include "../device_proxy.hpp"
|
||||
#include "../memory/hip_allocator.hpp"
|
||||
#include "context_ro_device.hpp"
|
||||
@@ -46,7 +46,7 @@ class DefaultContextProxy {
|
||||
: constructed_{true} {
|
||||
auto ctx{proxy_.get()};
|
||||
new (ctx) ROContext(reinterpret_cast<Backend*>(backend), -1);
|
||||
roc_shmem_ctx_t local{ctx, tinfo};
|
||||
rocshmem_ctx_t local{ctx, tinfo};
|
||||
set_internal_ctx(&local);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <cstdlib>
|
||||
|
||||
#include "config.h" // NOLINT(build/include_subdir)
|
||||
#include "roc_shmem/roc_shmem.hpp"
|
||||
#include "rocshmem/rocshmem.hpp"
|
||||
#include "../backend_type.hpp"
|
||||
#include "../hdp_policy.hpp"
|
||||
#include "backend_proxy.hpp"
|
||||
@@ -176,7 +176,7 @@ __device__ void ROContext::sync_all() {
|
||||
__syncthreads();
|
||||
}
|
||||
|
||||
__device__ void ROContext::sync(roc_shmem_team_t team) {
|
||||
__device__ void ROContext::sync(rocshmem_team_t team) {
|
||||
ROTeam *team_obj = reinterpret_cast<ROTeam *>(team);
|
||||
if (is_thread_zero_in_block()) {
|
||||
build_queue_element(RO_NET_SYNC, nullptr, nullptr, 0, 0, 0, 0, 0, nullptr,
|
||||
@@ -472,7 +472,7 @@ __device__ void build_queue_element(
|
||||
ro_net_cmds type, void *dst, void *src, size_t size, int pe,
|
||||
int logPE_stride, int PE_size, int PE_root, void *pWrk, long *pSync,
|
||||
MPI_Comm team_comm, int ro_net_win_id, BlockHandle *handle,
|
||||
bool blocking, ROC_SHMEM_OP op, ro_net_types datatype) {
|
||||
bool blocking, ROCSHMEM_OP op, ro_net_types datatype) {
|
||||
auto write_slot{next_write_slot(handle)};
|
||||
auto queue_element = &handle->queue[write_slot];
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ __device__ void build_queue_element(
|
||||
ro_net_cmds type, void *dst, void *src, size_t size, int pe,
|
||||
int logPE_stride, int PE_size, int PE_root, void *pWrk, long *pSync,
|
||||
MPI_Comm team_comm, int ro_net_win_id, BlockHandle *handle,
|
||||
bool blocking, ROC_SHMEM_OP op = ROC_SHMEM_SUM,
|
||||
bool blocking, ROCSHMEM_OP op = ROCSHMEM_SUM,
|
||||
ro_net_types datatype = RO_NET_INT);
|
||||
|
||||
class ROContext : public Context {
|
||||
@@ -67,7 +67,7 @@ class ROContext : public Context {
|
||||
|
||||
__device__ void sync_all();
|
||||
|
||||
__device__ void sync(roc_shmem_team_t team);
|
||||
__device__ void sync(rocshmem_team_t team);
|
||||
|
||||
template <typename T>
|
||||
__device__ void p(T *dest, T value, int pe);
|
||||
@@ -75,13 +75,13 @@ class ROContext : public Context {
|
||||
template <typename T>
|
||||
__device__ T g(const T *source, int pe);
|
||||
|
||||
template <typename T, ROC_SHMEM_OP Op>
|
||||
template <typename T, ROCSHMEM_OP Op>
|
||||
__device__ void to_all(T *dest, const T *source, int nreduce, int PE_start,
|
||||
int logPE_stride, int PE_size, T *pWrk,
|
||||
long *pSync); // NOLINT(runtime/int)
|
||||
|
||||
template <typename T, ROC_SHMEM_OP Op>
|
||||
__device__ void to_all(roc_shmem_team_t team, T *dest, const T *source,
|
||||
template <typename T, ROCSHMEM_OP Op>
|
||||
__device__ void to_all(rocshmem_team_t team, T *dest, const T *source,
|
||||
int nreduce);
|
||||
|
||||
template <typename T>
|
||||
@@ -133,7 +133,7 @@ class ROContext : public Context {
|
||||
__device__ void amo_xor(void *dst, T value, int pe);
|
||||
|
||||
template <typename T>
|
||||
__device__ void broadcast(roc_shmem_team_t team, T *dest, const T *source,
|
||||
__device__ void broadcast(rocshmem_team_t team, T *dest, const T *source,
|
||||
int nelems, int pe_root);
|
||||
|
||||
template <typename T>
|
||||
@@ -142,43 +142,43 @@ class ROContext : public Context {
|
||||
long *p_sync); // NOLINT(runtime/int)
|
||||
|
||||
template <typename T>
|
||||
__device__ void alltoall(roc_shmem_team_t team, T *dest, const T *source,
|
||||
__device__ void alltoall(rocshmem_team_t team, T *dest, const T *source,
|
||||
int nelems);
|
||||
|
||||
template <typename T>
|
||||
__device__ void alltoall_broadcast(roc_shmem_team_t team, T *dest,
|
||||
__device__ void alltoall_broadcast(rocshmem_team_t team, T *dest,
|
||||
const T *source, int nelems);
|
||||
|
||||
template <typename T>
|
||||
__device__ void alltoall_mpi(roc_shmem_team_t team, T *dest, const T *source,
|
||||
__device__ void alltoall_mpi(rocshmem_team_t team, T *dest, const T *source,
|
||||
int nelems);
|
||||
|
||||
template <typename T>
|
||||
__device__ void alltoall_gcen(roc_shmem_team_t team, T *dest, const T *source,
|
||||
__device__ void alltoall_gcen(rocshmem_team_t team, T *dest, const T *source,
|
||||
int nelems);
|
||||
|
||||
template <typename T>
|
||||
__device__ void alltoall_gcen2(roc_shmem_team_t team, T *dest,
|
||||
__device__ void alltoall_gcen2(rocshmem_team_t team, T *dest,
|
||||
const T *source, int nelems);
|
||||
|
||||
template <typename T>
|
||||
__device__ void fcollect(roc_shmem_team_t team, T *dest, const T *source,
|
||||
__device__ void fcollect(rocshmem_team_t team, T *dest, const T *source,
|
||||
int nelems);
|
||||
|
||||
template <typename T>
|
||||
__device__ void fcollect_broadcast(roc_shmem_team_t team, T *dest,
|
||||
__device__ void fcollect_broadcast(rocshmem_team_t team, T *dest,
|
||||
const T *source, int nelems);
|
||||
|
||||
template <typename T>
|
||||
__device__ void fcollect_mpi(roc_shmem_team_t team, T *dest, const T *source,
|
||||
__device__ void fcollect_mpi(rocshmem_team_t team, T *dest, const T *source,
|
||||
int nelems);
|
||||
|
||||
template <typename T>
|
||||
__device__ void fcollect_gcen(roc_shmem_team_t team, T *dest, const T *source,
|
||||
__device__ void fcollect_gcen(rocshmem_team_t team, T *dest, const T *source,
|
||||
int nelems);
|
||||
|
||||
template <typename T>
|
||||
__device__ void fcollect_gcen2(roc_shmem_team_t team, T *dest,
|
||||
__device__ void fcollect_gcen2(rocshmem_team_t team, T *dest,
|
||||
const T *source, int nelems);
|
||||
|
||||
__device__ void putmem_wg(void *dest, const void *source, size_t nelems,
|
||||
|
||||
@@ -135,16 +135,16 @@ class ROHostContext : public Context {
|
||||
long *p_sync); // NOLINT(runtime/int)
|
||||
|
||||
template <typename T>
|
||||
__host__ void broadcast(roc_shmem_team_t team, T *dest, const T *source,
|
||||
__host__ void broadcast(rocshmem_team_t team, T *dest, const T *source,
|
||||
int nelems, int pe_root);
|
||||
|
||||
template <typename T, ROC_SHMEM_OP Op>
|
||||
template <typename T, ROCSHMEM_OP Op>
|
||||
__host__ void to_all(T *dest, const T *source, int nreduce, int pe_start,
|
||||
int log_pe_stride, int pe_size, T *p_wrk,
|
||||
long *p_sync); // NOLINT(runtime/int)
|
||||
|
||||
template <typename T, ROC_SHMEM_OP Op>
|
||||
__host__ void to_all(roc_shmem_team_t team, T *dest, const T *source,
|
||||
template <typename T, ROCSHMEM_OP Op>
|
||||
__host__ void to_all(rocshmem_team_t team, T *dest, const T *source,
|
||||
int nreduce);
|
||||
|
||||
template <typename T>
|
||||
|
||||
@@ -108,8 +108,8 @@ struct GetROType<long double> {
|
||||
********************************* DEVICE API *********************************
|
||||
*****************************************************************************/
|
||||
|
||||
template <typename T, ROC_SHMEM_OP Op>
|
||||
__device__ void ROContext::to_all(roc_shmem_team_t team, T *dest,
|
||||
template <typename T, ROCSHMEM_OP Op>
|
||||
__device__ void ROContext::to_all(rocshmem_team_t team, T *dest,
|
||||
const T *source, int nreduce) {
|
||||
if (!is_thread_zero_in_block()) {
|
||||
__syncthreads();
|
||||
@@ -125,7 +125,7 @@ __device__ void ROContext::to_all(roc_shmem_team_t team, T *dest,
|
||||
__syncthreads();
|
||||
}
|
||||
|
||||
template <typename T, ROC_SHMEM_OP Op>
|
||||
template <typename T, ROCSHMEM_OP Op>
|
||||
__device__ void ROContext::to_all(T *dest, const T *source, int nreduce,
|
||||
int PE_start, int logPE_stride, int PE_size,
|
||||
T *pWrk, long *pSync) {
|
||||
@@ -210,7 +210,7 @@ __device__ T ROContext::amo_fetch_cas(void *dst, T value, T cond, int pe) {
|
||||
value, pe, 0, 0, 0,
|
||||
reinterpret_cast<void *>(static_cast<long long>(cond)),
|
||||
nullptr, (MPI_Comm)NULL, ro_net_win_id, block_handle, true,
|
||||
ROC_SHMEM_SUM, GetROType<T>::Type);
|
||||
ROCSHMEM_SUM, GetROType<T>::Type);
|
||||
__threadfence();
|
||||
return *source;
|
||||
}
|
||||
@@ -225,7 +225,7 @@ __device__ T ROContext::amo_fetch_add(void *dst, T value, int pe) {
|
||||
auto source{get_unused_atomic()};
|
||||
build_queue_element(RO_NET_AMO_FOP, dst, reinterpret_cast<T *>(source), value,
|
||||
pe, 0, 0, 0, nullptr, nullptr, (MPI_Comm)NULL,
|
||||
ro_net_win_id, block_handle, true, ROC_SHMEM_SUM,
|
||||
ro_net_win_id, block_handle, true, ROCSHMEM_SUM,
|
||||
GetROType<T>::Type);
|
||||
__threadfence();
|
||||
return *source;
|
||||
@@ -241,7 +241,7 @@ __device__ T ROContext::amo_swap(void *dst, T value, int pe) {
|
||||
auto source{get_unused_atomic()};
|
||||
build_queue_element(RO_NET_AMO_FOP, dst, reinterpret_cast<void *>(source),
|
||||
value, pe, 0, 0, 0, nullptr, nullptr, (MPI_Comm)NULL,
|
||||
ro_net_win_id, block_handle, true, ROC_SHMEM_REPLACE,
|
||||
ro_net_win_id, block_handle, true, ROCSHMEM_REPLACE,
|
||||
GetROType<T>::Type);
|
||||
__threadfence();
|
||||
return *source;
|
||||
@@ -257,7 +257,7 @@ __device__ T ROContext::amo_fetch_and(void *dst, T value, int pe) {
|
||||
auto source{get_unused_atomic()};
|
||||
build_queue_element(RO_NET_AMO_FOP, dst, reinterpret_cast<void *>(source),
|
||||
value, pe, 0, 0, 0, nullptr, nullptr, (MPI_Comm)NULL,
|
||||
ro_net_win_id, block_handle, true, ROC_SHMEM_AND,
|
||||
ro_net_win_id, block_handle, true, ROCSHMEM_AND,
|
||||
GetROType<T>::Type);
|
||||
__threadfence();
|
||||
return *source;
|
||||
@@ -273,7 +273,7 @@ __device__ T ROContext::amo_fetch_or(void *dst, T value, int pe) {
|
||||
auto source{get_unused_atomic()};
|
||||
build_queue_element(RO_NET_AMO_FOP, dst, reinterpret_cast<void *>(source),
|
||||
value, pe, 0, 0, 0, nullptr, nullptr, (MPI_Comm)NULL,
|
||||
ro_net_win_id, block_handle, true, ROC_SHMEM_OR,
|
||||
ro_net_win_id, block_handle, true, ROCSHMEM_OR,
|
||||
GetROType<T>::Type);
|
||||
__threadfence();
|
||||
return *source;
|
||||
@@ -289,7 +289,7 @@ __device__ T ROContext::amo_fetch_xor(void *dst, T value, int pe) {
|
||||
auto source{get_unused_atomic()};
|
||||
build_queue_element(RO_NET_AMO_FOP, dst, reinterpret_cast<void *>(source),
|
||||
value, pe, 0, 0, 0, nullptr, nullptr, (MPI_Comm)NULL,
|
||||
ro_net_win_id, block_handle, true, ROC_SHMEM_XOR,
|
||||
ro_net_win_id, block_handle, true, ROCSHMEM_XOR,
|
||||
GetROType<T>::Type);
|
||||
__threadfence();
|
||||
return *source;
|
||||
@@ -301,7 +301,7 @@ __device__ void ROContext::amo_xor(void *dst, T value, int pe) {
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
__device__ void ROContext::broadcast(roc_shmem_team_t team, T *dest,
|
||||
__device__ void ROContext::broadcast(rocshmem_team_t team, T *dest,
|
||||
const T *source, int nelems, int pe_root) {
|
||||
if (!is_thread_zero_in_block()) {
|
||||
__syncthreads();
|
||||
@@ -313,7 +313,7 @@ __device__ void ROContext::broadcast(roc_shmem_team_t team, T *dest,
|
||||
build_queue_element(RO_NET_TEAM_BROADCAST, dest, const_cast<T *>(source),
|
||||
nelems, 0, 0, 0, pe_root, nullptr, nullptr,
|
||||
team_obj->mpi_comm, ro_net_win_id, block_handle, true,
|
||||
ROC_SHMEM_SUM, GetROType<T>::Type);
|
||||
ROCSHMEM_SUM, GetROType<T>::Type);
|
||||
|
||||
__syncthreads();
|
||||
}
|
||||
@@ -331,13 +331,13 @@ __device__ void ROContext::broadcast(T *dest, const T *source, int nelems,
|
||||
build_queue_element(RO_NET_BROADCAST, dest, const_cast<T *>(source), nelems,
|
||||
pe_start, log_pe_stride, pe_size, pe_root, nullptr,
|
||||
p_sync, (MPI_Comm)NULL, ro_net_win_id, block_handle, true,
|
||||
ROC_SHMEM_SUM, GetROType<T>::Type);
|
||||
ROCSHMEM_SUM, GetROType<T>::Type);
|
||||
|
||||
__syncthreads();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
__device__ void ROContext::alltoall(roc_shmem_team_t team, T *dest,
|
||||
__device__ void ROContext::alltoall(rocshmem_team_t team, T *dest,
|
||||
const T *source, int nelems) {
|
||||
if (!is_thread_zero_in_block()) {
|
||||
__syncthreads();
|
||||
@@ -349,13 +349,13 @@ __device__ void ROContext::alltoall(roc_shmem_team_t team, T *dest,
|
||||
build_queue_element(RO_NET_ALLTOALL, dest, const_cast<T *>(source), nelems, 0,
|
||||
0, 0, 0, team_obj->ata_buffer, nullptr,
|
||||
team_obj->mpi_comm, ro_net_win_id, block_handle, true,
|
||||
ROC_SHMEM_SUM, GetROType<T>::Type);
|
||||
ROCSHMEM_SUM, GetROType<T>::Type);
|
||||
|
||||
__syncthreads();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
__device__ void ROContext::fcollect(roc_shmem_team_t team, T *dest,
|
||||
__device__ void ROContext::fcollect(rocshmem_team_t team, T *dest,
|
||||
const T *source, int nelems) {
|
||||
if (!is_thread_zero_in_block()) {
|
||||
__syncthreads();
|
||||
@@ -367,7 +367,7 @@ __device__ void ROContext::fcollect(roc_shmem_team_t team, T *dest,
|
||||
build_queue_element(RO_NET_FCOLLECT, dest, const_cast<T *>(source), nelems, 0,
|
||||
0, 0, 0, team_obj->ata_buffer, nullptr,
|
||||
team_obj->mpi_comm, ro_net_win_id, block_handle, true,
|
||||
ROC_SHMEM_SUM, GetROType<T>::Type);
|
||||
ROCSHMEM_SUM, GetROType<T>::Type);
|
||||
|
||||
__syncthreads();
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ __host__ void ROHostContext::broadcast(T *dest, const T *source, int nelems,
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
__host__ void ROHostContext::broadcast(roc_shmem_team_t team, T *dest,
|
||||
__host__ void ROHostContext::broadcast(rocshmem_team_t team, T *dest,
|
||||
const T *source, int nelems,
|
||||
int pe_root) {
|
||||
DPRINTF("Function: Team-based ro_net_host_broadcast\n");
|
||||
@@ -122,7 +122,7 @@ __host__ void ROHostContext::broadcast(roc_shmem_team_t team, T *dest,
|
||||
host_interface->broadcast<T>(team, dest, source, nelems, pe_root);
|
||||
}
|
||||
|
||||
template <typename T, ROC_SHMEM_OP Op>
|
||||
template <typename T, ROCSHMEM_OP Op>
|
||||
__host__ void ROHostContext::to_all(T *dest, const T *source, int nreduce,
|
||||
int pe_start, int log_pe_stride,
|
||||
int pe_size, T *p_wrk, long *p_sync) {
|
||||
@@ -132,8 +132,8 @@ __host__ void ROHostContext::to_all(T *dest, const T *source, int nreduce,
|
||||
pe_size, p_wrk, p_sync);
|
||||
}
|
||||
|
||||
template <typename T, ROC_SHMEM_OP Op>
|
||||
__host__ void ROHostContext::to_all(roc_shmem_team_t team, T *dest,
|
||||
template <typename T, ROCSHMEM_OP Op>
|
||||
__host__ void ROHostContext::to_all(rocshmem_team_t team, T *dest,
|
||||
const T *source, int nreduce) {
|
||||
DPRINTF("Function: Team-based ro_net_host_to_all\n");
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ void MPITransport::submitRequestsToMPI() {
|
||||
const_cast<unsigned long long *>(&next_element.ol1.atomic_value),
|
||||
next_element.PE, next_element.ro_net_win_id, queue_idx,
|
||||
next_element.threadId, true,
|
||||
static_cast<ROC_SHMEM_OP>(next_element.op),
|
||||
static_cast<ROCSHMEM_OP>(next_element.op),
|
||||
static_cast<ro_net_types>(next_element.datatype));
|
||||
DPRINTF("Received AMO dst %p src %p Val %llu pe %d\n", next_element.dst,
|
||||
next_element.src, next_element.ol1.atomic_value, next_element.PE);
|
||||
@@ -163,7 +163,7 @@ void MPITransport::submitRequestsToMPI() {
|
||||
team_reduction(next_element.dst, next_element.src, next_element.ol1.size,
|
||||
next_element.ro_net_win_id, queue_idx,
|
||||
next_element.team_comm,
|
||||
static_cast<ROC_SHMEM_OP>(next_element.op),
|
||||
static_cast<ROCSHMEM_OP>(next_element.op),
|
||||
static_cast<ro_net_types>(next_element.datatype),
|
||||
next_element.threadId, true);
|
||||
DPRINTF("Received FLOAT_SUM_TEAM_TO_ALL dst %p src %p size %lu team %d\n",
|
||||
@@ -175,7 +175,7 @@ void MPITransport::submitRequestsToMPI() {
|
||||
next_element.PE, next_element.ro_net_win_id, queue_idx,
|
||||
next_element.PE, next_element.logPE_stride,
|
||||
next_element.PE_size, next_element.ol2.pWrk, next_element.pSync,
|
||||
static_cast<ROC_SHMEM_OP>(next_element.op),
|
||||
static_cast<ROCSHMEM_OP>(next_element.op),
|
||||
static_cast<ro_net_types>(next_element.datatype),
|
||||
next_element.threadId, true);
|
||||
DPRINTF(
|
||||
@@ -275,15 +275,15 @@ void MPITransport::finalizeTransport() {
|
||||
delete host_interface;
|
||||
}
|
||||
|
||||
roc_shmem_team_t get_external_team(ROTeam *team) {
|
||||
return reinterpret_cast<roc_shmem_team_t>(team);
|
||||
rocshmem_team_t get_external_team(ROTeam *team) {
|
||||
return reinterpret_cast<rocshmem_team_t>(team);
|
||||
}
|
||||
|
||||
void MPITransport::createNewTeam(ROBackend *backend, Team *parent_team,
|
||||
TeamInfo *team_info_wrt_parent,
|
||||
TeamInfo *team_info_wrt_world, int num_pes,
|
||||
int my_pe_in_new_team, MPI_Comm team_comm,
|
||||
roc_shmem_team_t *new_team) {
|
||||
rocshmem_team_t *new_team) {
|
||||
ROTeam *new_team_obj{nullptr};
|
||||
|
||||
CHECK_HIP(hipMalloc(&new_team_obj, sizeof(ROTeam)));
|
||||
@@ -342,26 +342,26 @@ void MPITransport::barrier(int blockId, int threadId, bool blocking,
|
||||
outstanding[blockId]++;
|
||||
}
|
||||
|
||||
MPI_Op MPITransport::get_mpi_op(ROC_SHMEM_OP op) {
|
||||
MPI_Op MPITransport::get_mpi_op(ROCSHMEM_OP op) {
|
||||
switch (op) {
|
||||
case ROC_SHMEM_SUM:
|
||||
case ROCSHMEM_SUM:
|
||||
return MPI_SUM;
|
||||
case ROC_SHMEM_MAX:
|
||||
case ROCSHMEM_MAX:
|
||||
return MPI_MAX;
|
||||
case ROC_SHMEM_MIN:
|
||||
case ROCSHMEM_MIN:
|
||||
return MPI_MIN;
|
||||
case ROC_SHMEM_PROD:
|
||||
case ROCSHMEM_PROD:
|
||||
return MPI_PROD;
|
||||
case ROC_SHMEM_AND:
|
||||
case ROCSHMEM_AND:
|
||||
return MPI_BAND;
|
||||
case ROC_SHMEM_OR:
|
||||
case ROCSHMEM_OR:
|
||||
return MPI_BOR;
|
||||
case ROC_SHMEM_XOR:
|
||||
case ROCSHMEM_XOR:
|
||||
return MPI_BXOR;
|
||||
case ROC_SHMEM_REPLACE:
|
||||
case ROCSHMEM_REPLACE:
|
||||
return MPI_REPLACE;
|
||||
default:
|
||||
fprintf(stderr, "Unknown ROC_SHMEM op MPI conversion %d\n", op);
|
||||
fprintf(stderr, "Unknown rocSHMEM op MPI conversion %d\n", op);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
@@ -383,7 +383,7 @@ static MPI_Datatype convertType(ro_net_types type) {
|
||||
case RO_NET_LONG_DOUBLE:
|
||||
return MPI_LONG_DOUBLE;
|
||||
default:
|
||||
fprintf(stderr, "Unknown ROC_SHMEM type MPI conversion %d\n", type);
|
||||
fprintf(stderr, "Unknown rocSHMEM type MPI conversion %d\n", type);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
@@ -391,7 +391,7 @@ static MPI_Datatype convertType(ro_net_types type) {
|
||||
void MPITransport::reduction(void *dst, void *src, int size, int pe,
|
||||
int win_id, int blockId, int start, int logPstride,
|
||||
int sizePE, void *pWrk, long *pSync,
|
||||
ROC_SHMEM_OP op, ro_net_types type, int threadId,
|
||||
ROCSHMEM_OP op, ro_net_types type, int threadId,
|
||||
bool blocking) {
|
||||
MPI_Request request{};
|
||||
MPI_Op mpi_op{get_mpi_op(op)};
|
||||
@@ -435,7 +435,7 @@ void MPITransport::broadcast(void *dst, void *src, int size, int pe,
|
||||
}
|
||||
|
||||
void MPITransport::team_reduction(void *dst, void *src, int size, int win_id,
|
||||
int blockId, MPI_Comm team, ROC_SHMEM_OP op,
|
||||
int blockId, MPI_Comm team, ROCSHMEM_OP op,
|
||||
ro_net_types type, int threadId,
|
||||
bool blocking) {
|
||||
MPI_Request request{};
|
||||
@@ -1046,7 +1046,7 @@ void MPITransport::putMem(void *dst, void *src, int size, int pe, int win_id,
|
||||
|
||||
void MPITransport::amoFOP(void *dst, void *src, void *val, int pe, int win_id,
|
||||
int blockId, int threadId, bool blocking,
|
||||
ROC_SHMEM_OP op, ro_net_types type) {
|
||||
ROCSHMEM_OP op, ro_net_types type) {
|
||||
queue->flush_hdp();
|
||||
|
||||
auto *bp{backend_proxy->get()};
|
||||
|
||||
@@ -49,18 +49,18 @@ class MPITransport : public Transport {
|
||||
TeamInfo *team_info_wrt_parent,
|
||||
TeamInfo *team_info_wrt_world, int num_pes,
|
||||
int my_pe_in_new_team, MPI_Comm team_comm,
|
||||
roc_shmem_team_t *new_team) override;
|
||||
rocshmem_team_t *new_team) override;
|
||||
|
||||
void barrier(int blockId, int threadId, bool blocking,
|
||||
MPI_Comm team) override;
|
||||
|
||||
void reduction(void *dst, void *src, int size, int pe, int win_id,
|
||||
int blockId, int start, int logPstride, int sizePE, void *pWrk,
|
||||
long *pSync, ROC_SHMEM_OP op, ro_net_types type,
|
||||
long *pSync, ROCSHMEM_OP op, ro_net_types type,
|
||||
int threadId, bool blocking) override;
|
||||
|
||||
void team_reduction(void *dst, void *src, int size, int win_id, int blockId,
|
||||
MPI_Comm team, ROC_SHMEM_OP op, ro_net_types type,
|
||||
MPI_Comm team, ROCSHMEM_OP op, ro_net_types type,
|
||||
int threadId, bool blocking) override;
|
||||
|
||||
void broadcast(void *dst, void *src, int size, int pe, int win_id,
|
||||
@@ -116,7 +116,7 @@ class MPITransport : public Transport {
|
||||
int threadId, bool blocking, bool inline_data = false) override;
|
||||
|
||||
void amoFOP(void *dst, void *src, void *val, int pe, int win_id, int blockId,
|
||||
int threadId, bool blocking, ROC_SHMEM_OP op,
|
||||
int threadId, bool blocking, ROCSHMEM_OP op,
|
||||
ro_net_types type) override;
|
||||
|
||||
void amoFCAS(void *dst, void *src, void *val, int pe, int win_id, int blockId,
|
||||
@@ -193,7 +193,7 @@ class MPITransport : public Transport {
|
||||
|
||||
void submitRequestsToMPI();
|
||||
|
||||
MPI_Op get_mpi_op(ROC_SHMEM_OP op);
|
||||
MPI_Op get_mpi_op(ROCSHMEM_OP op);
|
||||
|
||||
Queue *queue{nullptr};
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "roc_shmem/roc_shmem.hpp"
|
||||
#include "rocshmem/rocshmem.hpp"
|
||||
#include "backend_proxy.hpp"
|
||||
#include "ro_net_team.hpp"
|
||||
|
||||
@@ -48,18 +48,18 @@ class Transport {
|
||||
TeamInfo *team_info_wrt_parent,
|
||||
TeamInfo *team_info_wrt_world, int num_pes,
|
||||
int my_pe_in_new_team, MPI_Comm team_comm,
|
||||
roc_shmem_team_t *new_team) = 0;
|
||||
rocshmem_team_t *new_team) = 0;
|
||||
|
||||
virtual void barrier(int wg_id, int threadId, bool blocking,
|
||||
MPI_Comm team) = 0;
|
||||
|
||||
virtual void reduction(void *dst, void *src, int size, int pe, int win_id,
|
||||
int wg_id, int start, int logPstride, int sizePE,
|
||||
void *pWrk, long *pSync, ROC_SHMEM_OP op,
|
||||
void *pWrk, long *pSync, ROCSHMEM_OP op,
|
||||
ro_net_types type, int threadId, bool blocking) = 0;
|
||||
|
||||
virtual void team_reduction(void *dst, void *src, int size, int win_id,
|
||||
int wg_id, MPI_Comm team, ROC_SHMEM_OP op,
|
||||
int wg_id, MPI_Comm team, ROCSHMEM_OP op,
|
||||
ro_net_types type, int threadId,
|
||||
bool blocking) = 0;
|
||||
|
||||
@@ -89,7 +89,7 @@ class Transport {
|
||||
int wg_id, int threadId, bool blocking) = 0;
|
||||
|
||||
virtual void amoFOP(void *dst, void *src, void *val, int pe, int win_id,
|
||||
int wg_id, int threadId, bool blocking, ROC_SHMEM_OP op,
|
||||
int wg_id, int threadId, bool blocking, ROCSHMEM_OP op,
|
||||
ro_net_types type) = 0;
|
||||
|
||||
virtual void amoFCAS(void *dst, void *src, void *val, int pe, int win_id,
|
||||
|
||||
Reference in New Issue
Block a user