Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
prealm.h
Go to the documentation of this file.
1/*
2 * Copyright 2025 Stanford University, NVIDIA Corporation
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 PREALM_H
19#define PREALM_H
20
21#include "realm.h"
22#include "realm/cmdline.h"
23#include "realm/id.h"
24#ifdef REALM_USE_CUDA
27#endif
28
29namespace PRealm {
30
31 // You can use this call to record your own time ranges in a PRealm profile
32 // It will implicitly capture the stop time when the function is invoked
33 // If you pass an event here, it must be an "external" event corresponding
34 // to a Realm event made from external synchronization primitive like a
35 // CUDA event or stream. If it is not an external event it will not work.
36 REALM_PUBLIC_API void prealm_time_range(long long start_time_in_ns,
37 const std::string_view &name,
39
41 const std::string_view &task_name);
42
43 // Import a bunch of types directly from the realm public interface
44 // but overload ones that we need to profile
45
46 // forward declarations
47 using Realm::Clock;
49 using Realm::Logger;
50 // TODO: add profiling to client-level profiling requests
53 template <int N, typename T>
54 struct Rect;
55 template <int N, typename T>
56 class IndexSpace;
57
58 // from utils.h
60 template <typename T, size_t Extent = dynamic_extent>
62
63 // from faults.h
64 namespace Faults {
65 using namespace Realm::Faults;
66 }
68 using Realm::Backtrace;
72
73 // from redop.h
76 namespace ReductionKernels {
77 using namespace Realm::ReductionKernels;
78 }
79#if defined(REALM_USE_CUDA) && defined(__CUDACC__)
80 template <typename T>
81 using HasHasCudaReductions = Realm::HasHasCudaReductions<T>;
82#endif
83#if defined(REALM_USE_HIP) && (defined(__CUDACC__) || defined(__HIPCC__))
84 template <typename T>
85 using HasHasHipReductions = Realm::HasHasHipReductions<T>;
86#endif
87 template <typename REDOP>
89
90 // from custom_serdez.h
92 template <typename T>
94 template <typename T, size_t MAX_SER_SIZE = 4096>
97
98 // from event.h
100 public:
101 Event(void) { id = 0; }
103 {
104 assert(Realm::ID{i}.is_event() || Realm::ID{i}.is_barrier() || (id == 0));
105 id = i;
106 }
108 : Realm::Event(e)
109 {}
110 Event(const Event &rhs) = default;
111 Event(Event &&rhs) = default;
113 {
114 id = e.id;
115 return *this;
116 }
117 Event &operator=(const Event &e) = default;
118 Event &operator=(Event &&rhs) = default;
119
120 public:
121 bool is_barrier(void) const;
122
123 public:
124 // Don't care about external waits
125 void wait(void) const;
126 void wait_faultaware(bool &poisoned) const;
127
128 public:
129 static Event merge_events(const Event *wait_for, size_t num_events);
130 static Event merge_events(Event ev1, Event ev2, Event ev3 = NO_EVENT,
131 Event ev4 = NO_EVENT, Event ev5 = NO_EVENT,
132 Event ev6 = NO_EVENT);
133 static Event merge_events(const std::set<Event> &wait_for);
134 static Event merge_events(const span<const Event> &wait_for);
135
136 public:
137 static Event merge_events_ignorefaults(const Event *wait_for, size_t num_events);
139 static Event merge_events_ignorefaults(const std::set<Event> &wait_for);
140 static Event ignorefaults(Event wait_for);
141
142 public:
143 static const Event NO_EVENT;
144 };
145 static_assert(sizeof(Event) == sizeof(Realm::Event));
146
148 public:
149 UserEvent(void) { id = 0; }
151 : Event(i)
152 {
153 assert(Realm::ID{i}.is_event());
154 }
155 UserEvent(const Realm::UserEvent &e) { id = e.id; }
156 UserEvent(const UserEvent &rhs) = default;
157 UserEvent(UserEvent &&rhs) = default;
159 {
160 id = e.id;
161 return *this;
162 }
163 UserEvent &operator=(const UserEvent &rhs) = default;
164 UserEvent &operator=(UserEvent &&rhs) = default;
165
166 public:
167 void trigger(Event wait_on = Event::NO_EVENT, bool ignore_faults = false) const;
168 void cancel(void) const;
169
171
173 };
174 static_assert(sizeof(UserEvent) == sizeof(Realm::UserEvent));
175
177 public:
179 {
180 id = 0;
181 timestamp = 0;
182 }
184 : Event(i)
185 , timestamp(t)
186 {
187 assert(Realm::ID{i}.is_barrier());
188 }
190 {
191 id = b.id;
192 timestamp = b.timestamp;
193 }
194 Barrier(const Barrier &b) = default;
195 Barrier(Barrier &&b) = default;
197 {
198 id = b.id;
199 timestamp = b.timestamp;
200 return *this;
201 }
202 Barrier &operator=(const Barrier &b) = default;
203 Barrier &operator=(Barrier &&b) = default;
204 // Implicit conversion to Realm::Barrier
205 operator Realm::Barrier(void) const;
206
207 public:
210
211 static const Barrier NO_BARRIER;
212
213 static Barrier create_barrier(unsigned expected_arrivals, ReductionOpID redop_id = 0,
214 const void *initial_value = 0,
215 size_t initial_value_size = 0);
217 static Barrier create_barrier(const Barrier::ParticipantInfo *expected_arrivals,
218 size_t num_participants, ReductionOpID redop_id = 0,
219 const void *initial_value = 0,
220 size_t initial_value_size = 0);
222 size_t num_participants);
223 void destroy_barrier(void);
224
225 static const ::realm_event_gen_t MAX_PHASES;
226
228 Barrier alter_arrival_count(int delta) const;
230 void arrive(unsigned count = 1, Event wait_on = Event::NO_EVENT,
231 const void *reduce_value = 0, size_t reduce_value_size = 0) const;
232 bool get_result(void *value, size_t value_size) const;
233 };
234 static_assert(sizeof(Barrier) == sizeof(Realm::Barrier));
235
237 public:
238 CompletionQueue(void) { id = 0; }
242 CompletionQueue(const CompletionQueue &q) = default;
245 {
246 this->id = q.id;
247 return *this;
248 }
251 // TODO: tracking completion queue events is hard because you need to follow
252 // them through to the point where we pop the events out the queue so we can
253 // record them as an "or" of all the popped events
255 size_t pop_events(Event *events, size_t max_events);
256
257 public:
259 };
260 static_assert(sizeof(CompletionQueue) == sizeof(Realm::CompletionQueue));
261
262 // from reservation.h
264 public:
265 Reservation(void) { id = 0; }
269 Reservation(const Reservation &r) = default;
270 Reservation(Reservation &&r) = default;
272 {
273 this->id = r.id;
274 return *this;
275 }
276 Reservation &operator=(const Reservation &r) = default;
278 Event acquire(unsigned mode = 0, bool exclusive = true,
279 Event wait_on = Event::NO_EVENT) const;
280 Event try_acquire(bool retry, unsigned mode = 0, bool exclusive = true,
281 Event wait_on = Event::NO_EVENT) const;
282
283 public:
285 };
286 static_assert(sizeof(Reservation) == sizeof(Realm::Reservation));
287
289 public:
290 // TODO: do we need to profile these, right now Legion Prof won't use them
291#if 0
292 Event lock(WaitMode mode = SPIN); // synonym for wrlock()
293 Event wrlock(WaitMode mode = SPIN);
294 Event rdlock(WaitMode mode = SPIN);
295#endif
296 };
297 static_assert(sizeof(FastReservation) == sizeof(Realm::FastReservation));
298
299 // from memory.h
300 using Realm::Memory;
301
302 // from processor.h
304
306 public:
307 Processor(void) { id = 0; }
309 {
310 assert(Realm::ID{i}.is_processor());
311 id = i;
312 }
316 Processor(const Processor &p) = default;
317 Processor(Processor &&p) = default;
319 {
320 this->id = p.id;
321 return *this;
322 }
323 Processor &operator=(const Processor &p) = default;
325 typedef void (*TaskFuncPtr)(const void *args, size_t arglen, const void *user_data,
326 size_t user_data_len, Processor proc);
327 Event spawn(TaskFuncID func_id, const void *args, size_t arglen,
328 Event wait_on = Event::NO_EVENT, int priority = 0) const;
329
330 // Same as the above but with requests for profiling
331 Event spawn(TaskFuncID func_id, const void *args, size_t arglen,
332 const ProfilingRequestSet &requests, Event wait_on = Event::NO_EVENT,
333 int priority = 0) const;
334
336 const ProfilingRequestSet &prs, const void *user_data = 0,
337 size_t user_data_len = 0) const;
338
339 static Event register_task_by_kind(Kind target_kind, bool global, TaskFuncID func_id,
340 const CodeDescriptor &codedesc,
341 const ProfilingRequestSet &prs,
342 const void *user_data = 0,
343 size_t user_data_len = 0);
344 // special task IDs
345 enum
346 {
350 // Increment this by 3 to reserve some task IDs for our profiling work
351 TASK_ID_FIRST_AVAILABLE = Realm::Processor::TASK_ID_FIRST_AVAILABLE + 5,
352 };
353
354 static const Processor NO_PROC;
355 };
356 static_assert(sizeof(Processor) == sizeof(Realm::Processor));
357
359 public:
360 ProcessorGroup(void) { id = 0; }
364 ProcessorGroup(const ProcessorGroup &g) = default;
367 {
368 this->id = g.id;
369 return *this;
370 }
373
374 static ProcessorGroup create_group(const Processor *members, size_t num_members);
376
377 void destroy(Event wait_on = Event::NO_EVENT) const;
378
380 };
381 static_assert(sizeof(ProcessorGroup) == sizeof(Realm::ProcessorGroup));
382
383 // from inst_layout.h
385 namespace PieceLookup {
386 using namespace Realm::PieceLookup;
387 }
390 namespace PieceLayoutTypes {
391 using namespace Realm::PieceLayoutTypes;
392 }
394 template <int N, typename T = int>
396 template <int N, typename T = int>
398 template <int N, typename T = int>
400 template <int N, typename T = int>
402
403 // from instance.h
407 using Realm::FieldID;
409 public:
411 {
412 id = 0;
413 unique_event = Event::NO_EVENT;
414 }
415 // No implicit conversion from realm region instances because of unique event
416 RegionInstance(const RegionInstance &i) = default;
418 // No implicit conversion from realm region instances because of unique event
421 // TODO: handle redistricting cases
423 const ProfilingRequestSet &prs, Event wait_on = Event::NO_EVENT);
425 size_t num_layouts, const ProfilingRequestSet *prs,
426 Event wait_on = Event::NO_EVENT);
429 const ProfilingRequestSet &prs,
430 Event wait_on = Event::NO_EVENT);
432 const InstanceLayoutGeneric &ilg,
433 const ProfilingRequestSet &prs,
434 Event wait_on = Event::NO_EVENT);
437 const ExternalInstanceResource &resource,
438 const ProfilingRequestSet &prs,
439 Event wait_on = Event::NO_EVENT);
441 const InstanceLayoutGeneric &ilg,
442 const ExternalInstanceResource &resource,
443 const ProfilingRequestSet &prs,
444 Event wait_on = Event::NO_EVENT);
445 static Event create_external(RegionInstance &inst, Memory memory, uintptr_t base,
447 const ProfilingRequestSet &prs,
448 Event wait_on = Event::NO_EVENT);
449 template <int N, typename T>
450 static Event
452 const std::vector<size_t> &field_sizes, size_t block_size,
453 const ProfilingRequestSet &prs, Event wait_on = Event::NO_EVENT);
454 template <int N, typename T>
455 static Event
457 const std::map<FieldID, size_t> &field_sizes, size_t block_size,
458 const ProfilingRequestSet &prs, Event wait_on = Event::NO_EVENT);
459 template <int N, typename T>
460 static Event
462 const std::vector<size_t> &field_sizes,
463 size_t block_size, // 0=SOA, 1=AOS, 2+=hybrid
464 const ProfilingRequestSet &prs, Event wait_on = Event::NO_EVENT);
465 template <int N, typename T>
466 static Event
468 const std::map<FieldID, size_t> &field_sizes,
469 size_t block_size, // 0=SOA, 1=AOS, 2+=hybrid
470 const ProfilingRequestSet &prs, Event wait_on = Event::NO_EVENT);
471 template <int N, typename T>
472 static Event create_file_instance(RegionInstance &inst, const char *file_name,
473 const IndexSpace<N, T> &space,
474 const std::vector<FieldID> &field_ids,
475 const std::vector<size_t> &field_sizes,
476 realm_file_mode_t file_mode,
477 const ProfilingRequestSet &prs,
478 Event wait_on = Event::NO_EVENT);
479 // TODO: Profile this? Legion prof won't recognize where the event came from
481 template <int N, typename T>
483 template <int N>
486
487 public:
488 // A unique event that acts as a handle for describing this instance for
489 // profiling
491 };
492 // Even though we add extra data to the RegionInstance in the form of a
493 // unique event for naming the instance, the struct should still be packed
494 static_assert(std::has_unique_object_representations_v<RegionInstance>);
497
498 // Need a special copy src dst field that records RegionInstances with unique
499 // names
501 public:
506 CopySrcDstField &set_field(RegionInstance _inst, FieldID _field_id, size_t _size,
507 size_t _subfield_offset = 0);
508 CopySrcDstField &set_indirect(int _indirect_index, FieldID _field_id, size_t _size,
509 size_t _subfield_offset = 0);
510 CopySrcDstField &set_redop(ReductionOpID _redop_id, bool _is_fold,
511 bool exclusive = false);
513 CopySrcDstField &set_fill(const void *_data, size_t _size);
514 template <typename T>
516
517 // Implicit conversion to Realm::CopySrcDstField
518 operator Realm::CopySrcDstField(void) const;
519
520 public:
523 size_t size;
530 static constexpr size_t MAX_DIRECT_SIZE = 8;
531 union {
532 char direct[8];
533 void *indirect;
534 } fill_data;
535 };
536
537 // from point.h
538 template <int N, typename T = int>
540 template <int N, typename T = int>
541 struct REALM_PUBLIC_API Rect : public Realm::Rect<N, T> {
542 using Realm::Rect<N, T>::Rect;
544 Rect(void) {}
545 template <int N2, typename T2>
547 : Realm::Rect<N, T>(rhs)
548 {}
549 template <int N2, typename T2>
551 : Realm::Rect<N, T>(rhs)
552 {}
553 template <int N2, typename T2>
555 {
557 return *this;
558 }
559 template <int N2, typename T2>
561 {
563 return *this;
564 }
565
566 Event fill(const std::vector<CopySrcDstField> &dsts,
567 const ProfilingRequestSet &requests, const void *fill_value,
568 size_t fill_value_size, Event wait_on = Event::NO_EVENT,
569 int priority = 0) const;
570
571 Event copy(const std::vector<CopySrcDstField> &srcs,
572 const std::vector<CopySrcDstField> &dsts,
573 const ProfilingRequestSet &requests, Event wait_on = Event::NO_EVENT,
574 int priority = 0) const;
575
576 Event copy(const std::vector<CopySrcDstField> &srcs,
577 const std::vector<CopySrcDstField> &dsts, const IndexSpace<N, T> &mask,
578 const ProfilingRequestSet &requests, Event wait_on = Event::NO_EVENT,
579 int priority = 0) const;
580 };
581 template <int N, typename T = int>
583 template <int M, int N, typename T = int>
585
586 // from profiling.h
588 namespace ProfilingMeasurements {
589 using namespace Realm::ProfilingMeasurements;
590 }
594
595 // from machine.h
597 public:
600 : Realm::Machine(m)
601 {}
602 Machine(const Machine &m) = default;
603 Machine(Machine &&m) = default;
605 {
607 return *this;
608 }
609 Machine &operator=(const Machine &m) = default;
610 Machine &operator=(Machine &&m) = default;
611
612 void get_all_processors(std::set<Processor> &pset) const;
613
614 void get_local_processors(std::set<Processor> &pset) const;
615 void get_local_processors_by_kind(std::set<Processor> &pset,
616 Processor::Kind kind) const;
617 void get_shared_processors(Memory m, std::set<Processor> &pset,
618 bool local_only = true) const;
619 static Machine get_machine(void);
620 };
621 static_assert(sizeof(Machine) == sizeof(Realm::Machine));
622
623 template <typename QT, typename RT>
625
626 using Realm::Module;
627
628 // from runtime.h
630 public:
633 : Realm::Runtime(r)
634 {}
635 Runtime(const Runtime &r) = default;
636 Runtime(Runtime &&r) = default;
638 {
640 return *this;
641 }
642 Runtime &operator=(const Runtime &r) = default;
643 Runtime &operator=(Runtime &&r) = default;
644 void parse_command_line(int argc, char **argv);
645 void parse_command_line(std::vector<std::string> &cmdline,
646 bool remove_realm_args = false);
647 bool configure_from_command_line(int argc, char **argv);
648 bool configure_from_command_line(std::vector<std::string> &cmdline,
649 bool remove_realm_args = false);
651 void start(void);
652 bool init(int *argc, char ***argv);
653 bool register_task(Processor::TaskFuncID taskid, Processor::TaskFuncPtr taskptr);
655 const void *args, size_t arglen,
656 Event wait_on = Event::NO_EVENT, int priority = 0);
657
659 Processor::TaskFuncID task_id, const void *args,
660 size_t arglen, bool one_per_node = false,
661 Event wait_on = Event::NO_EVENT, int priority = 0);
662 void shutdown(Event wait_on = Event::NO_EVENT, int result_code = 0);
664 static Runtime get_runtime(void);
665 template <typename T>
666 inline T *get_module(const char *name)
667 {
668 Module *mod = get_module_untyped(name);
669 if(mod)
670 return dynamic_cast<T *>(mod);
671 else
672 return 0;
673 }
674
675 protected:
676 Module *get_module_untyped(const char *name);
677 };
678 static_assert(sizeof(Runtime) == sizeof(Realm::Runtime));
679
680 template <typename FT>
682 template <typename FT, int N, typename T = int>
684 public:
686 GenericAccessor(RegionInstance inst, FieldID field_id, size_t subfield_offset = 0);
687 GenericAccessor(RegionInstance inst, FieldID field_id, const Rect<N, T> &subrect,
688 size_t subfield_offset = 0);
690
691 public:
692 inline FT read(const Point<N, T> &p);
693 inline void write(const Point<N, T> &p, FT newval);
695
696 private:
697 long long start;
698 RegionInstance instance;
699 FieldID field_id;
700 bool did_read = false;
701 bool did_write = false;
702 };
703 template <typename FT, int N, typename T = int>
705 public:
708 AffineAccessor(RegionInstance inst, FieldID field_id, size_t subfield_offset = 0);
709 AffineAccessor(RegionInstance inst, FieldID field_id, const Rect<N, T> &subrect,
710 size_t subfield_offset = 0);
711 template <int N2, typename T2>
713 const Point<N2, T2> &offset, FieldID field_id,
714 size_t subfield_offset = 0);
715 template <int N2, typename T2>
717 const Point<N2, T2> &offset, FieldID field_id,
718 const Rect<N, T> &subrect, size_t subfield_offset = 0);
721
722 AffineAccessor(const AffineAccessor &) = default;
724 AffineAccessor(AffineAccessor &&) noexcept = default;
725 AffineAccessor &operator=(AffineAccessor &&) noexcept = default;
726
727 public:
729 FT *ptr(const Point<N, T> &p) const;
731 FT read(const Point<N, T> &p) const;
733 void write(const Point<N, T> &p, FT newval) const;
735 FT &operator[](const Point<N, T> &p) const;
736
737 private:
738 inline void initialize(RegionInstance inst, FieldID fid);
739 long long start;
740 RegionInstance instance;
741 FieldID field_id;
742 mutable bool did_read = false;
743 mutable bool did_write = false;
744 mutable bool escaped = false;
745 };
746 template <typename FT, int N, typename T>
748 : public Realm::MultiAffineAccessor<FT, N, T> {
749 public:
753 size_t subfield_offset = 0);
754 MultiAffineAccessor(RegionInstance inst, FieldID field_id, const Rect<N, T> &subrect,
755 size_t subfield_offset = 0);
758
762 MultiAffineAccessor &operator=(MultiAffineAccessor &&) noexcept = default;
763
764 public:
766 FT *ptr(const Point<N, T> &p) const;
768 FT *ptr(const Rect<N, T> &r, size_t strides[N]) const;
770 FT read(const Point<N, T> &p) const;
772 void write(const Point<N, T> &p, FT newval) const;
774 FT &operator[](const Point<N, T> &p) const;
776 FT *ptr(const Point<N, T> &p);
778 FT *ptr(const Rect<N, T> &r, size_t strides[N]);
780 FT read(const Point<N, T> &p);
782 void write(const Point<N, T> &p, FT newval);
784 FT &operator[](const Point<N, T> &p);
785
786 private:
787 inline void initialize(RegionInstance inst, FieldID fid);
788 long long start;
789 RegionInstance instance;
790 FieldID field_id;
791 mutable bool did_read = false;
792 mutable bool did_write = false;
793 mutable bool escaped = false;
794 };
795
796 // from indexspace.h
797 template <typename IS, typename FT>
799 template <int N, typename T = int>
801 template <int M, int N, typename T = int>
803 template <int N, typename T, int N2, typename T2>
805 template <int N, typename T, int N2, typename T2>
806 using DomainTransform = Realm::DomainTransform<N, T, N2, T2>;
807 template <int N, typename T = int>
809 template <int N, typename T>
811 public:
812 using Realm::IndexSpace<N, T>::IndexSpace;
813 IndexSpace(void) {}
815 : Realm::IndexSpace<N, T>(i)
816 {}
817 IndexSpace(const IndexSpace<N, T> &i) = default;
820 {
822 return *this;
823 }
826
827 Event make_valid(bool precise = true) const;
828 Event fill(const std::vector<CopySrcDstField> &dsts,
829 const ProfilingRequestSet &requests, const void *fill_value,
830 size_t fill_value_size, Event wait_on = Event::NO_EVENT,
831 int priority = 0) const;
832 Event copy(const std::vector<CopySrcDstField> &srcs,
833 const std::vector<CopySrcDstField> &dsts,
834 const ProfilingRequestSet &requests, Event wait_on = Event::NO_EVENT,
835 int priority = 0) const;
836 Event copy(const std::vector<CopySrcDstField> &srcs,
837 const std::vector<CopySrcDstField> &dsts,
838 const std::vector<const typename CopyIndirection<N, T>::Base *> &indirects,
839 const ProfilingRequestSet &requests, Event wait_on = Event::NO_EVENT,
840 int priority = 0) const;
841 // TODO: fill in the dependent partition methods
842 Event create_equal_subspace(size_t count, size_t granularity, unsigned index,
843 IndexSpace<N, T> &subspace,
844 const ProfilingRequestSet &reqs,
845 Event wait_on = Event::NO_EVENT) const;
846 Event create_equal_subspaces(size_t count, size_t granularity,
847 std::vector<IndexSpace<N, T>> &subspaces,
848 const ProfilingRequestSet &reqs,
849 Event wait_on = Event::NO_EVENT) const;
850 Event create_weighted_subspaces(size_t count, size_t granularity,
851 const std::vector<int> &weights,
852 std::vector<IndexSpace<N, T>> &subspaces,
853 const ProfilingRequestSet &reqs,
854 Event wait_on = Event::NO_EVENT) const;
855 Event create_weighted_subspaces(size_t count, size_t granularity,
856 const std::vector<size_t> &weights,
857 std::vector<IndexSpace<N, T>> &subspaces,
858 const ProfilingRequestSet &reqs,
859 Event wait_on = Event::NO_EVENT) const;
860 template <typename FT>
862 const std::vector<FieldDataDescriptor<IndexSpace<N, T>, FT>> &field_data,
863 FT color, IndexSpace<N, T> &subspace, const ProfilingRequestSet &reqs,
864 Event wait_on = Event::NO_EVENT) const;
865
866 template <typename FT>
868 const std::vector<FieldDataDescriptor<IndexSpace<N, T>, FT>> &field_data,
869 const std::vector<FT> &colors, std::vector<IndexSpace<N, T>> &subspaces,
870 const ProfilingRequestSet &reqs, Event wait_on = Event::NO_EVENT) const;
871 template <typename FT, typename FT2>
873 const std::vector<FieldDataDescriptor<IndexSpace<N, T>, FT>> &field_data,
874 const CodeDescriptor &codedesc, FT2 color, IndexSpace<N, T> &subspace,
875 const ProfilingRequestSet &reqs, Event wait_on = Event::NO_EVENT) const;
876 template <typename FT, typename FT2>
878 const std::vector<FieldDataDescriptor<IndexSpace<N, T>, FT>> &field_data,
879 const CodeDescriptor &codedesc, const std::vector<FT2> &colors,
880 std::vector<IndexSpace<N, T>> &subspaces, const ProfilingRequestSet &reqs,
881 Event wait_on = Event::NO_EVENT) const;
882 template <int N2, typename T2, typename TRANSFORM>
883 Event create_subspace_by_image(const TRANSFORM &transform,
884 const IndexSpace<N2, T2> &source,
885 const IndexSpace<N, T> &image,
886 const ProfilingRequestSet &reqs,
887 Event wait_on = Event::NO_EVENT) const;
888 template <int N2, typename T2, typename TRANSFORM>
889 Event create_subspaces_by_image(const TRANSFORM &transform,
890 const std::vector<IndexSpace<N2, T2>> &sources,
891 std::vector<IndexSpace<N, T>> &images,
892 const ProfilingRequestSet &reqs,
893 Event wait_on = Event::NO_EVENT) const;
894 template <int N2, typename T2>
896 const std::vector<IndexSpace<N2, T2>> &sources,
897 std::vector<IndexSpace<N, T>> &images,
898 const ProfilingRequestSet &reqs,
899 Event wait_on = Event::NO_EVENT) const;
900 template <int N2, typename T2>
903 &field_data,
904 const IndexSpace<N2, T2> &source, IndexSpace<N, T> &image,
905 const ProfilingRequestSet &reqs, Event wait_on = Event::NO_EVENT) const;
906 template <int N2, typename T2>
909 &field_data,
910 const std::vector<IndexSpace<N2, T2>> &sources,
911 std::vector<IndexSpace<N, T>> &images, const ProfilingRequestSet &reqs,
912 Event wait_on = Event::NO_EVENT) const;
913 template <int N2, typename T2>
916 &field_data,
917 const IndexSpace<N2, T2> &source, IndexSpace<N, T> &image,
918 const ProfilingRequestSet &reqs, Event wait_on = Event::NO_EVENT) const;
919 template <int N2, typename T2>
922 &field_data,
923 const std::vector<IndexSpace<N2, T2>> &sources,
924 std::vector<IndexSpace<N, T>> &images, const ProfilingRequestSet &reqs,
925 Event wait_on = Event::NO_EVENT) const;
926 template <int N2, typename T2>
929 &field_data,
930 const std::vector<IndexSpace<N2, T2>> &sources,
931 const std::vector<IndexSpace<N, T>> &diff_rhs,
932 std::vector<IndexSpace<N, T>> &images, const ProfilingRequestSet &reqs,
933 Event wait_on = Event::NO_EVENT) const;
934 template <int N2, typename T2>
936 const DomainTransform<N, T, N2, T2> &domain_transform,
937 const std::vector<IndexSpace<N2, T2>> &sources,
938 const std::vector<IndexSpace<N, T>> &diff_rhs,
939 std::vector<IndexSpace<N, T>> &images, const ProfilingRequestSet &reqs,
940 Event wait_on = Event::NO_EVENT) const;
941 template <int N2, typename T2, typename TRANSFORM>
942 Event create_subspace_by_preimage(const TRANSFORM &transform,
943 const IndexSpace<N2, T2> &target,
944 IndexSpace<N, T> &preimage,
945 const ProfilingRequestSet &reqs,
946 Event wait_on = Event::NO_EVENT) const;
947 template <int N2, typename T2, typename TRANSFORM>
948 Event create_subspaces_by_preimage(const TRANSFORM &transform,
949 const std::vector<IndexSpace<N2, T2>> &targets,
950 std::vector<IndexSpace<N, T>> &preimages,
951 const ProfilingRequestSet &reqs,
952 Event wait_on = Event::NO_EVENT) const;
953 template <int N2, typename T2>
954 Event
956 const std::vector<IndexSpace<N2, T2>> &targets,
957 std::vector<IndexSpace<N, T>> &preimages,
958 const ProfilingRequestSet &reqs,
959 Event wait_on = Event::NO_EVENT) const;
960 template <int N2, typename T2>
963 &field_data,
964 const IndexSpace<N2, T2> &target, IndexSpace<N, T> &preimage,
965 const ProfilingRequestSet &reqs, Event wait_on = Event::NO_EVENT) const;
966 template <int N2, typename T2>
969 &field_data,
970 const std::vector<IndexSpace<N2, T2>> &targets,
971 std::vector<IndexSpace<N, T>> &preimages, const ProfilingRequestSet &reqs,
972 Event wait_on = Event::NO_EVENT) const;
973 template <int N2, typename T2>
976 &field_data,
977 const IndexSpace<N2, T2> &target, IndexSpace<N, T> &preimage,
978 const ProfilingRequestSet &reqs, Event wait_on = Event::NO_EVENT) const;
979 template <int N2, typename T2>
982 &field_data,
983 const std::vector<IndexSpace<N2, T2>> &targets,
984 std::vector<IndexSpace<N, T>> &preimages, const ProfilingRequestSet &reqs,
985 Event wait_on = Event::NO_EVENT) const;
987 IndexSpace<N, T> &result, const ProfilingRequestSet &reqs,
988 Event wait_on = Event::NO_EVENT);
989 static Event compute_unions(const std::vector<IndexSpace<N, T>> &lhss,
990 const std::vector<IndexSpace<N, T>> &rhss,
991 std::vector<IndexSpace<N, T>> &results,
992 const ProfilingRequestSet &reqs,
993 Event wait_on = Event::NO_EVENT);
995 const std::vector<IndexSpace<N, T>> &rhss,
996 std::vector<IndexSpace<N, T>> &results,
997 const ProfilingRequestSet &reqs,
998 Event wait_on = Event::NO_EVENT);
999 static Event compute_unions(const std::vector<IndexSpace<N, T>> &lhss,
1000 const IndexSpace<N, T> &rhs,
1001 std::vector<IndexSpace<N, T>> &results,
1002 const ProfilingRequestSet &reqs,
1003 Event wait_on = Event::NO_EVENT);
1005 const IndexSpace<N, T> &rhs,
1006 IndexSpace<N, T> &result,
1007 const ProfilingRequestSet &reqs,
1008 Event wait_on = Event::NO_EVENT);
1009 static Event compute_intersections(const std::vector<IndexSpace<N, T>> &lhss,
1010 const std::vector<IndexSpace<N, T>> &rhss,
1011 std::vector<IndexSpace<N, T>> &results,
1012 const ProfilingRequestSet &reqs,
1013 Event wait_on = Event::NO_EVENT);
1015 const std::vector<IndexSpace<N, T>> &rhss,
1016 std::vector<IndexSpace<N, T>> &results,
1017 const ProfilingRequestSet &reqs,
1018 Event wait_on = Event::NO_EVENT);
1019 static Event compute_intersections(const std::vector<IndexSpace<N, T>> &lhss,
1020 const IndexSpace<N, T> &rhs,
1021 std::vector<IndexSpace<N, T>> &results,
1022 const ProfilingRequestSet &reqs,
1023 Event wait_on = Event::NO_EVENT);
1025 const IndexSpace<N, T> &rhs, IndexSpace<N, T> &result,
1026 const ProfilingRequestSet &reqs,
1027 Event wait_on = Event::NO_EVENT);
1028 static Event compute_differences(const std::vector<IndexSpace<N, T>> &lhss,
1029 const std::vector<IndexSpace<N, T>> &rhss,
1030 std::vector<IndexSpace<N, T>> &results,
1031 const ProfilingRequestSet &reqs,
1032 Event wait_on = Event::NO_EVENT);
1034 const std::vector<IndexSpace<N, T>> &rhss,
1035 std::vector<IndexSpace<N, T>> &results,
1036 const ProfilingRequestSet &reqs,
1037 Event wait_on = Event::NO_EVENT);
1038 static Event compute_differences(const std::vector<IndexSpace<N, T>> &lhss,
1039 const IndexSpace<N, T> &rhs,
1040 std::vector<IndexSpace<N, T>> &results,
1041 const ProfilingRequestSet &reqs,
1042 Event wait_on = Event::NO_EVENT);
1043 static Event compute_union(const std::vector<IndexSpace<N, T>> &subspaces,
1044 IndexSpace<N, T> &result, const ProfilingRequestSet &reqs,
1045 Event wait_on = Event::NO_EVENT);
1046 static Event compute_intersection(const std::vector<IndexSpace<N, T>> &subspaces,
1047 IndexSpace<N, T> &result,
1048 const ProfilingRequestSet &reqs,
1049 Event wait_on = Event::NO_EVENT);
1050 };
1051
1053 public:
1068 Event copy(const std::vector<CopySrcDstField> &srcs,
1069 const std::vector<CopySrcDstField> &dsts,
1070 const ProfilingRequestSet &requests, Event wait_on = Event::NO_EVENT,
1071 int priority = 0) const;
1072
1073 template <int N, typename T>
1074 Event copy(const std::vector<CopySrcDstField> &srcs,
1075 const std::vector<CopySrcDstField> &dsts,
1076 const std::vector<const typename CopyIndirection<N, T>::Base *> &indirects,
1077 const ProfilingRequestSet &requests, Event wait_on = Event::NO_EVENT,
1078 int priority = 0) const;
1079 };
1080 static_assert(sizeof(IndexSpaceGeneric) == sizeof(Realm::IndexSpaceGeneric));
1081
1082 // from codedesc.h
1084 using Realm::IntegerType;
1085 using Realm::OpaqueType;
1086 using Realm::PointerType;
1087 using Realm::Type;
1088 namespace TypeConv {
1089 using namespace Realm::TypeConv;
1090 }
1092 using Realm::CodeProperty;
1095#ifdef REALM_USE_DLFCN
1096 using Realm::DSOCodeTranslator;
1097 using Realm::DSOReferenceImplementation;
1098#endif
1099
1100 // from subgraph.h
1101 // TODO: override subgraph construction to add profiling requests
1102 using Realm::Subgraph;
1104
1105 // from module_config.h
1106 using Realm::ModuleConfig;
1107
1108#ifdef REALM_USE_CUDA
1114 namespace Cuda {
1122 using Realm::Cuda::Uuid;
1123 using Realm::Cuda::UUID_SIZE;
1124
1125 class REALM_PUBLIC_API CudaModule : public Realm::Module {
1126 public:
1127 CudaModule(Realm::Cuda::CudaModule *internal);
1128 virtual ~CudaModule(void);
1129
1130 inline CUstream_st *get_task_cuda_stream()
1131 {
1132 return internal->get_task_cuda_stream();
1133 }
1134 inline void set_task_ctxsync_required(bool is_required)
1135 {
1136 internal->set_task_ctxsync_required(is_required);
1137 }
1138
1139 Event make_realm_event(CUevent_st *cuda_event);
1140 Event make_realm_event(CUstream_st *cuda_stream);
1141
1142 inline bool get_cuda_device_uuid(Processor p, Uuid *uuid) const
1143 {
1144 return internal->get_cuda_device_uuid(p, uuid);
1145 }
1146
1147 inline bool get_cuda_device_id(Processor p, int *device) const
1148 {
1149 return internal->get_cuda_device_id(p, device);
1150 }
1151
1152 inline bool get_cuda_context(Processor p, CUctx_st **context) const
1153 {
1154 return internal->get_cuda_context(p, context);
1155 }
1156
1157 inline bool register_reduction(Event &event, const CudaRedOpDesc *descs, size_t num)
1158 {
1159 return internal->register_reduction(event, descs, num);
1160 }
1161
1162 protected:
1163 Realm::Cuda::CudaModule *const internal;
1164 };
1165 } // namespace Cuda
1166#endif
1167
1168} // namespace PRealm
1169
1170#include "prealm.inl"
1171
1172#endif // ifndef PREALM_H
Definition prealm.h:704
AffineAccessor & operator=(const AffineAccessor &)=default
AffineAccessor(RegionInstance inst, const Matrix< N2, N, T2 > &transform, const Point< N2, T2 > &offset, FieldID field_id, const Rect< N, T > &subrect, size_t subfield_offset=0)
AffineAccessor(RegionInstance inst, FieldID field_id, size_t subfield_offset=0)
AffineAccessor(const AffineAccessor &)=default
REALM_CUDA_HD ~AffineAccessor(void)
AffineAccessor(RegionInstance inst, const Matrix< N2, N, T2 > &transform, const Point< N2, T2 > &offset, FieldID field_id, size_t subfield_offset=0)
REALM_CUDA_HD AffineAccessor(void)
Definition prealm.h:707
AffineAccessor(AffineAccessor &&) noexcept=default
AffineAccessor(RegionInstance inst, FieldID field_id, const Rect< N, T > &subrect, size_t subfield_offset=0)
Definition prealm.h:176
void arrive(unsigned count=1, Event wait_on=Event::NO_EVENT, const void *reduce_value=0, size_t reduce_value_size=0) const
bool get_result(void *value, size_t value_size) const
Barrier(Barrier &&b)=default
Barrier alter_arrival_count(int delta) const
timestamp_t timestamp
Definition prealm.h:209
static Barrier create_barrier(unsigned expected_arrivals, ReductionOpID redop_id=0, const void *initial_value=0, size_t initial_value_size=0)
Barrier & operator=(const Barrier &b)=default
Barrier(void)
Definition prealm.h:178
::realm_barrier_timestamp_t timestamp_t
Definition prealm.h:208
static Barrier create_barrier(const Barrier::ParticipantInfo *expected_arrivals, size_t num_participants, ReductionOpID redop_id=0, const void *initial_value=0, size_t initial_value_size=0)
Barrier advance_barrier(void) const
Barrier get_previous_phase(void) const
Barrier(const Realm::Barrier &b)
Definition prealm.h:189
Barrier & operator=(Barrier &&b)=default
Barrier(::realm_id_t i, ::realm_barrier_timestamp_t t)
Definition prealm.h:183
Barrier(const Barrier &b)=default
static const Barrier NO_BARRIER
Definition prealm.h:211
void destroy_barrier(void)
Barrier & operator=(const Realm::Barrier &b)
Definition prealm.h:196
Barrier set_arrival_pattern(const Barrier::ParticipantInfo *expected_arrivals, size_t num_participants)
static const ::realm_event_gen_t MAX_PHASES
Definition prealm.h:225
Definition prealm.h:236
size_t pop_events(Event *events, size_t max_events)
CompletionQueue(void)
Definition prealm.h:238
Event get_nonempty_event(void)
CompletionQueue & operator=(const CompletionQueue &q)=default
CompletionQueue(const CompletionQueue &q)=default
CompletionQueue & operator=(Realm::CompletionQueue q)
Definition prealm.h:244
CompletionQueue(Realm::CompletionQueue q)
Definition prealm.h:239
CompletionQueue & operator=(CompletionQueue &&q)=default
CompletionQueue(CompletionQueue &&q)=default
static const CompletionQueue NO_QUEUE
Definition prealm.h:258
Definition prealm.h:99
void wait(void) const
bool is_barrier(void) const
static Event merge_events(const std::set< Event > &wait_for)
static Event ignorefaults(Event wait_for)
static Event merge_events(Event ev1, Event ev2, Event ev3=NO_EVENT, Event ev4=NO_EVENT, Event ev5=NO_EVENT, Event ev6=NO_EVENT)
Event & operator=(const Event &e)=default
Event(Event &&rhs)=default
Event(const Event &rhs)=default
Event & operator=(Event &&rhs)=default
Event & operator=(const Realm::Event &e)
Definition prealm.h:112
static Event merge_events_ignorefaults(const span< const Event > &wait_for)
void wait_faultaware(bool &poisoned) const
static Event merge_events_ignorefaults(const std::set< Event > &wait_for)
Event(void)
Definition prealm.h:101
static Event merge_events(const span< const Event > &wait_for)
Event(const Realm::Event &e)
Definition prealm.h:107
static Event merge_events_ignorefaults(const Event *wait_for, size_t num_events)
Event(::realm_id_t i)
Definition prealm.h:102
static Event merge_events(const Event *wait_for, size_t num_events)
static const Event NO_EVENT
Definition prealm.h:143
Definition prealm.h:288
Definition prealm.h:683
GenericAccessor(RegionInstance inst, FieldID field_id, size_t subfield_offset=0)
AccessorRefHelper< FT > operator[](const Point< N, T > &p)
void write(const Point< N, T > &p, FT newval)
GenericAccessor(void)
Definition prealm.h:685
GenericAccessor(RegionInstance inst, FieldID field_id, const Rect< N, T > &subrect, size_t subfield_offset=0)
FT read(const Point< N, T > &p)
Definition prealm.h:1052
IndexSpaceGeneric & operator=(const Realm::IndexSpaceGeneric &i)
Definition prealm.h:1061
IndexSpaceGeneric(const IndexSpaceGeneric &i)=default
Event copy(const std::vector< CopySrcDstField > &srcs, const std::vector< CopySrcDstField > &dsts, const ProfilingRequestSet &requests, Event wait_on=Event::NO_EVENT, int priority=0) const
IndexSpaceGeneric & operator=(IndexSpaceGeneric &&i)=default
IndexSpaceGeneric(const Realm::IndexSpaceGeneric &i)
Definition prealm.h:1056
IndexSpaceGeneric(IndexSpaceGeneric &&i)=default
IndexSpaceGeneric & operator=(const IndexSpaceGeneric &i)=default
IndexSpaceGeneric(void)
Definition prealm.h:1055
Event copy(const std::vector< CopySrcDstField > &srcs, const std::vector< CopySrcDstField > &dsts, const std::vector< const typename CopyIndirection< N, T >::Base * > &indirects, const ProfilingRequestSet &requests, Event wait_on=Event::NO_EVENT, int priority=0) const
Definition prealm.h:810
static Event compute_intersection(const IndexSpace< N, T > &lhs, const IndexSpace< N, T > &rhs, IndexSpace< N, T > &result, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT)
Event make_valid(bool precise=true) const
Event create_subspace_by_image(const TRANSFORM &transform, const IndexSpace< N2, T2 > &source, const IndexSpace< N, T > &image, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
IndexSpace & operator=(IndexSpace< N, T > &&i)=default
static Event compute_intersections(const std::vector< IndexSpace< N, T > > &lhss, const IndexSpace< N, T > &rhs, std::vector< IndexSpace< N, T > > &results, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT)
Event create_subspaces_by_image(const std::vector< FieldDataDescriptor< IndexSpace< N2, T2 >, Rect< N, T > > > &field_data, const std::vector< IndexSpace< N2, T2 > > &sources, std::vector< IndexSpace< N, T > > &images, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
Event create_subspaces_by_preimage(const std::vector< FieldDataDescriptor< IndexSpace< N, T >, Rect< N2, T2 > > > &field_data, const std::vector< IndexSpace< N2, T2 > > &targets, std::vector< IndexSpace< N, T > > &preimages, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
Event create_subspace_by_preimage(const TRANSFORM &transform, const IndexSpace< N2, T2 > &target, IndexSpace< N, T > &preimage, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
Event create_subspace_by_preimage(const std::vector< FieldDataDescriptor< IndexSpace< N, T >, Point< N2, T2 > > > &field_data, const IndexSpace< N2, T2 > &target, IndexSpace< N, T > &preimage, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
static Event compute_intersection(const std::vector< IndexSpace< N, T > > &subspaces, IndexSpace< N, T > &result, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT)
Event create_equal_subspace(size_t count, size_t granularity, unsigned index, IndexSpace< N, T > &subspace, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
Event create_subspace_by_image(const std::vector< FieldDataDescriptor< IndexSpace< N2, T2 >, Rect< N, T > > > &field_data, const IndexSpace< N2, T2 > &source, IndexSpace< N, T > &image, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
IndexSpace(IndexSpace< N, T > &&i)=default
IndexSpace(const IndexSpace< N, T > &i)=default
Event create_subspace_by_image(const std::vector< FieldDataDescriptor< IndexSpace< N2, T2 >, Point< N, T > > > &field_data, const IndexSpace< N2, T2 > &source, IndexSpace< N, T > &image, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
IndexSpace & operator=(const Realm::IndexSpace< N, T > &i)
Definition prealm.h:819
static Event compute_intersections(const std::vector< IndexSpace< N, T > > &lhss, const std::vector< IndexSpace< N, T > > &rhss, std::vector< IndexSpace< N, T > > &results, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT)
static Event compute_union(const IndexSpace< N, T > &lhs, const IndexSpace< N, T > &rhs, IndexSpace< N, T > &result, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT)
Event create_subspaces_by_image(const std::vector< FieldDataDescriptor< IndexSpace< N2, T2 >, Point< N, T > > > &field_data, const std::vector< IndexSpace< N2, T2 > > &sources, std::vector< IndexSpace< N, T > > &images, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
static Event compute_differences(const std::vector< IndexSpace< N, T > > &lhss, const std::vector< IndexSpace< N, T > > &rhss, std::vector< IndexSpace< N, T > > &results, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT)
Event create_equal_subspaces(size_t count, size_t granularity, std::vector< IndexSpace< N, T > > &subspaces, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
IndexSpace & operator=(const IndexSpace< N, T > &i)=default
static Event compute_union(const std::vector< IndexSpace< N, T > > &subspaces, IndexSpace< N, T > &result, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT)
Event fill(const std::vector< CopySrcDstField > &dsts, const ProfilingRequestSet &requests, const void *fill_value, size_t fill_value_size, Event wait_on=Event::NO_EVENT, int priority=0) const
Event create_subspaces_by_preimage(const DomainTransform< N2, T2, N, T > &domain_transform, const std::vector< IndexSpace< N2, T2 > > &targets, std::vector< IndexSpace< N, T > > &preimages, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
Event create_subspaces_by_image(const DomainTransform< N, T, N2, T2 > &domain_transform, const std::vector< IndexSpace< N2, T2 > > &sources, std::vector< IndexSpace< N, T > > &images, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
Event create_subspace_by_field(const std::vector< FieldDataDescriptor< IndexSpace< N, T >, FT > > &field_data, FT color, IndexSpace< N, T > &subspace, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
Event create_weighted_subspaces(size_t count, size_t granularity, const std::vector< size_t > &weights, std::vector< IndexSpace< N, T > > &subspaces, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
IndexSpace(const Realm::IndexSpace< N, T > &i)
Definition prealm.h:814
static Event compute_differences(const std::vector< IndexSpace< N, T > > &lhss, const IndexSpace< N, T > &rhs, std::vector< IndexSpace< N, T > > &results, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT)
Event copy(const std::vector< CopySrcDstField > &srcs, const std::vector< CopySrcDstField > &dsts, const std::vector< const typename CopyIndirection< N, T >::Base * > &indirects, const ProfilingRequestSet &requests, Event wait_on=Event::NO_EVENT, int priority=0) const
static Event compute_unions(const std::vector< IndexSpace< N, T > > &lhss, const std::vector< IndexSpace< N, T > > &rhss, std::vector< IndexSpace< N, T > > &results, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT)
Event create_weighted_subspaces(size_t count, size_t granularity, const std::vector< int > &weights, std::vector< IndexSpace< N, T > > &subspaces, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
Event create_subspace_by_field(const std::vector< FieldDataDescriptor< IndexSpace< N, T >, FT > > &field_data, const CodeDescriptor &codedesc, FT2 color, IndexSpace< N, T > &subspace, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
static Event compute_difference(const IndexSpace< N, T > &lhs, const IndexSpace< N, T > &rhs, IndexSpace< N, T > &result, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT)
static Event compute_differences(const IndexSpace< N, T > &lhs, const std::vector< IndexSpace< N, T > > &rhss, std::vector< IndexSpace< N, T > > &results, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT)
Event create_subspaces_by_image_with_difference(const std::vector< FieldDataDescriptor< IndexSpace< N2, T2 >, Point< N, T > > > &field_data, const std::vector< IndexSpace< N2, T2 > > &sources, const std::vector< IndexSpace< N, T > > &diff_rhs, std::vector< IndexSpace< N, T > > &images, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
Event copy(const std::vector< CopySrcDstField > &srcs, const std::vector< CopySrcDstField > &dsts, const ProfilingRequestSet &requests, Event wait_on=Event::NO_EVENT, int priority=0) const
Event create_subspace_by_preimage(const std::vector< FieldDataDescriptor< IndexSpace< N, T >, Rect< N2, T2 > > > &field_data, const IndexSpace< N2, T2 > &target, IndexSpace< N, T > &preimage, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
static Event compute_unions(const std::vector< IndexSpace< N, T > > &lhss, const IndexSpace< N, T > &rhs, std::vector< IndexSpace< N, T > > &results, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT)
Event create_subspaces_by_field(const std::vector< FieldDataDescriptor< IndexSpace< N, T >, FT > > &field_data, const CodeDescriptor &codedesc, const std::vector< FT2 > &colors, std::vector< IndexSpace< N, T > > &subspaces, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
static Event compute_unions(const IndexSpace< N, T > &lhs, const std::vector< IndexSpace< N, T > > &rhss, std::vector< IndexSpace< N, T > > &results, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT)
IndexSpace(void)
Definition prealm.h:813
Event create_subspaces_by_preimage(const std::vector< FieldDataDescriptor< IndexSpace< N, T >, Point< N2, T2 > > > &field_data, const std::vector< IndexSpace< N2, T2 > > &targets, std::vector< IndexSpace< N, T > > &preimages, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
Event create_subspaces_by_field(const std::vector< FieldDataDescriptor< IndexSpace< N, T >, FT > > &field_data, const std::vector< FT > &colors, std::vector< IndexSpace< N, T > > &subspaces, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
static Event compute_intersections(const IndexSpace< N, T > &lhs, const std::vector< IndexSpace< N, T > > &rhss, std::vector< IndexSpace< N, T > > &results, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT)
Event create_subspaces_by_preimage(const TRANSFORM &transform, const std::vector< IndexSpace< N2, T2 > > &targets, std::vector< IndexSpace< N, T > > &preimages, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
Event create_subspaces_by_image(const TRANSFORM &transform, const std::vector< IndexSpace< N2, T2 > > &sources, std::vector< IndexSpace< N, T > > &images, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
Event create_subspaces_by_image_with_difference(const DomainTransform< N, T, N2, T2 > &domain_transform, const std::vector< IndexSpace< N2, T2 > > &sources, const std::vector< IndexSpace< N, T > > &diff_rhs, std::vector< IndexSpace< N, T > > &images, const ProfilingRequestSet &reqs, Event wait_on=Event::NO_EVENT) const
Definition prealm.h:596
void get_shared_processors(Memory m, std::set< Processor > &pset, bool local_only=true) const
Machine & operator=(Machine &&m)=default
void get_all_processors(std::set< Processor > &pset) const
Machine(Machine &&m)=default
static Machine get_machine(void)
Machine & operator=(const Realm::Machine &m)
Definition prealm.h:604
void get_local_processors(std::set< Processor > &pset) const
Machine & operator=(const Machine &m)=default
void get_local_processors_by_kind(std::set< Processor > &pset, Processor::Kind kind) const
Machine(const Machine &m)=default
Machine(const Realm::Machine &m)
Definition prealm.h:599
Definition prealm.h:748
REALM_CUDA_HD ~MultiAffineAccessor(void)
MultiAffineAccessor(RegionInstance inst, FieldID field_id, size_t subfield_offset=0)
MultiAffineAccessor(RegionInstance inst, FieldID field_id, const Rect< N, T > &subrect, size_t subfield_offset=0)
MultiAffineAccessor(const MultiAffineAccessor &)=default
REALM_CUDA_HD MultiAffineAccessor(void)
Definition prealm.h:751
MultiAffineAccessor & operator=(const MultiAffineAccessor &)=default
MultiAffineAccessor(MultiAffineAccessor &&) noexcept=default
Definition prealm.h:358
ProcessorGroup(const ProcessorGroup &g)=default
static const ProcessorGroup NO_PROC_GROUP
Definition prealm.h:379
ProcessorGroup & operator=(const ProcessorGroup &g)=default
ProcessorGroup(ProcessorGroup &&g)=default
void destroy(Event wait_on=Event::NO_EVENT) const
ProcessorGroup & operator=(Realm::ProcessorGroup g)
Definition prealm.h:366
static ProcessorGroup create_group(const span< const Processor > &members)
ProcessorGroup(void)
Definition prealm.h:360
ProcessorGroup(Realm::ProcessorGroup g)
Definition prealm.h:361
static ProcessorGroup create_group(const Processor *members, size_t num_members)
ProcessorGroup & operator=(ProcessorGroup &&g)=default
Definition prealm.h:305
Processor & operator=(const Processor &p)=default
Event spawn(TaskFuncID func_id, const void *args, size_t arglen, Event wait_on=Event::NO_EVENT, int priority=0) const
Event spawn(TaskFuncID func_id, const void *args, size_t arglen, const ProfilingRequestSet &requests, Event wait_on=Event::NO_EVENT, int priority=0) const
Processor(void)
Definition prealm.h:307
static Event register_task_by_kind(Kind target_kind, bool global, TaskFuncID func_id, const CodeDescriptor &codedesc, const ProfilingRequestSet &prs, const void *user_data=0, size_t user_data_len=0)
Event register_task(TaskFuncID func_id, const CodeDescriptor &codedesc, const ProfilingRequestSet &prs, const void *user_data=0, size_t user_data_len=0) const
Processor & operator=(Realm::Processor p)
Definition prealm.h:318
static const Processor NO_PROC
Definition prealm.h:354
Processor(Realm::Processor p)
Definition prealm.h:313
Processor(Processor &&p)=default
Processor & operator=(Processor &&p)=default
Processor(::realm_id_t i)
Definition prealm.h:308
Processor(const Processor &p)=default
Definition prealm.h:408
RegionInstance & operator=(RegionInstance &&i)=default
static Event create_external_instance(RegionInstance &inst, Memory memory, InstanceLayoutGeneric *ilg, const ExternalInstanceResource &resource, const ProfilingRequestSet &prs, Event wait_on=Event::NO_EVENT)
static Event create_file_instance(RegionInstance &inst, const char *file_name, const IndexSpace< N, T > &space, const std::vector< FieldID > &field_ids, const std::vector< size_t > &field_sizes, realm_file_mode_t file_mode, const ProfilingRequestSet &prs, Event wait_on=Event::NO_EVENT)
Event redistrict(RegionInstance &instance, const InstanceLayoutGeneric *layout, const ProfilingRequestSet &prs, Event wait_on=Event::NO_EVENT)
Event fetch_metadata(Processor target) const
static Event create_instance(RegionInstance &inst, Memory memory, const IndexSpace< N, T > &space, const std::map< FieldID, size_t > &field_sizes, size_t block_size, const ProfilingRequestSet &prs, Event wait_on=Event::NO_EVENT)
Event redistrict(RegionInstance *instances, const InstanceLayoutGeneric **layouts, size_t num_layouts, const ProfilingRequestSet *prs, Event wait_on=Event::NO_EVENT)
IndexSpace< N, T > get_indexspace(void) const
Event unique_event
Definition prealm.h:490
static Event create_instance(RegionInstance &inst, Memory memory, const Rect< N, T > &rect, const std::vector< size_t > &field_sizes, size_t block_size, const ProfilingRequestSet &prs, Event wait_on=Event::NO_EVENT)
static Event create_instance(RegionInstance &inst, Memory memory, const IndexSpace< N, T > &space, const std::vector< size_t > &field_sizes, size_t block_size, const ProfilingRequestSet &prs, Event wait_on=Event::NO_EVENT)
RegionInstance(void)
Definition prealm.h:410
IndexSpace< N, int > get_indexspace(void) const
RegionInstance & operator=(const RegionInstance &i)=default
static const RegionInstance NO_INST
Definition prealm.h:485
static Event create_external_instance(RegionInstance &inst, Memory memory, const InstanceLayoutGeneric &ilg, const ExternalInstanceResource &resource, const ProfilingRequestSet &prs, Event wait_on=Event::NO_EVENT)
static Event create_instance(RegionInstance &inst, Memory memory, InstanceLayoutGeneric *ilg, const ProfilingRequestSet &prs, Event wait_on=Event::NO_EVENT)
RegionInstance(const RegionInstance &i)=default
RegionInstance(RegionInstance &&i)=default
static Event create_instance(RegionInstance &inst, Memory memory, const Rect< N, T > &rect, const std::map< FieldID, size_t > &field_sizes, size_t block_size, const ProfilingRequestSet &prs, Event wait_on=Event::NO_EVENT)
static Event create_external(RegionInstance &inst, Memory memory, uintptr_t base, InstanceLayoutGeneric *ilg, const ProfilingRequestSet &prs, Event wait_on=Event::NO_EVENT)
static Event create_instance(RegionInstance &inst, Memory memory, const InstanceLayoutGeneric &ilg, const ProfilingRequestSet &prs, Event wait_on=Event::NO_EVENT)
Definition prealm.h:263
Reservation & operator=(const Reservation &r)=default
Event acquire(unsigned mode=0, bool exclusive=true, Event wait_on=Event::NO_EVENT) const
Reservation(Reservation &&r)=default
Event try_acquire(bool retry, unsigned mode=0, bool exclusive=true, Event wait_on=Event::NO_EVENT) const
Reservation & operator=(Reservation &&r)=default
Reservation & operator=(Realm::Reservation r)
Definition prealm.h:271
Reservation(Realm::Reservation r)
Definition prealm.h:266
Reservation(void)
Definition prealm.h:265
static const Reservation NO_RESERVATION
Definition prealm.h:284
Reservation(const Reservation &r)=default
Definition prealm.h:629
Runtime & operator=(const Runtime &r)=default
void finish_configure(void)
bool register_task(Processor::TaskFuncID taskid, Processor::TaskFuncPtr taskptr)
Event collective_spawn(Processor target_proc, Processor::TaskFuncID task_id, const void *args, size_t arglen, Event wait_on=Event::NO_EVENT, int priority=0)
Module * get_module_untyped(const char *name)
Runtime(const Runtime &r)=default
void start(void)
Runtime & operator=(Runtime &&r)=default
int wait_for_shutdown(void)
void shutdown(Event wait_on=Event::NO_EVENT, int result_code=0)
Runtime(Runtime &&r)=default
Event collective_spawn_by_kind(Processor::Kind target_kind, Processor::TaskFuncID task_id, const void *args, size_t arglen, bool one_per_node=false, Event wait_on=Event::NO_EVENT, int priority=0)
Runtime(const Realm::Runtime &r)
Definition prealm.h:632
bool init(int *argc, char ***argv)
void parse_command_line(int argc, char **argv)
static Runtime get_runtime(void)
Runtime & operator=(const Realm::Runtime &r)
Definition prealm.h:637
bool configure_from_command_line(int argc, char **argv)
bool configure_from_command_line(std::vector< std::string > &cmdline, bool remove_realm_args=false)
void parse_command_line(std::vector< std::string > &cmdline, bool remove_realm_args=false)
T * get_module(const char *name)
Definition prealm.h:666
Definition prealm.h:147
void trigger(Event wait_on=Event::NO_EVENT, bool ignore_faults=false) const
UserEvent & operator=(const UserEvent &rhs)=default
UserEvent(const UserEvent &rhs)=default
static UserEvent create_user_event(void)
UserEvent(UserEvent &&rhs)=default
static const UserEvent NO_USER_EVENT
Definition prealm.h:172
UserEvent(const Realm::UserEvent &e)
Definition prealm.h:155
UserEvent(::realm_id_t i)
Definition prealm.h:150
UserEvent & operator=(UserEvent &&rhs)=default
void cancel(void) const
UserEvent & operator=(const Realm::UserEvent &e)
Definition prealm.h:158
UserEvent(void)
Definition prealm.h:149
Definition inst_layout.h:485
Definition inst_layout.h:591
Definition inst_layout.h:316
Definition indexspace.h:147
Definition faults.h:149
Definition faults.h:58
Definition event.h:242
timestamp_t timestamp
Definition event.h:247
Definition faults.h:130
Definition timers.h:51
Definition codedesc.h:249
Definition codedesc.h:317
Definition codedesc.h:347
Definition codedesc.h:367
Definition cmdline.h:34
Definition event.h:338
id_t id
Definition event.h:342
Definition indexspace.h:252
Definition indexspace.h:250
Definition cuda_access.h:42
Definition cuda_module.h:109
Definition cuda_module.h:165
Definition custom_serdez.h:150
Definition indexspace.h:214
Definition event.h:50
static const Event NO_EVENT
The value should be usued to initialize an event handle. NO_EVENT is always in has triggered state .
Definition event.h:71
id_t id
Definition event.h:54
Definition faults.h:108
Definition cuda_access.h:132
Definition cuda_access.h:95
Definition cuda_access.h:164
Definition instance.h:480
Definition instance.h:405
Definition instance.h:443
Definition reservation.h:78
WaitMode
Definition reservation.h:90
Definition codedesc.h:408
Definition codedesc.h:196
Definition inst_layout.h:515
Definition id.h:30
bool is_event(void) const
bool is_processor(void) const
bool is_barrier(void) const
Definition indexspace.h:1115
IndexSpaceGeneric & operator=(const IndexSpaceGeneric &copy_from)
Definition inst_layout.h:72
Definition inst_layout.h:164
Definition inst_layout.h:241
Definition inst_layout.h:266
Definition inst_layout.h:390
Definition inst_layout.h:358
Definition codedesc.h:172
Definition logging.h:52
Definition machine.h:287
Definition machine.h:32
Machine(void *_impl)
Definition machine.h:35
Machine & operator=(const Machine &m)
Definition machine.h:43
Definition memory.h:33
Definition module_config.h:32
Definition module.h:42
Definition codedesc.h:165
Definition point.h:259
Definition codedesc.h:182
Definition faults.h:138
Definition processor.h:199
Definition processor.h:37
id_t id
Definition processor.h:41
Kind
Definition processor.h:65
::realm_task_func_id_t TaskFuncID
Definition processor.h:58
@ TASK_ID_PROCESSOR_NOP
Definition processor.h:89
@ TASK_ID_PROCESSOR_INIT
Definition processor.h:90
@ TASK_ID_FIRST_AVAILABLE
Definition processor.h:92
@ TASK_ID_PROCESSOR_SHUTDOWN
Definition processor.h:91
Definition profiling.h:393
Definition profiling.h:363
Definition profiling.h:326
Definition profiling.h:427
Definition instance.h:66
Definition reservation.h:30
id_t id
Definition reservation.h:33
Definition runtime.h:32
Runtime & operator=(const Runtime &r)
Definition runtime.h:41
Definition custom_serdez.h:82
Definition custom_serdez.h:109
Definition indexspace.h:176
Definition subgraph.h:36
Definition indexspace.h:121
Definition codedesc.h:38
Definition event.h:205
Definition utils.h:84
#define REALM_CUDA_HD
Definition compiler_support.h:95
#define REALM_PUBLIC_API
Definition compiler_support.h:217
Definition prealm.h:29
REALM_PUBLIC_API void prealm_task_name(Realm::Processor::TaskFuncID task_id, const std::string_view &task_name)
REALM_PUBLIC_API void prealm_time_range(long long start_time_in_ns, const std::string_view &name, Realm::Event external=Realm::Event::NO_EVENT)
REALM_PUBLIC_API bool get_cuda_device_id(Processor p, int *device)
REALM_PUBLIC_API CUstream_st * get_task_cuda_stream()
REALM_PUBLIC_API void set_task_ctxsync_required(bool is_required)
char Uuid[UUID_SIZE]
Definition cuda_module.h:93
REALM_PUBLIC_API bool get_cuda_device_uuid(Processor p, Uuid *uuid)
void(* StreamAwareTaskFuncPtr)(const void *args, size_t arglen, const void *user_data, size_t user_data_len, Processor proc, CUstream_st *stream)
Definition cuda_module.h:87
Definition faults.h:41
Definition cuda_access.h:31
Definition cuda_access.h:69
Definition profiling.h:68
Definition redop.h:151
Definition codedesc.h:232
Definition activemsg.h:38
::realm_address_space_t AddressSpace
Definition memory.h:31
realm_field_id_t FieldID
Definition instance.h:45
int CustomSerdezID
Definition custom_serdez.h:148
ProfilingMeasurementID
Definition profiling.h:39
::realm_reduction_op_id_t ReductionOpID
Definition event.h:38
const size_t dynamic_extent
Definition utils.h:81
unsigned long long realm_id_t
Definition realm_c.h:64
realm_file_mode_t
Definition realm_c.h:275
unsigned long long realm_barrier_timestamp_t
Definition realm_c.h:78
Definition prealm.h:500
bool red_exclusive
Definition prealm.h:526
size_t size
Definition prealm.h:523
void * indirect
Definition prealm.h:533
CopySrcDstField & set_serdez(CustomSerdezID _serdez_id)
CopySrcDstField & set_fill(const void *_data, size_t _size)
CopySrcDstField & set_fill(T value)
CopySrcDstField & operator=(const CopySrcDstField &copy_from)
CopySrcDstField & set_indirect(int _indirect_index, FieldID _field_id, size_t _size, size_t _subfield_offset=0)
CopySrcDstField & set_field(RegionInstance _inst, FieldID _field_id, size_t _size, size_t _subfield_offset=0)
bool red_fold
Definition prealm.h:525
ReductionOpID redop_id
Definition prealm.h:524
FieldID field_id
Definition prealm.h:522
int indirect_index
Definition prealm.h:529
size_t subfield_offset
Definition prealm.h:528
CustomSerdezID serdez_id
Definition prealm.h:527
CopySrcDstField(const CopySrcDstField &copy_from)
CopySrcDstField & set_redop(ReductionOpID _redop_id, bool _is_fold, bool exclusive=false)
RegionInstance inst
Definition prealm.h:521
Definition prealm.h:541
REALM_CUDA_HD Rect(void)
Definition prealm.h:544
Event fill(const std::vector< CopySrcDstField > &dsts, const ProfilingRequestSet &requests, const void *fill_value, size_t fill_value_size, Event wait_on=Event::NO_EVENT, int priority=0) const
REALM_CUDA_HD Rect< N, T > & operator=(const Rect< N2, T2 > &rhs)
Definition prealm.h:560
REALM_CUDA_HD Rect(const Realm::Rect< N2, T2 > &rhs)
Definition prealm.h:546
Event copy(const std::vector< CopySrcDstField > &srcs, const std::vector< CopySrcDstField > &dsts, const IndexSpace< N, T > &mask, const ProfilingRequestSet &requests, Event wait_on=Event::NO_EVENT, int priority=0) const
Event copy(const std::vector< CopySrcDstField > &srcs, const std::vector< CopySrcDstField > &dsts, const ProfilingRequestSet &requests, Event wait_on=Event::NO_EVENT, int priority=0) const
REALM_CUDA_HD Rect(const Rect< N2, T2 > &rhs)
Definition prealm.h:550
REALM_CUDA_HD Rect< N, T > & operator=(const Realm::Rect< N2, T2 > &rhs)
Definition prealm.h:554
Definition event.h:255
Definition indexspace.h:59
Definition cuda_access.h:36
Definition cuda_module.h:155
Definition indexspace.h:107
Definition indexspace.h:323
Definition point.h:230
Definition point.h:55
Definition point.h:143
REALM_CUDA_HD Rect< N, T > & operator=(const Rect< N, T2 > &copy_from)
Definition redop.h:56
Definition redop.h:274
Definition subgraph.h:68