P4 to Git Change 1466145 by todli@todli-ubuntu on 2017/10/03 21:32:44

SWDEV-126904 - rocm Pipe: fill device info for Pipe, and initialize Pipe memory object according to clk_pipe_t structure

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#67 edit


[ROCm/clr commit: 55a4b40473]
This commit is contained in:
foreman
2017-10-03 21:40:52 -04:00
parent 70e53cd287
commit a958ec0cdd
@@ -1126,6 +1126,10 @@ bool Device::populateOCLDeviceConstants() {
info_.threadTraceEnable_ = false;
}
info_.maxPipePacketSize_ = info_.maxMemAllocSize_;
info_.maxPipeActiveReservations_ = 16;
info_.maxPipeArgs_ = 16;
return true;
}
@@ -1316,6 +1320,14 @@ device::Memory* Device::createMemory(amd::Memory& owner) const {
return nullptr;
}
// Initialize if the memory is a pipe object
if (owner.getType() == CL_MEM_OBJECT_PIPE) {
// Pipe initialize in order read_idx, write_idx, end_idx. Refer clk_pipe_t structure.
// Init with 3 DWORDS for 32bit addressing and 6 DWORDS for 64bit
size_t pipeInit[3] = { 0, 0, owner.asPipe()->getMaxNumPackets() };
xferMgr().writeBuffer((void *)pipeInit, *memory, amd::Coord3D(0), amd::Coord3D(sizeof(pipeInit)));
}
// Transfer data only if OCL context has one device.
// Cache coherency layer will update data for multiple devices
if (!memory->isHostMemDirectAccess() && owner.asImage() && (owner.parent() == nullptr) &&