Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
hip_internal.h
Go to the documentation of this file.
1/*
2 * Copyright 2026 Stanford University, NVIDIA Corporation, Los Alamos National Laboratory
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef REALM_HIP_INTERNAL_H
19#define REALM_HIP_INTERNAL_H
20
22
23#include <hip/hip_runtime.h>
24
25#include "realm/operation.h"
26#include "realm/threads.h"
27#include "realm/circ_queue.h"
28#include "realm/indexspace.h"
29#include "realm/proc_impl.h"
30#include "realm/mem_impl.h"
31#include "realm/bgwork.h"
35#include "realm/hip/hip_reduc.h"
36
37#define CHECK_CUDART(cmd) \
38 do { \
39 hipError_t ret = (cmd); \
40 if(ret != hipSuccess) { \
41 fprintf(stderr, "HIP: %s = %d (%s)\n", #cmd, ret, hipGetErrorString(ret)); \
42 assert(0); \
43 exit(1); \
44 } \
45 } while(0)
46
47#define REPORT_HIP_ERROR(cmd, ret) \
48 do { \
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); \
53 abort(); \
54 } while(0)
55
56#define CHECK_HIP(cmd) \
57 do { \
58 hipError_t ret = (cmd); \
59 if(ret != hipSuccess) \
60 REPORT_HIP_ERROR(#cmd, ret); \
61 } while(0)
62
63namespace Realm {
64
65 namespace Hip {
66
67 struct GPUInfo {
68 int index; // index used by HIP runtime
69 hipDevice_t device;
70
71 static const size_t MAX_NAME_LEN = 64;
73
76 std::set<hipDevice_t> peers; // other GPUs we can do p2p copies with
77 };
78
86
87 // Forard declaration
88 class GPUProcessor;
89 class GPUWorker;
90 class GPUStream;
91 class GPUFBMemory;
92 class GPUDynamicFBMemory;
93 class GPUZCMemory;
94 class GPUFBIBMemory;
95 class GPU;
96 class HipModule;
97
98 extern HipModule *hip_module_singleton;
99
100 // an interface for receiving completion notification for a GPU operation
101 // (right now, just copies)
103 public:
105
106 virtual void request_completed(void) = 0;
107 };
108
110 public:
112 virtual ~GPUPreemptionWaiter(void) {}
113
114 public:
115 virtual void request_completed(void);
116
117 public:
118 void preempt(void);
119
120 private:
121 GPU *const gpu;
122 Event wait_event;
123 };
124
126 public:
128
129 virtual void mark_finished(bool successful);
130
131 virtual void request_cancellation(void);
132
134
135 virtual void print(std::ostream &os) const;
136
140 DummyLock>
142
143 protected:
144 static void cuda_callback(hipStream_t stream, hipError_t res, void *data);
145 };
146
148 public:
150
151 virtual void request_cancellation(void) { return; };
152
154
155 virtual void print(std::ostream &os) const;
156
158
159 protected:
160 static void cuda_start_callback(hipStream_t stream, hipError_t res, void *data);
161 };
162
163 // a class that represents a HIP stream and work associated with
164 // it (e.g. queued copies, events in flight)
165 // a stream is also associated with a GPUWorker that it will register
166 // with when async work needs doing
167 class GPUStream {
168 public:
169 GPUStream(GPU *_gpu, GPUWorker *_worker, int rel_priority = 0);
171
172 GPU *get_gpu(void) const;
174 get_stream(void) const; // needed by librealm_kokkos.so
175
176 // may be called by anybody to enqueue a copy or an event
180 void wait_on_streams(const std::set<GPUStream *> &other_streams);
181
182 // atomically checks rate limit counters and returns true if 'bytes'
183 // worth of copies can be submitted or false if not (in which case
184 // the progress counter on the xd will be updated when it should try
185 // again)
186 bool ok_to_submit_copy(size_t bytes, XferDes *xd);
187
188 // to be called by a worker (that should already have the GPU context
189 // current) - returns true if any work remains
190 bool reap_events(TimeLimit work_until);
191
192 protected:
193 // may only be tested with lock held
194 bool has_work(void) const;
195
196 void add_event(hipEvent_t event, GPUWorkFence *fence,
197 GPUCompletionNotification *notification = NULL,
198 GPUWorkStart *start = NULL);
199
202
203 hipStream_t stream;
204
206
213#ifdef USE_CQ
215#else
216 std::deque<PendingEvent> pending_events;
217#endif
218 };
219
220 // a GPUWorker is responsible for making progress on one or more GPUStreams -
221 // this may be done directly by a GPUProcessor or in a background thread
222 // spawned for the purpose
224 public:
226 virtual ~GPUWorker(void);
227
228 // adds a stream that has work to be done
230
231 // used to start a dedicate thread (mutually exclusive with being
232 // registered with a background work manager)
235
236 bool do_work(TimeLimit work_until);
237
238 public:
239 void thread_main(void);
240
241 protected:
242 // used by the background thread
243 // processes work on streams, optionally sleeping for work to show up
244 // returns true if work remains to be done
245 bool process_streams(bool sleep_on_empty);
246
249
252
253 // used by the background thread (if any)
258 };
259
260 // a little helper class to manage a pool of CUevents that can be reused
261 // to reduce alloc/destroy overheads
263 public:
264 GPUEventPool(int _batch_size = 256);
265
266 // allocating the initial batch of events and cleaning up are done with
267 // these methods instead of constructor/destructor because we don't
268 // manage the GPU context in this helper class
269 void init_pool(int init_size = 0 /* default == batch size */);
270 void empty_pool(void);
271
272 hipEvent_t get_event(bool external = false);
273 void return_event(hipEvent_t e, bool external = false);
274
275 protected:
278 std::vector<hipEvent_t> available_events;
279 };
280
281 // when the runtime hijack is not enabled/active, a cuCtxSynchronize
282 // is required to ensure a task's completion event covers all of its
283 // actions - rather than blocking an important thread, we create a
284 // small thread pool to handle these
286 public:
287 ContextSynchronizer(GPU *_gpu, int _device_id, CoreReservationSet &crs,
288 int _max_threads);
290
292
294
296
297 protected:
299 // hipCtx_t context;
307 std::vector<Thread *> worker_threads;
309 };
310
311 // a GPU object represents our use of a given HIP-capable GPU - this will
312 // have an associated HIP context, a (possibly shared) worker thread, a
313 // processor, and an FB memory (the ZC memory is shared across all GPUs)
314 class GPU {
315 public:
316 GPU(HipModule *_module, GPUInfo *_info, GPUWorker *worker, int _device_id);
317 ~GPU(void);
318
319 void push_context(void);
320 void pop_context(void);
321
322 void create_processor(RuntimeImpl *runtime, size_t stack_size);
323 void create_fb_memory(RuntimeImpl *runtime, size_t size, size_t ib_size);
324 void create_dynamic_fb_memory(RuntimeImpl *runtime, size_t max_size);
325
327
328 bool can_access_peer(const GPU *peer) const;
329
330 GPUStream *find_stream(hipStream_t stream) const;
332 get_null_task_stream(void) const; // needed by librealm_kokkos.so
333 GPUStream *get_next_task_stream(bool create = false);
335 void launch_batch_affine_kernel(void *copy_info, size_t dim, size_t elemSize,
336 size_t volume, GPUStream *stream, size_t arg_size);
337 void launch_batch_affine_fill_kernel(void *fill_info, size_t dim, size_t elem_size,
338 size_t volume, size_t arg_size,
339 GPUStream *stream);
341 size_t elemSize, GPUStream *stream);
342
343 void launch_indirect_copy_kernel(void *copy_info, size_t dim, size_t addr_size,
344 size_t field_size, size_t volume, size_t arg_size,
345 GPUStream *stream);
346 bool is_accessible_host_mem(const MemoryImpl *mem) const;
347 bool is_accessible_gpu_mem(const MemoryImpl *mem) const;
348
349 protected:
350 hipModule_t load_hip_module(const void *data);
351
352 public:
353 HipModule *module = nullptr;
354 GPUInfo *info = nullptr;
355 GPUWorker *worker = nullptr;
356 GPUProcessor *proc = nullptr;
357 GPUFBMemory *fbmem = nullptr;
360
361 // hipCtx_t context;
362 int device_id = -1;
363 hipModule_t device_module = nullptr;
364
365 struct GPUFuncInfo {
366 hipFunction_t func;
369 };
370
371 // The maximum value of log2(type_bytes) that hip kernels handle.
372 // log2(1 byte) --> 0
373 // log2(2 bytes) --> 1
374 // log2(4 bytes) --> 2
375 // log2(8 bytes) --> 3
376 // log2(16 bytes) --> 4
377 static const size_t HIP_MEMCPY_KERNEL_MAX2_LOG2_BYTES = 5;
378
387
388 char *fbmem_base = nullptr;
389
390 char *fb_ibmem_base = nullptr;
391
392 // which system memories have been registered and can be used for cuMemcpyAsync
393 std::set<Memory> pinned_sysmems;
394
395 // managed memories we can concurrently access
396 std::set<Memory> managed_mems;
397
398 // which other FBs we have peer access to
399 std::set<Memory> peer_fbs;
400
401 // streams for different copy types and a pile for actual tasks
405 std::vector<GPUStream *> device_to_device_streams;
406 std::vector<GPUStream *> peer_to_peer_streams; // indexed by target
407 std::vector<GPUStream *> task_streams;
410
412
413 // this can technically be different in each context (but probably isn't
414 // in practice)
416
420 uintptr_t local_base;
421 uintptr_t address_offset; // add to convert from original to local base
422 };
423 std::vector<HipIpcMapping> hipipc_mappings;
424 std::map<NodeID, GPUStream *> hipipc_streams;
425
427 };
428
429 // helper to push/pop a GPU's context by scope
431 public:
435
436 protected:
438 };
439
440 class REALM_INTERNAL_API_EXTERNAL_LINKAGE GPUProcessor // needed by librealm_kokkos.so
442 public:
443 GPUProcessor(RuntimeImpl *runtime_impl, GPU *_gpu, Processor _me,
444 Realm::CoreReservationSet &crs, size_t _stack_size);
445 virtual ~GPUProcessor(void);
446
447 public:
448 virtual bool register_task(Processor::TaskFuncID func_id, CodeDescriptor &codedesc,
449 const ByteArrayRef &user_data);
450
451 virtual void shutdown(void);
452
453 protected:
455 const ByteArrayRef &task_args);
456
457 public:
459
460 void stream_wait_on_event(hipStream_t stream, hipEvent_t event);
461 void stream_synchronize(hipStream_t stream);
463
464 void gpu_memcpy(void *dst, const void *src, size_t size, hipMemcpyKind kind);
465 void gpu_memcpy_async(void *dst, const void *src, size_t size, hipMemcpyKind kind,
466 hipStream_t stream);
467 void gpu_memset(void *dst, int value, size_t count);
468 void gpu_memset_async(void *dst, int value, size_t count, hipStream_t stream);
469
470 public:
472
475
476 protected:
478
480 Processor::TaskFuncPtr fnptr;
481 Hip::StreamAwareTaskFuncPtr stream_aware_fnptr;
483 };
484
485 // we're not using the parent's task table, but we can use the mutex
486 // RWLock task_table_mutex;
487 std::map<Processor::TaskFuncID, GPUTaskTableEntry> gpu_task_table;
488 };
489
490 // this can be attached to any MemoryImpl if the underlying memory is
491 // guaranteed to belong to a given device - this will allow that
492 // context's processor and dma channels to work with it
493 // the creator is expected to know what device they want but need
494 // not know which GPU object that corresponds to
496 public:
497 HipDeviceMemoryInfo(int _device_id);
498
501 };
502
504 public:
505 GPUFBMemory(RuntimeImpl *_runtime_impl, Memory _me, GPU *_gpu, char *_base,
506 size_t _size);
507
508 virtual ~GPUFBMemory(void);
509
510 // these work, but they are SLOW
511 virtual void get_bytes(off_t offset, void *dst, size_t size);
512 virtual void put_bytes(off_t offset, const void *src, size_t size);
513
514 virtual void *get_direct_ptr(off_t offset, size_t size);
515
516 // GPUFBMemory supports ExternalHipMemoryResource and
517 // ExternalHipArrayResource (not implemented)
519 size_t &inst_offset);
521
522 // for re-registration purposes, generate an ExternalInstanceResource *
523 // (if possible) for a given instance, or a subset of one
526 span<const FieldID> fields, bool read_only);
527
528 public:
530 char *base;
532 };
533
535 public:
536 GPUDynamicFBMemory(RuntimeImpl *_runtime_impl, Memory _me, GPU *_gpu,
537 size_t _max_size);
538
539 virtual ~GPUDynamicFBMemory(void);
540 void cleanup(void);
541
542 // deferred allocation not supported
544 bool need_alloc_result,
545 bool poisoned,
546 TimeLimit work_until);
547
548 virtual void release_storage_immediate(RegionInstanceImpl *inst, bool poisoned,
549 TimeLimit work_until);
550
551 // these work, but they are SLOW
552 virtual void get_bytes(off_t offset, void *dst, size_t size);
553 virtual void put_bytes(off_t offset, const void *src, size_t size);
554
555 virtual void *get_direct_ptr(off_t offset, size_t size);
556
557 // GPUDynamicFBMemory supports ExternalHipMemoryResource and
558 // ExternalHipArrayResource (not implemented)
560 size_t &inst_offset);
562
563 // for re-registration purposes, generate an ExternalInstanceResource *
564 // (if possible) for a given instance, or a subset of one
567 span<const FieldID> fields, bool read_only);
568
569 public:
572 size_t cur_size;
573 std::map<RegionInstance, std::pair<void *, size_t>> alloc_bases;
574 };
575
577 public:
578 GPUZCMemory(RuntimeImpl *_runtime_impl, Memory _me, char *_gpu_base,
579 void *_cpu_base, size_t _size, MemoryKind _kind,
580 Memory::Kind _lowlevel_kind);
581
582 virtual ~GPUZCMemory(void);
583
584 virtual void get_bytes(off_t offset, void *dst, size_t size);
585
586 virtual void put_bytes(off_t offset, const void *src, size_t size);
587
588 virtual void *get_direct_ptr(off_t offset, size_t size);
589
590 // GPUZCMemory supports ExternalHipPinnedHostResource
592 size_t &inst_offset);
594
595 // for re-registration purposes, generate an ExternalInstanceResource *
596 // (if possible) for a given instance, or a subset of one
599 span<const FieldID> fields, bool read_only);
600
601 public:
602 char *gpu_base;
603 char *cpu_base;
605 };
606
607 class GPUFBIBMemory : public IBMemory {
608 public:
609 GPUFBIBMemory(RuntimeImpl *_runtime_impl, Memory _me, GPU *_gpu, char *_base,
610 size_t _size);
611
612 public:
614 char *base;
616 };
617
618 class GPURequest;
619
621 public:
623
625 };
626
627 class GPURequest : public Request {
628 public:
629 const void *src_base;
630 void *dst_base;
631 // off_t src_gpu_off, dst_gpu_off;
634 };
635
637 public:
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);
644
645 virtual void request_completed(void);
646
647 protected:
657 };
658
660 public:
661 GPUTransferCompletion(XferDes *_xd, int _read_port_idx, size_t _read_offset,
662 size_t _read_size, int _write_port_idx, size_t _write_offset,
663 size_t _write_size);
664
665 virtual void request_completed(void);
666
667 protected:
673 };
675 public:
676 MemSpecificHipArray(hipArray_t _array);
678
679 hipArray_t array;
680 };
681
683 public:
684 virtual int set_rect(const RegionInstanceImpl *inst,
685 const InstanceLayoutPieceBase *piece, size_t field_size,
686 size_t field_offset, int ndims, const int64_t lo[/*ndims*/],
687 const int64_t hi[/*ndims*/], const int order[/*ndims*/]);
688
689 hipArray_t array;
690 int dim;
691 size_t pos[3];
693 };
694
695 class GPUChannel;
696
697 class GPUXferDes : public XferDes {
698 public:
699 GPUXferDes(uintptr_t _dma_op, Channel *_channel, NodeID _launch_node,
700 XferDesID _guid, const std::vector<XferDesPortInfo> &inputs_info,
701 const std::vector<XferDesPortInfo> &outputs_info, int _priority);
702
703 long get_requests(Request **requests, long nr);
704
706
707 private:
708 std::vector<GPU *> src_gpus, dst_gpus;
709 std::vector<bool> dst_is_ipc;
710 };
711
712 class GPUIndirectChannel;
713
715 public:
716 GPUIndirectXferDes(uintptr_t _dma_op, Channel *_channel, NodeID _launch_node,
717 XferDesID _guid, const std::vector<XferDesPortInfo> &inputs_info,
718 const std::vector<XferDesPortInfo> &outputs_info, int _priority,
719 XferDesRedopInfo _redop_info);
720
721 long get_requests(Request **requests, long nr);
723
724 protected:
725 std::vector<GPU *> src_gpus, dst_gpus;
726 std::vector<bool> dst_is_ipc;
727 };
728
730 : public SingleXDQChannel<GPUIndirectChannel, GPUIndirectXferDes> {
731 public:
734
735 // multi-threading of copies for a given device is disabled by
736 static const bool is_ordered = true;
737
738 virtual bool needs_wrapping_iterator() const;
740
742
743 virtual uint64_t
744 supports_path(ChannelCopyInfo channel_copy_info, CustomSerdezID src_serdez_id,
745 CustomSerdezID dst_serdez_id, ReductionOpID redop_id,
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);
749
750 virtual bool supports_indirection_memory(Memory mem) const;
751
752 virtual XferDes *create_xfer_des(uintptr_t dma_op, NodeID launch_node,
753 XferDesID guid,
754 const std::vector<XferDesPortInfo> &inputs_info,
755 const std::vector<XferDesPortInfo> &outputs_info,
756 int priority, XferDesRedopInfo redop_info,
757 const void *fill_data, size_t fill_size,
758 size_t fill_total);
759
760 long submit(Request **requests, long nr);
761 GPU *get_gpu() const { return src_gpu; }
762
763 protected:
764 friend class GPUIndirectXferDes;
766 };
767
769 public:
771 uintptr_t _remote_ptr,
772 const std::vector<Channel::SupportedPath> &_paths,
773 const std::vector<Memory> &_indirect_memories);
774
776
777 template <typename S>
778 bool serialize(S &serializer) const;
779
780 template <typename S>
781 static RemoteChannelInfo *deserialize_new(S &deserializer);
782
783 protected:
787 };
788
791
792 public:
793 GPUIndirectRemoteChannel(uintptr_t _remote_ptr,
794 const std::vector<Memory> &_indirect_memories);
796 virtual bool needs_wrapping_iterator() const;
797 virtual uint64_t
798 supports_path(ChannelCopyInfo channel_copy_info, CustomSerdezID src_serdez_id,
799 CustomSerdezID dst_serdez_id, ReductionOpID redop_id,
800 size_t total_bytes, const std::vector<size_t> *src_frags,
801 const std::vector<size_t> *dst_frags, XferDesKind *kind_ret /*= 0*/,
802 unsigned *bw_ret /*= 0*/, unsigned *lat_ret /*= 0*/);
803 };
804
805 class GPUChannel : public SingleXDQChannel<GPUChannel, GPUXferDes> {
806 public:
809
810 // multi-threading of cuda copies for a given device is disabled by
811 // default (can be re-enabled with -cuda:mtdma 1)
812 static const bool is_ordered = true;
813
814 virtual XferDes *create_xfer_des(uintptr_t dma_op, NodeID launch_node,
815 XferDesID guid,
816 const std::vector<XferDesPortInfo> &inputs_info,
817 const std::vector<XferDesPortInfo> &outputs_info,
818 int priority, XferDesRedopInfo redop_info,
819 const void *fill_data, size_t fill_size,
820 size_t fill_total);
821
822 long submit(Request **requests, long nr);
823 GPU *get_gpu() const { return src_gpu; }
824
825 private:
826 GPU *src_gpu;
827 // std::deque<Request*> pending_copies;
828 };
829
830 class GPUfillChannel;
831
832 class GPUfillXferDes : public XferDes {
833 public:
834 GPUfillXferDes(uintptr_t _dma_op, Channel *_channel, NodeID _launch_node,
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);
838
839 long get_requests(Request **requests, long nr);
840
842
843 protected:
845 };
846
847 class GPUfillChannel : public SingleXDQChannel<GPUfillChannel, GPUfillXferDes> {
848 public:
850
851 // multiple concurrent cuda fills ok
852 static const bool is_ordered = false;
853
854 virtual XferDes *create_xfer_des(uintptr_t dma_op, NodeID launch_node,
855 XferDesID guid,
856 const std::vector<XferDesPortInfo> &inputs_info,
857 const std::vector<XferDesPortInfo> &outputs_info,
858 int priority, XferDesRedopInfo redop_info,
859 const void *fill_data, size_t fill_size,
860 size_t fill_total);
861
862 long submit(Request **requests, long nr);
863
864 protected:
865 friend class GPUfillXferDes;
866
868 };
869
870 class GPUreduceChannel;
871 class GPUreduceXferDes : public XferDes {
872 public:
873 GPUreduceXferDes(uintptr_t _dma_op, Channel *_channel, NodeID _launch_node,
874 XferDesID _guid, const std::vector<XferDesPortInfo> &inputs_info,
875 const std::vector<XferDesPortInfo> &outputs_info, int _priority,
876 XferDesRedopInfo _redop_info);
877
878 long get_requests(Request **requests, long nr);
879
882 XferPort *in_port, XferPort *out_port,
883 size_t in_span_start, size_t out_span_start);
884 void *describe_kernel_variant(bool is_advanced);
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);
889
890 protected:
897 std::vector<GPU *> src_gpus;
898 std::vector<bool> src_is_ipc;
899 };
900
901 class GPUreduceChannel : public SingleXDQChannel<GPUreduceChannel, GPUreduceXferDes> {
902 public:
904
905 // multiple concurrent cuda reduces ok
906 static const bool is_ordered = false;
907
908 virtual bool supports_redop(ReductionOpID redop_id) const;
909
911
912 virtual XferDes *create_xfer_des(uintptr_t dma_op, NodeID launch_node,
913 XferDesID guid,
914 const std::vector<XferDesPortInfo> &inputs_info,
915 const std::vector<XferDesPortInfo> &outputs_info,
916 int priority, XferDesRedopInfo redop_info,
917 const void *fill_data, size_t fill_size,
918 size_t fill_total);
919
920 long submit(Request **requests, long nr);
921
922 protected:
923 friend class GPUreduceXferDes;
924
926 };
927
929 public:
930 GPUreduceRemoteChannelInfo(NodeID _owner, XferDesKind _kind, uintptr_t _remote_ptr,
931 const std::vector<Channel::SupportedPath> &_paths);
932
934
935 template <typename S>
936 bool serialize(S &serializer) const;
937
938 template <typename S>
939 static RemoteChannelInfo *deserialize_new(S &deserializer);
940
941 protected:
945 };
946
949
950 GPUreduceRemoteChannel(uintptr_t _remote_ptr);
951 };
952
953 // active messages for establishing cuda ipc mappings
954
956#ifdef REALM_ON_LINUX
957 long hostid; // POSIX hostid
958#endif
959
960 static void handle_message(NodeID sender, const HipIpcRequest &args,
961 const void *data, size_t datalen);
962 };
963
965 unsigned count;
966
967 static void handle_message(NodeID sender, const HipIpcResponse &args,
968 const void *data, size_t datalen);
969 };
970
972
973 static void handle_message(NodeID sender, const HipIpcRelease &args,
974 const void *data, size_t datalen);
975 };
976
978 public:
980
981 virtual void chunk_created(void *base, size_t bytes);
982 virtual void chunk_destroyed(void *base, size_t bytes);
983
984 protected:
985 HipModule *module;
986 };
987
988 }; // namespace Hip
989
990}; // namespace Realm
991
992#endif
Definition bgwork.h:129
Definition bgwork.h:36
Definition bytearray.h:30
Definition bytearray.h:53
Definition channel.h:712
Definition circ_queue.h:35
Definition codedesc.h:249
Definition threads.h:382
Definition threads.h:342
Definition threads.h:428
Definition event.h:50
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
GPU * gpu
Definition hip_internal.h:437
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
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 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
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
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
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
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)
virtual ~GPUWorker(void)
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
void pop_context(void)
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
void push_context(void)
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 > &copy_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
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 lists.h:66
Definition mem_impl.h:344
Definition proc_impl.h:141
Definition mem_impl.h:212
Definition mem_impl.h:50
MemoryKind
Definition mem_impl.h:53
size_t size
Definition mem_impl.h:195
AllocationResult
Definition mem_impl.h:89
Definition memory.h:33
Kind
Definition memory.h:59
Definition module.h:100
Definition network.h:409
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 channel.h:895
Definition channel.h:938
Definition repl_heap.h:50
Definition channel.h:102
Definition runtime_impl.h:267
Definition channel.h:908
Definition channel.h:1018
Definition threads.h:89
Definition timers.h:129
Definition mutex.h:325
Definition mutex.h:223
Definition channel.h:285
Channel * channel
Definition channel.h:342
Definition atomics.h:31
Definition utils.h:84
#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 channel.h:683
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
Definition redop.h:56
Definition channel.h:209
Definition channel.h:299
NodeID src
Definition ucp_internal.h:1