SWDEV-430256 - Expose HIP_FORCE_DEV_KERNARG under PAL
Add support of HIP_FORCE_DEV_KERNARG under PAL. Fix persistent memory detection for a resource view. Change-Id: Ifb7db2db14e0c2205a9661cfa53887ec61ab26a4
此提交包含在:
@@ -1828,9 +1828,7 @@ void* Resource::gpuMemoryMap(size_t* pitch, uint flags, Pal::IGpuMemory* resourc
|
||||
// ================================================================================================
|
||||
void Resource::gpuMemoryUnmap(Pal::IGpuMemory* resource) const {
|
||||
if (desc_.cardMemory_ && !isPersistentDirectMap()) {
|
||||
// @todo remove const cast
|
||||
Unimplemented();
|
||||
// const_cast<Device&>(dev()).resUnmapLocal(resource);
|
||||
} else {
|
||||
Pal::Result result = resource->Unmap();
|
||||
if (Pal::Result::Success != result) {
|
||||
@@ -1928,6 +1926,10 @@ bool Resource::isPersistentDirectMap(bool writeMap) const {
|
||||
directMap = IS_WINDOWS && !dev().settings().linearPersistentImage_;
|
||||
}
|
||||
|
||||
if (memoryType() == View) {
|
||||
directMap = viewOwner_->isPersistentDirectMap();
|
||||
}
|
||||
|
||||
return directMap;
|
||||
}
|
||||
|
||||
|
||||
@@ -147,6 +147,7 @@ Settings::Settings() {
|
||||
alwaysResident_ = amd::IS_HIP ? true : false;
|
||||
prepinnedMinSize_ = 0;
|
||||
cpDmaCopySizeMax_ = GPU_CP_DMA_COPY_SIZE * Ki;
|
||||
useDeviceKernelArg_ = flagIsDefault(HIP_FORCE_DEV_KERNARG) ? false : HIP_FORCE_DEV_KERNARG;
|
||||
}
|
||||
|
||||
bool Settings::create(const Pal::DeviceProperties& palProp,
|
||||
|
||||
@@ -80,7 +80,8 @@ class Settings : public device::Settings {
|
||||
uint imageBufferWar_ : 1; //!< Image buffer workaround for Gfx10
|
||||
uint disableSdma_ : 1; //!< Disable SDMA support
|
||||
uint alwaysResident_ : 1; //!< Make resources resident at allocation time
|
||||
uint reserved_ : 9;
|
||||
uint useDeviceKernelArg_ : 1; //!< Use persistent memory for kernel arguments
|
||||
uint reserved_ : 8;
|
||||
};
|
||||
uint value_;
|
||||
};
|
||||
|
||||
@@ -949,8 +949,17 @@ bool VirtualGPU::create(bool profiling, uint deviceQueueSize, uint rtCUs,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!managedBuffer_.create(Resource::RemoteUSWC)) {
|
||||
return false;
|
||||
// Create buffers for kernel arg management
|
||||
if (!managedBuffer_.create(
|
||||
dev().settings().useDeviceKernelArg_ ? Resource::Persistent : Resource::RemoteUSWC)) {
|
||||
// Try just USWC if persistent memory failed
|
||||
if (dev().settings().useDeviceKernelArg_) {
|
||||
if (!managedBuffer_.create(Resource::RemoteUSWC)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Diable double copy optimization,
|
||||
|
||||
新增問題並參考
封鎖使用者