Aux translation [4/n]: Lock BuiltIn Kernel + refactor BuiltIns locking

Change-Id: Ic7dc9b86a4aa5f93f1c4bcdf80b9598ecdff9713
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2018-08-13 12:24:17 +02:00
committed by sys_ocldev
parent d3d8b6f905
commit a5950500a3
21 changed files with 152 additions and 77 deletions

View File

@@ -79,7 +79,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBufferRect(
}
auto &builder = BuiltIns::getInstance().getBuiltinDispatchInfoBuilder(EBuiltInOps::CopyBufferRect,
this->getContext(), this->getDevice());
builder.takeOwnership(this->context);
BuiltInOwnershipWrapper builtInLock(builder, this->context);
size_t hostPtrSize = Buffer::calculateHostPtrSize(hostOrigin, region, hostRowPitch, hostSlicePitch);
void *dstPtr = ptr;
@@ -93,7 +93,6 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBufferRect(
region[2] != 0) {
bool status = createAllocationForHostSurface(hostPtrSurf);
if (!status) {
builder.releaseOwnership();
return CL_OUT_OF_RESOURCES;
}
dstPtr = reinterpret_cast<void *>(hostPtrSurf.getAllocation()->getGpuAddressToPatch());
@@ -119,8 +118,6 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBufferRect(
eventWaitList,
event);
builder.releaseOwnership();
if (context->isProvidingPerformanceHints()) {
context->providePerformanceHint(CL_CONTEXT_DIAGNOSTICS_LEVEL_BAD_INTEL, CL_ENQUEUE_READ_BUFFER_RECT_REQUIRES_COPY_DATA, static_cast<cl_mem>(buffer), ptr);
if (!isL3Capable(ptr, hostPtrSize)) {