Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/realm/faults.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,16 @@ namespace Realm {
#else
// allocate space for the result of backtrace(), including the stuff on
// the front we're going to skip
assert(sizeof(void *) == sizeof(intptr_t));
static_assert(sizeof(void *) == sizeof(intptr_t),
"void* and intptr_t must be the same size");
pcs.clear();
pcs.resize(max_depth + skip, 0);
#ifdef REALM_ON_WINDOWS
int count = 0; // TODO: StackWalk appears to be the right API call?
#else
int count = backtrace((void **)pcs.data(), max_depth + skip);
#endif
assert(count >= 0);
REALM_ASSERT(count >= 0);

if(count > skip) {
pcs.erase(pcs.begin() + count, pcs.end());
Expand Down
4 changes: 2 additions & 2 deletions src/realm/fragmented_message.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

#include "realm/realm_config.h"
#include "realm/fragmented_message.h"
#include "realm/logging.h"

#include <stdexcept>
#include <assert.h>

namespace Realm {

Expand All @@ -45,7 +45,7 @@ namespace Realm {

bool FragmentedMessage::is_complete() const
{
assert(received_count <= total_chunks);
REALM_ASSERT(received_count <= total_chunks);
return received_count == total_chunks;
}

Expand Down
16 changes: 8 additions & 8 deletions src/realm/hardware_topology.cc
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ namespace Realm {
if(memory_size_kB > 0) {
memories.emplace_back(HardwareTopology::MemoryInfo{
memory_size_kB << 10, static_cast<int>(numa_node)});
assert(static_cast<int>(numa_node) == mem_node_id);
REALM_ASSERT(static_cast<int>(numa_node) == mem_node_id);
}
}
break;
Expand Down Expand Up @@ -320,9 +320,9 @@ namespace Realm {
return REALM_TOPOLOGY_ERROR_WIN32_NO_PROC_INFO;
}
proc_info = (PSYSTEM_LOGICAL_PROCESSOR_INFORMATION)malloc(proc_info_size);
assert(proc_info != 0);
REALM_ASSERT(proc_info != 0);
rc = GetLogicalProcessorInformation(proc_info, &proc_info_size);
assert(rc == TRUE);
REALM_ASSERT(rc == TRUE);

// populate _all_procs map
for(int i = 0; (i < sizeof(DWORD_PTR) * 8) && ((DWORD_PTR(1) << i) <= process_mask);
Expand Down Expand Up @@ -539,13 +539,13 @@ namespace Realm {

// system memory
hwloc_obj_t root_obj = hwloc_get_root_obj(topo);
assert(root_obj != nullptr);
REALM_ASSERT(root_obj != nullptr);
// cross check with numa memory
size_t system_mem = 0;
for(const HardwareTopology::MemoryInfo &memory : memories) {
system_mem += memory.bytes;
}
assert(system_mem == root_obj->total_memory);
REALM_ASSERT(system_mem == root_obj->total_memory);
host_memory = root_obj->total_memory;

return REALM_SUCCESS;
Expand Down Expand Up @@ -758,8 +758,8 @@ namespace Realm {
const std::vector<MemoryInfo> &memories,
const size_t host_memory)
{
assert(logical_cores.size() > 0);
assert(memories.size() > 0);
REALM_ASSERT(logical_cores.size() > 0);
REALM_ASSERT(memories.size() > 0);
// ------ Step 1: construct numa memory
for(const MemoryInfo &memory : memories) {
by_domain[memory.domain].memory_size = memory.bytes;
Expand Down Expand Up @@ -898,7 +898,7 @@ namespace Realm {
rr.push_back(x);
}
}
assert(pm.size() == all_procs.size());
REALM_ASSERT(pm.size() == all_procs.size());
return pm;
}

Expand Down
12 changes: 6 additions & 6 deletions src/realm/idx_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ namespace Realm {
template <int N, typename T>
IndexSpaceGeneric::IndexSpaceGeneric(const IndexSpace<N, T> &copy_from)
{
assert(STORAGE_BYTES >= sizeof(IndexSpaceGenericImplTyped<N, T>));
static_assert(STORAGE_BYTES >= sizeof(IndexSpaceGenericImplTyped<N, T>));
impl = new(raw_storage) IndexSpaceGenericImplTyped<N, T>(copy_from);
}

template <int N, typename T>
IndexSpaceGeneric::IndexSpaceGeneric(const Rect<N, T> &copy_from)
{
assert(STORAGE_BYTES >= sizeof(IndexSpaceGenericImplTyped<N, T>));
static_assert(STORAGE_BYTES >= sizeof(IndexSpaceGenericImplTyped<N, T>));
impl = new(raw_storage) IndexSpaceGenericImplTyped<N, T>(copy_from);
}

Expand All @@ -113,7 +113,7 @@ namespace Realm {
template <int N, typename T>
IndexSpaceGeneric &IndexSpaceGeneric::operator=(const IndexSpace<N, T> &copy_from)
{
assert(STORAGE_BYTES >= sizeof(IndexSpaceGenericImplTyped<N, T>));
static_assert(STORAGE_BYTES >= sizeof(IndexSpaceGenericImplTyped<N, T>));
if(impl)
impl->~IndexSpaceGenericImpl();
impl = new(raw_storage) IndexSpaceGenericImplTyped<N, T>(copy_from);
Expand All @@ -123,7 +123,7 @@ namespace Realm {
template <int N, typename T>
IndexSpaceGeneric &IndexSpaceGeneric::operator=(const Rect<N, T> &copy_from)
{
assert(STORAGE_BYTES >= sizeof(IndexSpaceGenericImplTyped<N, T>));
static_assert(STORAGE_BYTES >= sizeof(IndexSpaceGenericImplTyped<N, T>));
if(impl)
impl->~IndexSpaceGenericImpl();
impl = new(raw_storage) IndexSpaceGenericImplTyped<N, T>(copy_from);
Expand All @@ -137,7 +137,7 @@ namespace Realm {
{
IndexSpaceGenericImplTyped<N, T> *typed =
dynamic_cast<IndexSpaceGenericImplTyped<N, T> *>(impl);
assert(typed != 0);
REALM_ASSERT(typed != 0);
return typed->space;
}

Expand Down Expand Up @@ -199,7 +199,7 @@ namespace Realm {
Event wait_on, int priority) const
{
// TODO: move to transfer.cc for indirection goodness
assert(indirect_len == 0);
REALM_ASSERT(indirect_len == 0);
return space.copy(srcs, dsts, requests, wait_on, priority);
}

Expand Down
54 changes: 27 additions & 27 deletions src/realm/indexspace.inl
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ namespace Realm {
static size_t bsearch_map_entries(const std::vector<SparsityMapEntry<N, T>> &entries,
const Point<N, T> &p)
{
assert(N == 1);
REALM_ASSERT(N == 1);
// search range at any given time is [lo, hi)
int lo = 0;
int hi = entries.size();
Expand Down Expand Up @@ -607,10 +607,10 @@ namespace Realm {
return false;

if(e.sparsity.exists()) {
assert(0);
abort();
}
if(e.bitmap != 0) {
assert(0);
abort();
}
return true;
} else {
Expand All @@ -620,9 +620,9 @@ namespace Realm {
if(!it->bounds.contains(p))
continue;
if(it->sparsity.exists()) {
assert(0);
abort();
} else if(it->bitmap != 0) {
assert(0);
abort();
} else {
return true;
}
Expand Down Expand Up @@ -651,9 +651,9 @@ namespace Realm {
if(!it->bounds.overlaps(r))
continue;
if(it->sparsity.exists()) {
assert(0);
abort();
} else if(it->bitmap != 0) {
assert(0);
abort();
} else {
Rect<N, T> isect = it->bounds.intersection(r);
total_volume += isect.volume();
Expand Down Expand Up @@ -685,9 +685,9 @@ namespace Realm {
if(!it->bounds.overlaps(r))
continue;
if(it->sparsity.exists()) {
assert(0);
abort();
} else if(it->bitmap != 0) {
assert(0);
abort();
} else {
return true;
}
Expand Down Expand Up @@ -738,9 +738,9 @@ namespace Realm {
if(isect.empty())
continue;
if(it->sparsity.exists()) {
assert(0);
abort();
} else if(it->bitmap != 0) {
assert(0);
abort();
} else {
total += isect.volume();
}
Expand Down Expand Up @@ -792,7 +792,7 @@ namespace Realm {
if(it->contains(r))
return true;
if(it->overlaps(r))
assert(0);
abort();
}

// no entries matched, so the point is definitely not contained in this space
Expand Down Expand Up @@ -877,7 +877,7 @@ namespace Realm {
srcs.resize(dsts.size());
size_t offset = 0;
for(size_t i = 0; i < dsts.size(); i++) {
assert((offset + dsts[i].size) <= fill_value_size);
REALM_ASSERT((offset + dsts[i].size) <= fill_value_size);
srcs[i].set_fill(reinterpret_cast<const char *>(fill_value) + offset, dsts[i].size);
// special case: if a field uses all of the fill value, the next
// field (if any) is allowed to use the same value
Expand Down Expand Up @@ -962,8 +962,8 @@ namespace Realm {
// TODO(apryakhin): For now we just support building a general structured
// transform from an affince transform. This will be extended later
// to support more transform types.
assert(typeid(transform) == typeid(AffineTransform<N, N2, T2>) ||
typeid(transform) == typeid(TranslationTransform<N2, T2>));
REALM_ASSERT(typeid(transform) == typeid(AffineTransform<N, N2, T2>) ||
typeid(transform) == typeid(TranslationTransform<N2, T2>));
return create_subspaces_by_image(DomainTransform<N, T, N2, T2>(transform), sources,
images, reqs, wait_on);
}
Expand Down Expand Up @@ -1057,8 +1057,8 @@ namespace Realm {
// TODO(apryakhin): For now we just support building a general structured
// transform from an affince transform. This will be extended later
// to support more transform types.
assert(typeid(transform) == typeid(AffineTransform<N, N2, T2>) ||
typeid(transform) == typeid(TranslationTransform<N2, T2>));
REALM_ASSERT(typeid(transform) == typeid(AffineTransform<N, N2, T2>) ||
typeid(transform) == typeid(TranslationTransform<N2, T2>));
return create_subspaces_by_preimage(DomainTransform<N2, T2, N, T>(transform), targets,
preimages, reqs, wait_on);
}
Expand Down Expand Up @@ -1314,7 +1314,7 @@ namespace Realm {
template <int N, typename T>
inline void IndexSpaceIterator<N, T>::reset_sparse(SparsityMapPublicImpl<N, T> *_s_impl)
{
assert(_s_impl);
REALM_ASSERT(_s_impl);
s_impl = _s_impl;

rect = Rect<N, T>::make_empty();
Expand All @@ -1329,8 +1329,8 @@ namespace Realm {
const SparsityMapEntry<N, T> &e = entries[cur_entry];
rect = restriction.intersection(e.bounds);
if(!rect.empty()) {
assert(!e.sparsity.exists());
assert(e.bitmap == 0);
REALM_ASSERT(!e.sparsity.exists());
REALM_ASSERT(e.bitmap == 0);
valid = true;
return;
}
Expand All @@ -1344,7 +1344,7 @@ namespace Realm {
template <int N, typename T>
inline bool IndexSpaceIterator<N, T>::step(void)
{
assert(valid); // can't step an interator that's already done
REALM_ASSERT(valid); // can't step an interator that's already done

// a dense space is covered in the first step
if(!s_impl) {
Expand All @@ -1369,8 +1369,8 @@ namespace Realm {
continue;
}

assert(!e.sparsity.exists());
assert(e.bitmap == 0);
REALM_ASSERT(!e.sparsity.exists());
REALM_ASSERT(e.bitmap == 0);
return true;
}

Expand Down Expand Up @@ -1400,14 +1400,14 @@ namespace Realm {
template <int N, typename T>
inline LinearizedIndexSpace<N, T> &LinearizedIndexSpaceIntfc::as_dim(void)
{
assert((dim == N) && (idxtype == int(sizeof(T))));
REALM_ASSERT((dim == N) && (idxtype == int(sizeof(T))));
return *static_cast<LinearizedIndexSpace<N, T> *>(this);
}

template <int N, typename T>
inline const LinearizedIndexSpace<N, T> &LinearizedIndexSpaceIntfc::as_dim(void) const
{
assert((dim == N) && (idxtype == int(sizeof(T))));
REALM_ASSERT((dim == N) && (idxtype == int(sizeof(T))));
return *static_cast<const LinearizedIndexSpace<N, T> *>(this);
}

Expand Down Expand Up @@ -1450,7 +1450,7 @@ namespace Realm {
s *= bounds.hi[i] - bounds.lo[i] + 1;
}
}
assert(s == ptrdiff_t(volume));
REALM_ASSERT(s == ptrdiff_t(volume));
} else {
offset = 0;
for(int i = 0; i < N; i++)
Expand All @@ -1476,7 +1476,7 @@ namespace Realm {
size_t x = 0;
for(int i = 0; i < N; i++)
x += p[i] * strides[i];
assert(x >= offset);
REALM_ASSERT(x >= offset);
return x - offset;
}

Expand Down
Loading
Loading