Add notify functions to enqueue read buffer and image calls

This commit adds notifications to enqueue read buffer and image calls
and setters/getters to mark/check if an allocation is dumpable.

Change-Id: I123f24752d2a86abcf934e0d404f4e0ecf1729cc
This commit is contained in:
Milczarek, Slawomir
2018-08-22 18:41:52 +02:00
parent b91c14f70e
commit f6f9c0f456
9 changed files with 66 additions and 0 deletions

View File

@@ -76,6 +76,9 @@ class CommandQueueHw : public CommandQueue {
return new CommandQueueHw<GfxFamily>(context, device, properties);
}
MOCKABLE_VIRTUAL void notifyEnqueueReadBuffer(Buffer *buffer, bool blockingRead);
MOCKABLE_VIRTUAL void notifyEnqueueReadImage(Image *image, bool blockingRead);
cl_int enqueueBarrierWithWaitList(cl_uint numEventsInWaitList,
const cl_event *eventWaitList,
cl_event *event) override;

View File

@@ -41,3 +41,12 @@
#include "runtime/command_queue/enqueue_write_image.h"
#include "runtime/command_queue/finish.h"
#include "runtime/command_queue/flush.h"
namespace OCLRT {
template <typename Family>
void CommandQueueHw<Family>::notifyEnqueueReadBuffer(Buffer *buffer, bool blockingRead) {
}
template <typename Family>
void CommandQueueHw<Family>::notifyEnqueueReadImage(Image *image, bool blockingRead) {
}
} // namespace OCLRT

View File

@@ -45,6 +45,8 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBuffer(
const cl_event *eventWaitList,
cl_event *event) {
notifyEnqueueReadBuffer(buffer, !!blockingRead);
cl_int retVal = CL_SUCCESS;
bool isMemTransferNeeded = buffer->isMemObjZeroCopy() ? buffer->checkIfMemoryTransferIsRequired(offset, 0, ptr, CL_COMMAND_READ_BUFFER) : true;
if ((DebugManager.flags.DoCpuCopyOnReadBuffer.get() ||

View File

@@ -50,6 +50,8 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadImage(
const cl_event *eventWaitList,
cl_event *event) {
notifyEnqueueReadImage(srcImage, !!blockingRead);
MultiDispatchInfo di;
auto isMemTransferNeeded = true;
if (srcImage->isMemObjZeroCopy()) {

View File

@@ -136,6 +136,8 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
void setAubWritable(bool writable) { aubWritable = writable; }
bool isAubWritable() const { return aubWritable; }
void setAllocDumpable(bool dumpable) { allocDumpable = dumpable; }
bool isAllocDumpable() const { return allocDumpable; }
bool isMemObjectsAllocationWithWritableFlags() const { return memObjectsAllocationWithWritableFlags; }
void setMemObjectsAllocationWithWritableFlags(bool newValue) { memObjectsAllocationWithWritableFlags = newValue; }
@@ -160,6 +162,7 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
uint32_t inspectionId = 0;
AllocationType allocationType = AllocationType::UNKNOWN;
bool aubWritable = true;
bool allocDumpable = false;
bool memObjectsAllocationWithWritableFlags = false;
};
} // namespace OCLRT