| 504 | } |
| 505 | |
| 506 | void 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 | |
| 524 | void Memory::copyToBackingStore(void* initFrom) { memcpy(getHostMem(), initFrom, size_); } |
| 525 |
no test coverage detected