SWDEV-310181 - Fix for AtoH Memcpy tests failure

Change-Id: Ibf8c8c01257f0516088d50d5c9f82040ed8fa067
This commit is contained in:
Sarbojit Sarkar
2021-11-25 06:16:16 +00:00
zatwierdzone przez Sarbojit Sarkar
rodzic d4ad981c0c
commit 02dc6f9f9a
2 zmienionych plików z 16 dodań i 0 usunięć
+13
Wyświetl plik
@@ -1137,6 +1137,19 @@ bool Image::create() {
return createInteropImage();
}
// Checking if original device memory can be accessed by peer devices
device::Memory* orgDevMem = owner()->getOriginalDeviceMemory();
if (amd::IS_HIP &&
orgDevMem != nullptr && orgDevMem->getAllowedPeerAccess()) {
roc::Image* orgImage = static_cast<roc::Image*>(orgDevMem);
// fill all required values
deviceImageInfo_ = orgImage->deviceImageInfo_;
permission_ = orgImage->permission_;
deviceMemory_ = orgImage->deviceMemory_;
hsaImageObject_ = orgImage->hsaImageObject_;
return true;
}
// Get memory size requirement for device specific image.
hsa_status_t status = hsa_ext_image_data_get_info(dev().getBackendDevice(), &imageDescriptor_,
permission_, &deviceImageInfo_);
+3
Wyświetl plik
@@ -294,6 +294,9 @@ class Memory : public amd::RuntimeObject {
bool alloc = true //!< Allocates memory
);
//! Get origianl device memory
device::Memory* getOriginalDeviceMemory() const { return deviceMemories_[0].value_; };
//! Allocate host memory (as required)
bool allocHostMemory(void* initFrom, //!< Host memory provided by the application
bool allocHostMem, //!< Force system memory allocation