P4 to Git Change 2008906 by axie@axie-hip-vdi-pal2 on 2019/10/04 18:55:34
SWDEV-189650 - [HIP-CLANG][HIP/VDI/PAL] Hangs on test hip_threadfence_system 1. In HIP + VDI + ROCm, allow SVM atomic in VEGA10 and later ASIC. GFX8 (Tonga) was enabled before. 2. In HIP + VDI + PAL Linux driver, allow SVM atomic in VEGA10 and later ASIC. Tests: 1. In HIP + VDI + ROCm, hip_threadfence_system test passed. 2. In HIP + VDI + PAL + Linux , hip_threadfence_system test passed. 3. OpenCL + PAL, clinfo and ocltest runtime test pass. 4. OpenCL + ROCM, clinfo and ocltest runtime test pass. 5. Windows 10, VEGA 10, clinfo and and ocltest runtime test pass. hip_threadfence_system test passed by skipping the test. Teamcity presubmission test: http://ocltc.amd.com:8111/viewModification.html?modId=127083&personal=true&tab=vcsModificationBuilds http://ocltc.amd.com:8111/viewModification.html?modId=127076&personal=true&tab=vcsModificationBuilds ReviewBoard: http://ocltc.amd.com/reviews/r/18077/ Affected files ... ... //depot/stg/opencl/drivers/opencl/api/hip/hip_memory.cpp#73 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#171 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#80 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.hpp#31 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#134 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.cpp#44 edit ... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#320 edit
This commit is contained in:
1 orang tua
3bfe682c3f
melakukan
d3b6a9731c
6 files changed
+69
-10
No files matched your search
@@ -275,6 +275,7 @@ Resource::Resource(const Device& gpuDev, size_t size)
|
||||
desc_.scratch_ = false;
|
||||
desc_.isAllocExecute_ = false;
|
||||
desc_.baseLevel_ = 0;
|
||||
desc_.gl2CacheDisabled_ = false;
|
||||
gpuDev.addResource(this);
|
||||
}
|
||||
|
||||
@@ -311,7 +312,7 @@ Resource::Resource(const Device& gpuDev, size_t width, size_t height, size_t dep
|
||||
desc_.scratch_ = false;
|
||||
desc_.isAllocExecute_ = false;
|
||||
desc_.baseLevel_ = 0;
|
||||
|
||||
desc_.gl2CacheDisabled_ = false;
|
||||
switch (imageType) {
|
||||
case CL_MEM_OBJECT_IMAGE2D:
|
||||
desc_.dimSize_ = 2;
|
||||
@@ -1194,6 +1195,9 @@ bool Resource::create(MemoryType memType, CreateParams* params, bool forceLinear
|
||||
svmPtr = reinterpret_cast<Pal::gpusize>(params->owner_->getSvmPtr());
|
||||
desc_.SVMRes_ = true;
|
||||
svmPtr = (svmPtr == 1) ? 0 : svmPtr;
|
||||
if (params->owner_->getMemFlags() & CL_MEM_SVM_ATOMICS) {
|
||||
desc_.gl2CacheDisabled_ = true;
|
||||
}
|
||||
}
|
||||
if (desc_.SVMRes_) {
|
||||
return CreateSvm(params, svmPtr);
|
||||
@@ -1958,6 +1962,23 @@ bool FineMemorySubAllocator::CreateChunk(const Pal::IGpuMemory* reserved_va) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
bool FineUncachedMemorySubAllocator::CreateChunk(const Pal::IGpuMemory* reserved_va) {
|
||||
Pal::SvmGpuMemoryCreateInfo createInfo = {};
|
||||
createInfo.isUsedForKernel = false;
|
||||
createInfo.size = device_->settings().subAllocationChunkSize_;
|
||||
createInfo.alignment = MaxGpuAlignment;
|
||||
createInfo.flags.useReservedGpuVa = (reserved_va != nullptr);
|
||||
createInfo.pReservedGpuVaOwner = reserved_va;
|
||||
createInfo.flags.gl2Uncached = true;
|
||||
GpuMemoryReference* mem_ref = GpuMemoryReference::Create(*device_, createInfo);
|
||||
if ((mem_ref != nullptr) && InitAllocator(mem_ref)) {
|
||||
mem_ref->iMem()->Map(&mem_ref->cpuAddress_);
|
||||
return mem_ref->cpuAddress_ != nullptr;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
MemorySubAllocator::~MemorySubAllocator() {
|
||||
// Release memory heap for suballocations
|
||||
@@ -2044,7 +2065,11 @@ bool ResourceCache::addGpuMemory(Resource::Descriptor* desc, GpuMemoryReference*
|
||||
} else if ((desc->type_ == Resource::Local) && desc->SVMRes_) {
|
||||
result = mem_sub_alloc_coarse_.Free(&lockCacheOps_, ref, offset);
|
||||
} else if (desc->SVMRes_) {
|
||||
result = mem_sub_alloc_fine_.Free(&lockCacheOps_, ref, offset);
|
||||
if (desc->gl2CacheDisabled_) {
|
||||
result = mem_sub_alloc_fine_uncached_.Free(&lockCacheOps_, ref, offset);
|
||||
} else {
|
||||
result = mem_sub_alloc_fine_.Free(&lockCacheOps_, ref, offset);
|
||||
}
|
||||
}
|
||||
|
||||
// If a resource was a suballocation, don't try to cache it
|
||||
@@ -2095,7 +2120,11 @@ GpuMemoryReference* ResourceCache::findGpuMemory(Resource::Descriptor* desc, Pal
|
||||
} else if ((desc->type_ == Resource::Local) && desc->SVMRes_) {
|
||||
ref = mem_sub_alloc_coarse_.Allocate(size, alignment, reserved_va, offset);
|
||||
} else if (desc->SVMRes_) {
|
||||
ref = mem_sub_alloc_fine_.Allocate(size, alignment, reserved_va, offset);
|
||||
if (desc->gl2CacheDisabled_) {
|
||||
ref = mem_sub_alloc_fine_uncached_.Allocate(size, alignment, reserved_va, offset);
|
||||
} else {
|
||||
ref = mem_sub_alloc_fine_.Allocate(size, alignment, reserved_va, offset);
|
||||
}
|
||||
}
|
||||
|
||||
if (ref != nullptr) {
|
||||
|
||||
Reference in new issue
Block a user