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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ static DeviceType infer_device_type_from_memory_and_processor(
device_type = DeviceType::CPU;
break;
case Realm::Memory::GPU_FB_MEM:
case Realm::Memory::GPU_DYNAMIC_MEM:
// Only accessible on GPU
device_type = DeviceType::GPU;
break;
Expand Down
15 changes: 12 additions & 3 deletions lib/realm-execution/src/realm-execution/realm_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,21 @@ Realm::Memory RealmContext::get_nearest_memory(Realm::Processor proc) {
return Realm::Memory::NO_MEMORY;
}

// FIMXE: this isn't going to do what you expect until
// https://github.com/StanfordLegion/realm/pull/392 merges
Realm::Machine::MemoryQuery mq(Realm::Machine::get_machine());
mq.best_affinity_to(proc);
ASSERT(mq.count() > 0);
return mq.first();

// Among the best memories, pick the one with the largest capacity
Realm::Memory result = Realm::Memory::NO_MEMORY;
for (Realm::Machine::MemoryQuery::iterator it = mq.begin(); it != mq.end();
++it) {
if (!result.exists() || it->capacity() > result.capacity()) {
result = *it;
}
}

ASSERT(result.exists());
return result;
}

Realm::Processor RealmContext::get_current_processor() const {
Expand Down
Loading