Skip to content

Commit

Permalink
asdf 2
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Rift <[email protected]>
  • Loading branch information
riftEmber committed Jan 29, 2025
1 parent f3837a2 commit 43d1590
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions modules/internal/ChapelHashtable.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,32 @@ module ChapelHashtable {

const sizeofElement = _ddata_sizeof_element(ret);

inline proc ptrTo(ref x) {
return c_pointer_return(x);
}

select initMethod {
when ArrayInit.noInit {
// do nothing
}
when ArrayInit.serialInit {
for slot in _allSlots(size) {
var x = c_addrOf(ret[slot]);
var y = ptrTo(ret[slot]);
if x != y then {
halt("waat");
}
memset(c_addrOf(ret[slot]), 0:uint(8), sizeofElement.safeCast(c_size_t));
}
}
when ArrayInit.parallelInit {
// This should match the 'these' iterator in terms of idx->task
forall slot in _allSlots(size) {
var x = c_addrOf(ret[slot]);
var y = ptrTo(ret[slot]);
if x != y then {
halt("waat");
}
memset(c_addrOf(ret[slot]), 0:uint(8), sizeofElement.safeCast(c_size_t));
}
}
Expand Down

0 comments on commit 43d1590

Please sign in to comment.