mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 05:56:36 +08:00
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:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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() ||
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user