You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// object_sz (size_t) ! should only be used in the finalizer, in other cases where coarray_handle can be accessed, the object_sz may not reflect the size of the data that we are dealing with
90
+
// allocator (int64_t)
91
+
// object_base_addr_ptr (char*)
92
+
// TODO: add pointer to beginning of next coarray handle's addr
93
+
94
+
// aliased coarray handle will have all of the elements of a coarray handle filled in
95
+
// expect it will have no data in the Fortran object elements
96
+
// the pointer to where the data begins will point back to the memory in the original
97
+
// coarray handle where memory was allocated for the data
98
+
99
+
// every time one accesses a coarray, need to traverse an extra level of indirection to get to the elements
100
+
//
101
+
102
+
// currently unused allocator field
103
+
// which allocator it came from
104
+
// 1 - symmetric allocator with initial team
105
+
// 2 - stack of allocators for each child team
106
+
// ...
107
+
// maybe need more for each team
108
+
109
+
// TODO: Do we need to add alignment padding here for the elements? such as when dealing with c_long_double?
110
+
// How do you ensure that memory given to c_f_pointer is aligned correctly for Fortran for the given datatype?
111
+
// - will become global setting that is decided at runtime, or add arg to caf_allocate for minimum alignment
112
+
113
+
intmax_t*lcobounds=desc_lcobounds->base_addr;
114
+
intmax_t*ucobounds=desc_ucobounds->base_addr;
115
+
116
+
assert(corank >= 1); // corank must be 1 or more (coarray)
117
+
assert(desc_lcobounds->rank==1&&desc_ucobounds->rank==1); // the lcobounds and ucobounds arrays must be 1d
118
+
assert(desc_lcobounds->dim[0].extent==desc_ucobounds->dim[0].extent); // size of each cobounds array must be the same
119
+
assert(desc_lcobounds->dim[0].extent==corank); // size of cobounds arrays must be equal to corank
120
+
for(inti=0; i<corank; i++) {
121
+
assert(lcobounds[i] <= ucobounds[i]); // lcobounds must not be greater than ucobounds
0 commit comments