MCPcopy Create free account
hub / github.com/ROCm/clr / cacheWriteBack

Method cacheWriteBack

rocclr/platform/memory.cpp:506–522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504}
505
506void Memory::cacheWriteBack(device::VirtualDevice* vDev) {
507 if (NULL != lastWriter_) {
508 device::Memory* dmem = getDeviceMemory(*lastWriter_);
509 //! @note It's a special condition, when a subbuffer was created,
510 //! but never used. Thus dev memory is still NULL and lastWriter_
511 //! was passed from the parent.
512 if (NULL != dmem) {
513 dmem->syncHostFromCache(vDev);
514 }
515 } else if (isParent()) {
516 // On CPU parent can't be synchronized, because lastWriter_ could be NULL
517 // and syncHostFromCache() won't be called.
518 for (uint i = 0; i < numDevices_; ++i) {
519 deviceMemories_[i].value_->syncHostFromCache(vDev);
520 }
521 }
522}
523
524void Memory::copyToBackingStore(void* initFrom) { memcpy(getHostMem(), initFrom, size_); }
525

Callers 5

submitMapMemoryMethod · 0.80
submitSvmMapMemoryMethod · 0.80
mgpuCacheWriteBackMethod · 0.80
mgpuCacheWriteBackMethod · 0.80
submitMapMemoryMethod · 0.80

Calls 1

syncHostFromCacheMethod · 0.45

Tested by

no test coverage detected