18#ifndef REALM_HIP_INTERNAL_H
19#define REALM_HIP_INTERNAL_H
23#include <hip/hip_runtime.h>
37#define CHECK_CUDART(cmd) \
39 hipError_t ret = (cmd); \
40 if(ret != hipSuccess) { \
41 fprintf(stderr, "HIP: %s = %d (%s)\n", #cmd, ret, hipGetErrorString(ret)); \
47#define REPORT_HIP_ERROR(cmd, ret) \
49 const char *name, *str; \
50 name = hipGetErrorName(ret); \
51 str = hipGetErrorString(ret); \
52 fprintf(stderr, "HIP: %s = %d (%s): %s\n", cmd, ret, name, str); \
56#define CHECK_HIP(cmd) \
58 hipError_t ret = (cmd); \
59 if(ret != hipSuccess) \
60 REPORT_HIP_ERROR(#cmd, ret); \
92 class GPUDynamicFBMemory;
135 virtual void print(std::ostream &os)
const;
155 virtual void print(std::ostream &os)
const;
336 size_t volume,
GPUStream *stream,
size_t arg_size);
338 size_t volume,
size_t arg_size,
344 size_t field_size,
size_t volume,
size_t arg_size,
464 void gpu_memcpy(
void *dst,
const void *
src,
size_t size, hipMemcpyKind kind);
519 size_t &inst_offset);
544 bool need_alloc_result,
560 size_t &inst_offset);
579 void *_cpu_base,
size_t _size,
MemoryKind _kind,
592 size_t &inst_offset);
639 XferDes *_xd,
int _read_port_idx,
size_t _read_offset,
size_t _read_size,
640 int _write_port_idx,
size_t _write_offset,
size_t _write_size,
641 int _read_ind_port_idx = -1,
size_t _read_ind_offset = 0,
642 size_t _read_ind_size = 0,
int _write_ind_port_idx = -1,
643 size_t _write_ind_offset = 0,
size_t _write_ind_size = 0);
662 size_t _read_size,
int _write_port_idx,
size_t _write_offset,
686 size_t field_offset,
int ndims,
const int64_t lo[],
687 const int64_t hi[],
const int order[]);
700 XferDesID _guid,
const std::vector<XferDesPortInfo> &inputs_info,
701 const std::vector<XferDesPortInfo> &outputs_info,
int _priority);
708 std::vector<GPU *> src_gpus, dst_gpus;
709 std::vector<bool> dst_is_ipc;
717 XferDesID _guid,
const std::vector<XferDesPortInfo> &inputs_info,
718 const std::vector<XferDesPortInfo> &outputs_info,
int _priority,
746 size_t total_bytes,
const std::vector<size_t> *src_frags,
747 const std::vector<size_t> *dst_frags,
XferDesKind *kind_ret = 0,
748 unsigned *bw_ret = 0,
unsigned *lat_ret = 0);
754 const std::vector<XferDesPortInfo> &inputs_info,
755 const std::vector<XferDesPortInfo> &outputs_info,
757 const void *fill_data,
size_t fill_size,
771 uintptr_t _remote_ptr,
772 const std::vector<Channel::SupportedPath> &_paths,
773 const std::vector<Memory> &_indirect_memories);
777 template <
typename S>
780 template <
typename S>
794 const std::vector<Memory> &_indirect_memories);
800 size_t total_bytes,
const std::vector<size_t> *src_frags,
801 const std::vector<size_t> *dst_frags,
XferDesKind *kind_ret ,
802 unsigned *bw_ret ,
unsigned *lat_ret );
816 const std::vector<XferDesPortInfo> &inputs_info,
817 const std::vector<XferDesPortInfo> &outputs_info,
819 const void *fill_data,
size_t fill_size,
830 class GPUfillChannel;
835 XferDesID _guid,
const std::vector<XferDesPortInfo> &inputs_info,
836 const std::vector<XferDesPortInfo> &outputs_info,
int _priority,
837 const void *_fill_data,
size_t _fill_size,
size_t _fill_total);
856 const std::vector<XferDesPortInfo> &inputs_info,
857 const std::vector<XferDesPortInfo> &outputs_info,
859 const void *fill_data,
size_t fill_size,
874 XferDesID _guid,
const std::vector<XferDesPortInfo> &inputs_info,
875 const std::vector<XferDesPortInfo> &outputs_info,
int _priority,
883 size_t in_span_start,
size_t out_span_start);
886 const size_t in_span_start,
const size_t out_span_start,
887 const size_t in_elem_size,
const size_t out_elem_size,
888 const size_t elems,
const bool has_transpose);
914 const std::vector<XferDesPortInfo> &inputs_info,
915 const std::vector<XferDesPortInfo> &outputs_info,
917 const void *fill_data,
size_t fill_size,
931 const std::vector<Channel::SupportedPath> &_paths);
935 template <
typename S>
938 template <
typename S>
961 const void *data,
size_t datalen);
968 const void *data,
size_t datalen);
974 const void *data,
size_t datalen);
Definition bytearray.h:30
Definition bytearray.h:53
Definition circ_queue.h:35
Definition codedesc.h:249
Definition instance.h:405
Definition hip_internal.h:682
size_t width_in_bytes
Definition hip_internal.h:692
size_t depth
Definition hip_internal.h:692
size_t height
Definition hip_internal.h:692
size_t pos[3]
Definition hip_internal.h:691
int dim
Definition hip_internal.h:690
hipArray_t array
Definition hip_internal.h:689
virtual int set_rect(const RegionInstanceImpl *inst, const InstanceLayoutPieceBase *piece, size_t field_size, size_t field_offset, int ndims, const int64_t lo[], const int64_t hi[], const int order[])
Definition hip_internal.h:430
AutoGPUContext(GPU *_gpu)
GPU * gpu
Definition hip_internal.h:437
AutoGPUContext(GPU &_gpu)
Definition hip_internal.h:285
Mutex::CondVar condvar
Definition hip_internal.h:303
bool shutdown_flag
Definition hip_internal.h:304
int max_threads
Definition hip_internal.h:301
GPU * gpu
Definition hip_internal.h:298
int total_threads
Definition hip_internal.h:306
ContextSynchronizer(GPU *_gpu, int _device_id, CoreReservationSet &crs, int _max_threads)
GPUWorkFence::FenceList fences
Definition hip_internal.h:305
int device_id
Definition hip_internal.h:300
CoreReservation * core_rsrv
Definition hip_internal.h:308
std::vector< Thread * > worker_threads
Definition hip_internal.h:307
int sleeping_threads
Definition hip_internal.h:306
int syncing_threads
Definition hip_internal.h:306
void add_fence(GPUWorkFence *fence)
Mutex mutex
Definition hip_internal.h:302
Definition hip_internal.h:805
long submit(Request **requests, long nr)
GPUChannel(GPU *_src_gpu, XferDesKind _kind, BackgroundWorkManager *bgwork)
GPU * get_gpu() const
Definition hip_internal.h:823
static const bool is_ordered
Definition hip_internal.h:812
virtual XferDes * create_xfer_des(uintptr_t dma_op, NodeID launch_node, XferDesID guid, const std::vector< XferDesPortInfo > &inputs_info, const std::vector< XferDesPortInfo > &outputs_info, int priority, XferDesRedopInfo redop_info, const void *fill_data, size_t fill_size, size_t fill_total)
Definition hip_internal.h:620
void request_completed(void)
GPURequest * req
Definition hip_internal.h:624
Definition hip_internal.h:102
virtual ~GPUCompletionNotification(void)
Definition hip_internal.h:104
virtual void request_completed(void)=0
Definition hip_internal.h:534
GPU * gpu
Definition hip_internal.h:570
virtual void unregister_external_resource(RegionInstanceImpl *inst)
std::map< RegionInstance, std::pair< void *, size_t > > alloc_bases
Definition hip_internal.h:573
size_t cur_size
Definition hip_internal.h:572
Mutex mutex
Definition hip_internal.h:571
virtual AllocationResult allocate_storage_immediate(RegionInstanceImpl *inst, bool need_alloc_result, bool poisoned, TimeLimit work_until)
virtual void get_bytes(off_t offset, void *dst, size_t size)
virtual ~GPUDynamicFBMemory(void)
virtual ExternalInstanceResource * generate_resource_info(RegionInstanceImpl *inst, const IndexSpaceGeneric *subspace, span< const FieldID > fields, bool read_only)
virtual void put_bytes(off_t offset, const void *src, size_t size)
virtual void * get_direct_ptr(off_t offset, size_t size)
virtual bool attempt_register_external_resource(RegionInstanceImpl *inst, size_t &inst_offset)
GPUDynamicFBMemory(RuntimeImpl *_runtime_impl, Memory _me, GPU *_gpu, size_t _max_size)
virtual void release_storage_immediate(RegionInstanceImpl *inst, bool poisoned, TimeLimit work_until)
Definition hip_internal.h:262
int external_count
Definition hip_internal.h:277
void init_pool(int init_size=0)
int batch_size
Definition hip_internal.h:277
int current_size
Definition hip_internal.h:277
GPUEventPool(int _batch_size=256)
int total_size
Definition hip_internal.h:277
hipEvent_t get_event(bool external=false)
Mutex mutex
Definition hip_internal.h:276
std::vector< hipEvent_t > available_events
Definition hip_internal.h:278
void return_event(hipEvent_t e, bool external=false)
Definition hip_internal.h:607
char * base
Definition hip_internal.h:614
GPU * gpu
Definition hip_internal.h:613
GPUFBIBMemory(RuntimeImpl *_runtime_impl, Memory _me, GPU *_gpu, char *_base, size_t _size)
NetworkSegment local_segment
Definition hip_internal.h:615
Definition hip_internal.h:503
virtual void unregister_external_resource(RegionInstanceImpl *inst)
virtual void put_bytes(off_t offset, const void *src, size_t size)
virtual ExternalInstanceResource * generate_resource_info(RegionInstanceImpl *inst, const IndexSpaceGeneric *subspace, span< const FieldID > fields, bool read_only)
virtual void get_bytes(off_t offset, void *dst, size_t size)
NetworkSegment local_segment
Definition hip_internal.h:531
virtual bool attempt_register_external_resource(RegionInstanceImpl *inst, size_t &inst_offset)
virtual void * get_direct_ptr(off_t offset, size_t size)
char * base
Definition hip_internal.h:530
virtual ~GPUFBMemory(void)
GPU * gpu
Definition hip_internal.h:529
GPUFBMemory(RuntimeImpl *_runtime_impl, Memory _me, GPU *_gpu, char *_base, size_t _size)
Definition hip_internal.h:730
virtual Memory suggest_ib_memories() const
GPUIndirectChannel(GPU *_src_gpu, XferDesKind _kind, BackgroundWorkManager *bgwork)
long submit(Request **requests, long nr)
virtual XferDes * create_xfer_des(uintptr_t dma_op, NodeID launch_node, XferDesID guid, const std::vector< XferDesPortInfo > &inputs_info, const std::vector< XferDesPortInfo > &outputs_info, int priority, XferDesRedopInfo redop_info, const void *fill_data, size_t fill_size, size_t fill_total)
virtual uint64_t supports_path(ChannelCopyInfo channel_copy_info, CustomSerdezID src_serdez_id, CustomSerdezID dst_serdez_id, ReductionOpID redop_id, size_t total_bytes, const std::vector< size_t > *src_frags, const std::vector< size_t > *dst_frags, XferDesKind *kind_ret=0, unsigned *bw_ret=0, unsigned *lat_ret=0)
GPU * src_gpu
Definition hip_internal.h:765
virtual bool supports_indirection_memory(Memory mem) const
Queries if a given mem can be used as an indirection buffer.
virtual RemoteChannelInfo * construct_remote_info() const
static const bool is_ordered
Definition hip_internal.h:736
virtual bool needs_wrapping_iterator() const
GPU * get_gpu() const
Definition hip_internal.h:761
Definition hip_internal.h:768
virtual RemoteChannel * create_remote_channel()
bool serialize(S &serializer) const
GPUIndirectRemoteChannelInfo(NodeID _owner, XferDesKind _kind, uintptr_t _remote_ptr, const std::vector< Channel::SupportedPath > &_paths, const std::vector< Memory > &_indirect_memories)
static Serialization::PolymorphicSerdezSubclass< RemoteChannelInfo, GPUIndirectRemoteChannelInfo > serdez_subclass
Definition hip_internal.h:786
static RemoteChannelInfo * deserialize_new(S &deserializer)
Definition hip_internal.h:789
virtual Memory suggest_ib_memories() const
GPUIndirectRemoteChannel(uintptr_t _remote_ptr, const std::vector< Memory > &_indirect_memories)
virtual uint64_t supports_path(ChannelCopyInfo channel_copy_info, CustomSerdezID src_serdez_id, CustomSerdezID dst_serdez_id, ReductionOpID redop_id, size_t total_bytes, const std::vector< size_t > *src_frags, const std::vector< size_t > *dst_frags, XferDesKind *kind_ret, unsigned *bw_ret, unsigned *lat_ret)
virtual bool needs_wrapping_iterator() const
Definition hip_internal.h:636
int read_ind_port_idx
Definition hip_internal.h:651
size_t write_size
Definition hip_internal.h:654
int write_port_idx
Definition hip_internal.h:653
size_t write_ind_size
Definition hip_internal.h:656
int read_port_idx
Definition hip_internal.h:649
size_t read_ind_offset
Definition hip_internal.h:652
XferDes * xd
Definition hip_internal.h:648
size_t read_offset
Definition hip_internal.h:650
virtual void request_completed(void)
size_t read_ind_size
Definition hip_internal.h:652
size_t write_ind_offset
Definition hip_internal.h:656
size_t read_size
Definition hip_internal.h:650
size_t write_offset
Definition hip_internal.h:654
GPUIndirectTransferCompletion(XferDes *_xd, int _read_port_idx, size_t _read_offset, size_t _read_size, int _write_port_idx, size_t _write_offset, size_t _write_size, int _read_ind_port_idx=-1, size_t _read_ind_offset=0, size_t _read_ind_size=0, int _write_ind_port_idx=-1, size_t _write_ind_offset=0, size_t _write_ind_size=0)
int write_ind_port_idx
Definition hip_internal.h:655
Definition hip_internal.h:714
std::vector< GPU * > dst_gpus
Definition hip_internal.h:725
std::vector< bool > dst_is_ipc
Definition hip_internal.h:726
long get_requests(Request **requests, long nr)
GPUIndirectXferDes(uintptr_t _dma_op, Channel *_channel, NodeID _launch_node, XferDesID _guid, const std::vector< XferDesPortInfo > &inputs_info, const std::vector< XferDesPortInfo > &outputs_info, int _priority, XferDesRedopInfo _redop_info)
bool progress_xd(GPUIndirectChannel *channel, TimeLimit work_until)
std::vector< GPU * > src_gpus
Definition hip_internal.h:725
Definition hip_internal.h:109
GPUPreemptionWaiter(GPU *gpu)
virtual ~GPUPreemptionWaiter(void)
Definition hip_internal.h:112
virtual void request_completed(void)
Definition hip_internal.h:441
ContextSynchronizer ctxsync
Definition hip_internal.h:474
void gpu_memcpy_async(void *dst, const void *src, size_t size, hipMemcpyKind kind, hipStream_t stream)
void gpu_memset(void *dst, int value, size_t count)
virtual void shutdown(void)
void gpu_memset_async(void *dst, int value, size_t count, hipStream_t stream)
virtual bool register_task(Processor::TaskFuncID func_id, CodeDescriptor &codedesc, const ByteArrayRef &user_data)
GPUProcessor(RuntimeImpl *runtime_impl, GPU *_gpu, Processor _me, Realm::CoreReservationSet &crs, size_t _stack_size)
void gpu_memcpy(void *dst, const void *src, size_t size, hipMemcpyKind kind)
static GPUProcessor * get_current_gpu_proc(void)
virtual ~GPUProcessor(void)
void stream_synchronize(hipStream_t stream)
virtual void execute_task(Processor::TaskFuncID func_id, const ByteArrayRef &task_args)
bool block_on_synchronize
Definition hip_internal.h:473
void stream_wait_on_event(hipStream_t stream, hipEvent_t event)
GPU * gpu
Definition hip_internal.h:471
void device_synchronize(void)
std::map< Processor::TaskFuncID, GPUTaskTableEntry > gpu_task_table
Definition hip_internal.h:487
Realm::CoreReservation * core_rsrv
Definition hip_internal.h:477
Definition hip_internal.h:977
virtual void chunk_destroyed(void *base, size_t bytes)
virtual void chunk_created(void *base, size_t bytes)
GPUReplHeapListener(HipModule *_module)
Definition hip_internal.h:627
void * dst_base
Definition hip_internal.h:630
const void * src_base
Definition hip_internal.h:629
GPUCompletionEvent event
Definition hip_internal.h:633
GPU * dst_gpu
Definition hip_internal.h:632
Definition hip_internal.h:167
void add_fence(GPUWorkFence *fence)
void add_start_event(GPUWorkStart *start)
GPUWorker * worker
Definition hip_internal.h:201
std::deque< PendingEvent > pending_events
Definition hip_internal.h:216
void add_event(hipEvent_t event, GPUWorkFence *fence, GPUCompletionNotification *notification=NULL, GPUWorkStart *start=NULL)
bool has_work(void) const
GPU * gpu
Definition hip_internal.h:200
void add_notification(GPUCompletionNotification *notification)
bool reap_events(TimeLimit work_until)
hipStream_t stream
Definition hip_internal.h:203
Mutex mutex
Definition hip_internal.h:205
void wait_on_streams(const std::set< GPUStream * > &other_streams)
GPUStream(GPU *_gpu, GPUWorker *_worker, int rel_priority=0)
REALM_INTERNAL_API_EXTERNAL_LINKAGE hipStream_t get_stream(void) const
bool ok_to_submit_copy(size_t bytes, XferDes *xd)
GPU * get_gpu(void) const
Definition hip_internal.h:659
int write_port_idx
Definition hip_internal.h:671
size_t read_offset
Definition hip_internal.h:670
size_t write_offset
Definition hip_internal.h:672
XferDes * xd
Definition hip_internal.h:668
virtual void request_completed(void)
int read_port_idx
Definition hip_internal.h:669
size_t write_size
Definition hip_internal.h:672
size_t read_size
Definition hip_internal.h:670
GPUTransferCompletion(XferDes *_xd, int _read_port_idx, size_t _read_offset, size_t _read_size, int _write_port_idx, size_t _write_offset, size_t _write_size)
Definition hip_internal.h:125
virtual void request_cancellation(void)
virtual void print(std::ostream &os) const
static void cuda_callback(hipStream_t stream, hipError_t res, void *data)
IntrusiveListLink< GPUWorkFence > fence_list_link
Definition hip_internal.h:137
GPUWorkFence(Realm::Operation *op)
virtual void mark_finished(bool successful)
IntrusiveList< GPUWorkFence, REALM_PMTA_USE(GPUWorkFence, fence_list_link), DummyLock > FenceList
Definition hip_internal.h:141
void enqueue_on_stream(GPUStream *stream)
REALM_PMTA_DEFN(GPUWorkFence, IntrusiveListLink< GPUWorkFence >, fence_list_link)
Definition hip_internal.h:147
void mark_gpu_work_start()
virtual void request_cancellation(void)
Definition hip_internal.h:151
void enqueue_on_stream(GPUStream *stream)
static void cuda_start_callback(hipStream_t stream, hipError_t res, void *data)
GPUWorkStart(Realm::Operation *op)
virtual void print(std::ostream &os) const
Definition hip_internal.h:223
Realm::CoreReservation * core_rsrv
Definition hip_internal.h:254
CircularQueue< GPUStream *, 16 > ActiveStreamQueue
Definition hip_internal.h:250
atomic< bool > worker_shutdown_requested
Definition hip_internal.h:257
bool thread_sleeping
Definition hip_internal.h:256
void start_background_thread(Realm::CoreReservationSet &crs, size_t stack_size)
ActiveStreamQueue active_streams
Definition hip_internal.h:251
bool do_work(TimeLimit work_until)
Mutex::CondVar condvar
Definition hip_internal.h:248
Mutex lock
Definition hip_internal.h:247
void shutdown_background_thread(void)
Realm::Thread * worker_thread
Definition hip_internal.h:255
void add_stream(GPUStream *s)
bool process_streams(bool sleep_on_empty)
Definition hip_internal.h:697
GPUXferDes(uintptr_t _dma_op, Channel *_channel, NodeID _launch_node, XferDesID _guid, const std::vector< XferDesPortInfo > &inputs_info, const std::vector< XferDesPortInfo > &outputs_info, int _priority)
bool progress_xd(GPUChannel *channel, TimeLimit work_until)
long get_requests(Request **requests, long nr)
Definition hip_internal.h:576
virtual bool attempt_register_external_resource(RegionInstanceImpl *inst, size_t &inst_offset)
char * cpu_base
Definition hip_internal.h:603
virtual void put_bytes(off_t offset, const void *src, size_t size)
char * gpu_base
Definition hip_internal.h:602
GPUZCMemory(RuntimeImpl *_runtime_impl, Memory _me, char *_gpu_base, void *_cpu_base, size_t _size, MemoryKind _kind, Memory::Kind _lowlevel_kind)
NetworkSegment local_segment
Definition hip_internal.h:604
virtual ExternalInstanceResource * generate_resource_info(RegionInstanceImpl *inst, const IndexSpaceGeneric *subspace, span< const FieldID > fields, bool read_only)
virtual void * get_direct_ptr(off_t offset, size_t size)
virtual void unregister_external_resource(RegionInstanceImpl *inst)
virtual ~GPUZCMemory(void)
virtual void get_bytes(off_t offset, void *dst, size_t size)
Definition hip_internal.h:314
int device_id
Definition hip_internal.h:362
GPUStream * find_stream(hipStream_t stream) const
std::vector< HipIpcMapping > hipipc_mappings
Definition hip_internal.h:423
GPUDynamicFBMemory * fb_dmem
Definition hip_internal.h:358
GPUProcessor * proc
Definition hip_internal.h:356
char * fb_ibmem_base
Definition hip_internal.h:390
std::set< Memory > pinned_sysmems
Definition hip_internal.h:393
hipModule_t load_hip_module(const void *data)
const HipIpcMapping * find_ipc_mapping(Memory mem) const
atomic< unsigned > next_d2d_stream
Definition hip_internal.h:409
GPUInfo * info
Definition hip_internal.h:354
GPUStream * device_to_device_stream
Definition hip_internal.h:404
GPUFuncInfo fill_affine_large_kernels[REALM_MAX_DIM][HIP_MEMCPY_KERNEL_MAX2_LOG2_BYTES]
Definition hip_internal.h:383
GPUFuncInfo batch_affine_fill_kernels[REALM_MAX_DIM][HIP_MEMCPY_KERNEL_MAX2_LOG2_BYTES]
Definition hip_internal.h:381
static const size_t HIP_MEMCPY_KERNEL_MAX2_LOG2_BYTES
Definition hip_internal.h:377
int greatest_stream_priority
Definition hip_internal.h:415
void launch_batch_affine_kernel(void *copy_info, size_t dim, size_t elemSize, size_t volume, GPUStream *stream, size_t arg_size)
atomic< unsigned > next_task_stream
Definition hip_internal.h:408
void create_dma_channels(Realm::RuntimeImpl *r)
char * fbmem_base
Definition hip_internal.h:388
std::vector< GPUStream * > peer_to_peer_streams
Definition hip_internal.h:406
std::set< Memory > peer_fbs
Definition hip_internal.h:399
bool is_accessible_gpu_mem(const MemoryImpl *mem) const
int least_stream_priority
Definition hip_internal.h:415
void create_fb_memory(RuntimeImpl *runtime, size_t size, size_t ib_size)
GPUWorker * worker
Definition hip_internal.h:355
bool can_access_peer(const GPU *peer) const
GPUFuncInfo transpose_kernels[HIP_MEMCPY_KERNEL_MAX2_LOG2_BYTES]
Definition hip_internal.h:386
REALM_INTERNAL_API_EXTERNAL_LINKAGE GPUStream * get_null_task_stream(void) const
std::vector< GPUStream * > device_to_device_streams
Definition hip_internal.h:405
GPUFBMemory * fbmem
Definition hip_internal.h:357
void launch_transpose_kernel(MemcpyTransposeInfo< size_t > ©_info, size_t elemSize, GPUStream *stream)
std::vector< GPUStream * > task_streams
Definition hip_internal.h:407
GPUEventPool event_pool
Definition hip_internal.h:411
GPU(HipModule *_module, GPUInfo *_info, GPUWorker *worker, int _device_id)
GPUFuncInfo indirect_copy_kernels[REALM_MAX_DIM][HIP_MEMCPY_KERNEL_MAX2_LOG2_BYTES][HIP_MEMCPY_KERNEL_MAX2_LOG2_BYTES]
Definition hip_internal.h:385
void launch_indirect_copy_kernel(void *copy_info, size_t dim, size_t addr_size, size_t field_size, size_t volume, size_t arg_size, GPUStream *stream)
GPUFuncInfo batch_affine_kernels[REALM_MAX_DIM][HIP_MEMCPY_KERNEL_MAX2_LOG2_BYTES]
Definition hip_internal.h:379
GPUStream * device_to_host_stream
Definition hip_internal.h:403
void launch_batch_affine_fill_kernel(void *fill_info, size_t dim, size_t elem_size, size_t volume, size_t arg_size, GPUStream *stream)
GPUStream * host_to_device_stream
Definition hip_internal.h:402
hipModule_t device_module
Definition hip_internal.h:363
void create_dynamic_fb_memory(RuntimeImpl *runtime, size_t max_size)
GPUStream * get_next_d2d_stream()
void create_processor(RuntimeImpl *runtime, size_t stack_size)
std::map< NodeID, GPUStream * > hipipc_streams
Definition hip_internal.h:424
bool is_accessible_host_mem(const MemoryImpl *mem) const
GPUFBIBMemory * fb_ibmem
Definition hip_internal.h:359
GPUStream * get_next_task_stream(bool create=false)
std::set< Memory > managed_mems
Definition hip_internal.h:396
Definition hip_internal.h:847
GPU * gpu
Definition hip_internal.h:867
virtual XferDes * create_xfer_des(uintptr_t dma_op, NodeID launch_node, XferDesID guid, const std::vector< XferDesPortInfo > &inputs_info, const std::vector< XferDesPortInfo > &outputs_info, int priority, XferDesRedopInfo redop_info, const void *fill_data, size_t fill_size, size_t fill_total)
long submit(Request **requests, long nr)
GPUfillChannel(GPU *_gpu, BackgroundWorkManager *bgwork)
static const bool is_ordered
Definition hip_internal.h:852
Definition hip_internal.h:832
GPUfillXferDes(uintptr_t _dma_op, Channel *_channel, NodeID _launch_node, XferDesID _guid, const std::vector< XferDesPortInfo > &inputs_info, const std::vector< XferDesPortInfo > &outputs_info, int _priority, const void *_fill_data, size_t _fill_size, size_t _fill_total)
bool progress_xd(GPUfillChannel *channel, TimeLimit work_until)
size_t reduced_fill_size
Definition hip_internal.h:844
long get_requests(Request **requests, long nr)
Definition hip_internal.h:901
long submit(Request **requests, long nr)
virtual XferDes * create_xfer_des(uintptr_t dma_op, NodeID launch_node, XferDesID guid, const std::vector< XferDesPortInfo > &inputs_info, const std::vector< XferDesPortInfo > &outputs_info, int priority, XferDesRedopInfo redop_info, const void *fill_data, size_t fill_size, size_t fill_total)
GPUreduceChannel(GPU *_gpu, BackgroundWorkManager *bgwork)
static const bool is_ordered
Definition hip_internal.h:906
virtual RemoteChannelInfo * construct_remote_info() const
GPU * gpu
Definition hip_internal.h:925
virtual bool supports_redop(ReductionOpID redop_id) const
Definition hip_internal.h:928
static Serialization::PolymorphicSerdezSubclass< RemoteChannelInfo, GPUreduceRemoteChannelInfo > serdez_subclass
Definition hip_internal.h:944
static RemoteChannelInfo * deserialize_new(S &deserializer)
virtual RemoteChannel * create_remote_channel()
GPUreduceRemoteChannelInfo(NodeID _owner, XferDesKind _kind, uintptr_t _remote_ptr, const std::vector< Channel::SupportedPath > &_paths)
bool serialize(S &serializer) const
Definition hip_internal.h:947
Definition hip_internal.h:871
std::vector< GPU * > src_gpus
Definition hip_internal.h:897
void * kernel_host_proxy
Definition hip_internal.h:893
void * kernel_host_proxy_transpose
Definition hip_internal.h:895
bool progress_xd(GPUreduceChannel *channel, TimeLimit work_until)
long get_requests(Request **requests, long nr)
GPUreduceXferDes(uintptr_t _dma_op, Channel *_channel, NodeID _launch_node, XferDesID _guid, const std::vector< XferDesPortInfo > &inputs_info, const std::vector< XferDesPortInfo > &outputs_info, int _priority, XferDesRedopInfo _redop_info)
XferDesRedopInfo redop_info
Definition hip_internal.h:891
GPUStream * stream
Definition hip_internal.h:896
bool fast_reduction_kernel_mode(GPUreduceChannel *channel, size_t max_bytes, XferPort *in_port, XferPort *out_port, size_t in_span_start, size_t out_span_start)
const ReductionOpUntyped * redop
Definition hip_internal.h:892
void setup_redop_kernel(GPUreduceChannel *channel, void *redop_args, const size_t in_span_start, const size_t out_span_start, const size_t in_elem_size, const size_t out_elem_size, const size_t elems, const bool has_transpose)
void * describe_kernel_variant(bool is_advanced)
void * kernel_host_proxy_advanced
Definition hip_internal.h:894
std::vector< bool > src_is_ipc
Definition hip_internal.h:898
Definition hip_internal.h:495
HipDeviceMemoryInfo(int _device_id)
GPU * gpu
Definition hip_internal.h:500
int device_id
Definition hip_internal.h:499
Definition hip_module.h:165
Definition hip_internal.h:674
virtual ~MemSpecificHipArray()
MemSpecificHipArray(hipArray_t _array)
hipArray_t array
Definition hip_internal.h:679
Definition ib_memory.h:54
Definition indexspace.h:1115
Definition inst_layout.h:267
Definition mem_impl.h:344
Definition proc_impl.h:141
Definition mem_impl.h:212
MemoryKind
Definition mem_impl.h:53
size_t size
Definition mem_impl.h:195
AllocationResult
Definition mem_impl.h:89
Kind
Definition memory.h:59
Definition operation.h:75
Operation * op
Definition operation.h:87
Definition operation.h:32
Definition processor.h:37
::realm_task_func_id_t TaskFuncID
Definition processor.h:58
Definition inst_impl.h:54
Definition repl_heap.h:50
Definition runtime_impl.h:267
Definition serialize.h:363
Definition channel.h:1018
Channel * channel
Definition channel.h:342
#define REALM_INTERNAL_API_EXTERNAL_LINKAGE
Definition compiler_support.h:218
#define REALM_PMTA_USE(structtype, name)
Definition lists.h:42
GPUMemcpyKind
Definition hip_internal.h:80
@ GPU_MEMCPY_HOST_TO_DEVICE
Definition hip_internal.h:81
@ GPU_MEMCPY_PEER_TO_PEER
Definition hip_internal.h:84
@ GPU_MEMCPY_DEVICE_TO_HOST
Definition hip_internal.h:82
@ GPU_MEMCPY_DEVICE_TO_DEVICE
Definition hip_internal.h:83
HipModule * hip_module_singleton
Definition activemsg.h:42
int NodeID
Definition nodeset.h:40
XferDesKind
Definition channel.h:84
int CustomSerdezID
Definition custom_serdez.h:148
unsigned long long XferDesID
Definition channel.h:56
::realm_reduction_op_id_t ReductionOpID
Definition event.h:38
#define REALM_MAX_DIM
Definition realm_config.h:34
Definition hip_internal.h:67
size_t totalGlobalMem
Definition hip_internal.h:75
int major
Definition hip_internal.h:74
int index
Definition hip_internal.h:68
std::set< hipDevice_t > peers
Definition hip_internal.h:76
static const size_t MAX_NAME_LEN
Definition hip_internal.h:71
char name[MAX_NAME_LEN]
Definition hip_internal.h:72
int minor
Definition hip_internal.h:74
hipDevice_t device
Definition hip_internal.h:69
Definition hip_internal.h:479
Hip::StreamAwareTaskFuncPtr stream_aware_fnptr
Definition hip_internal.h:481
ByteArray user_data
Definition hip_internal.h:482
Processor::TaskFuncPtr fnptr
Definition hip_internal.h:480
Definition hip_internal.h:207
GPUCompletionNotification * notification
Definition hip_internal.h:211
GPUWorkFence * fence
Definition hip_internal.h:209
GPUWorkStart * start
Definition hip_internal.h:210
hipEvent_t event
Definition hip_internal.h:208
Definition hip_internal.h:365
hipFunction_t func
Definition hip_internal.h:366
int occ_num_blocks
Definition hip_internal.h:368
int occ_num_threads
Definition hip_internal.h:367
Definition hip_internal.h:417
NodeID owner
Definition hip_internal.h:418
uintptr_t local_base
Definition hip_internal.h:420
Memory mem
Definition hip_internal.h:419
uintptr_t address_offset
Definition hip_internal.h:421
Definition hip_internal.h:971
static void handle_message(NodeID sender, const HipIpcRelease &args, const void *data, size_t datalen)
Definition hip_internal.h:955
static void handle_message(NodeID sender, const HipIpcRequest &args, const void *data, size_t datalen)
Definition hip_internal.h:964
unsigned count
Definition hip_internal.h:965
static void handle_message(NodeID sender, const HipIpcResponse &args, const void *data, size_t datalen)
Definition hip_memcpy.h:109
NodeID src
Definition ucp_internal.h:1