P4 to Git Change 1597023 by vsytchen@vsytchen-win10 on 2018/08/22 15:12:23
SWDEV-159881 - [OCL][ROCm] Add SVM coarse-grain buffer support with device memory 1. Use the system memory pool for coarse grain allocations on APUs ReviewBoardURL = http://ocltc.amd.com/reviews/r/15671/diff/ Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.cpp#39 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#64 edit
Cette révision appartient à :
@@ -589,7 +589,8 @@ void Buffer::destroy() {
|
||||
cl_mem_flags memFlags = owner()->getMemFlags();
|
||||
|
||||
if (owner()->getSvmPtr() != nullptr) {
|
||||
if (dev().forceFineGrain(owner())) {
|
||||
if (dev().forceFineGrain(owner()) ||
|
||||
dev().isFineGrainedSystem(true)) {
|
||||
memFlags |= CL_MEM_SVM_FINE_GRAIN_BUFFER;
|
||||
}
|
||||
const bool isFineGrain = memFlags & CL_MEM_SVM_FINE_GRAIN_BUFFER;
|
||||
@@ -657,7 +658,8 @@ bool Buffer::create() {
|
||||
cl_mem_flags memFlags = owner()->getMemFlags();
|
||||
|
||||
if (owner()->getSvmPtr() != nullptr) {
|
||||
if (dev().forceFineGrain(owner())) {
|
||||
if (dev().forceFineGrain(owner()) ||
|
||||
dev().isFineGrainedSystem(true)) {
|
||||
memFlags |= CL_MEM_SVM_FINE_GRAIN_BUFFER;
|
||||
flags_ |= HostMemoryDirectAccess;
|
||||
}
|
||||
|
||||
@@ -1215,7 +1215,7 @@ void VirtualGPU::submitSvmCopyMemory(amd::SvmCopyMemoryCommand& cmd) {
|
||||
|
||||
profilingBegin(cmd);
|
||||
// no op for FGS supported device
|
||||
if (!dev().isFineGrainedSystem()) {
|
||||
if (!dev().isFineGrainedSystem(true)) {
|
||||
amd::Coord3D srcOrigin(0, 0, 0);
|
||||
amd::Coord3D dstOrigin(0, 0, 0);
|
||||
amd::Coord3D size(cmd.srcSize(), 1, 1);
|
||||
@@ -1374,7 +1374,7 @@ void VirtualGPU::submitSvmMapMemory(amd::SvmMapMemoryCommand& cmd) {
|
||||
profilingBegin(cmd);
|
||||
|
||||
// no op for FGS supported device
|
||||
if (!dev().isFineGrainedSystem() &&
|
||||
if (!dev().isFineGrainedSystem(true) &&
|
||||
!dev().forceFineGrain(cmd.getSvmMem())) {
|
||||
// Make sure we have memory for the command execution
|
||||
Memory* memory = dev().getRocMemory(cmd.getSvmMem());
|
||||
@@ -1410,7 +1410,7 @@ void VirtualGPU::submitSvmUnmapMemory(amd::SvmUnmapMemoryCommand& cmd) {
|
||||
profilingBegin(cmd);
|
||||
|
||||
// no op for FGS supported device
|
||||
if (!dev().isFineGrainedSystem() &&
|
||||
if (!dev().isFineGrainedSystem(true) &&
|
||||
!dev().forceFineGrain(cmd.getSvmMem())) {
|
||||
Memory* memory = dev().getRocMemory(cmd.getSvmMem());
|
||||
const device::Memory::WriteMapInfo* writeMapInfo = memory->writeMapInfo(cmd.svmPtr());
|
||||
@@ -1700,7 +1700,7 @@ void VirtualGPU::submitSvmFillMemory(amd::SvmFillMemoryCommand& cmd) {
|
||||
|
||||
amd::Memory* dstMemory = amd::MemObjMap::FindMemObj(cmd.dst());
|
||||
|
||||
if (!dev().isFineGrainedSystem() ||
|
||||
if (!dev().isFineGrainedSystem(true) ||
|
||||
((dstMemory != nullptr) &&
|
||||
!dev().forceFineGrain(dstMemory))) {
|
||||
size_t patternSize = cmd.patternSize();
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur