Fix correct command buffer estimation for non-kernel enqueue calls

Change-Id: I8655d1824c229f13104e085f55fa15c310a17210
This commit is contained in:
Zdanowicz, Zbigniew
2018-10-03 22:31:25 +02:00
committed by sys_ocldev
parent 2110ba6ca4
commit 2d7077e138
4 changed files with 21 additions and 22 deletions

View File

@@ -34,6 +34,22 @@ enum class QueuePriority {
HIGH
};
inline bool shouldFlushDC(uint32_t commandType, PrintfHandler *printfHandler) {
return (commandType == CL_COMMAND_READ_BUFFER ||
commandType == CL_COMMAND_READ_BUFFER_RECT ||
commandType == CL_COMMAND_READ_IMAGE ||
commandType == CL_COMMAND_SVM_MAP ||
printfHandler);
}
inline bool isCommandWithoutKernel(uint32_t commandType) {
return ((commandType == CL_COMMAND_BARRIER) || (commandType == CL_COMMAND_MARKER) ||
(commandType == CL_COMMAND_MIGRATE_MEM_OBJECTS) ||
(commandType == CL_COMMAND_SVM_MAP) ||
(commandType == CL_COMMAND_SVM_UNMAP) ||
(commandType == CL_COMMAND_SVM_FREE));
}
template <>
struct OpenCLObjectMapper<_cl_command_queue> {
typedef class CommandQueue DerivedType;

View File

@@ -34,22 +34,6 @@
namespace OCLRT {
inline bool shouldFlushDC(uint32_t commandType, PrintfHandler *printfHandler) {
return (commandType == CL_COMMAND_READ_BUFFER ||
commandType == CL_COMMAND_READ_BUFFER_RECT ||
commandType == CL_COMMAND_READ_IMAGE ||
commandType == CL_COMMAND_SVM_MAP ||
printfHandler);
}
inline bool isCommandWithoutKernel(uint32_t commandType) {
return ((commandType == CL_COMMAND_BARRIER) || (commandType == CL_COMMAND_MARKER) ||
(commandType == CL_COMMAND_MIGRATE_MEM_OBJECTS) ||
(commandType == CL_COMMAND_SVM_MAP) ||
(commandType == CL_COMMAND_SVM_UNMAP) ||
(commandType == CL_COMMAND_SVM_FREE));
}
template <typename GfxFamily>
template <uint32_t commandType, size_t surfaceCount>
void CommandQueueHw<GfxFamily>::enqueueHandler(Surface *(&surfaces)[surfaceCount],

View File

@@ -444,12 +444,9 @@ size_t EnqueueOperation<GfxFamily>::getTotalSizeRequiredCS(bool reserveProfiling
template <typename GfxFamily>
size_t EnqueueOperation<GfxFamily>::getSizeRequiredCS(uint32_t cmdType, bool reserveProfilingCmdsSpace, bool reservePerfCounters, CommandQueue &commandQueue, const Kernel *pKernel) {
switch (cmdType) {
case CL_COMMAND_MIGRATE_MEM_OBJECTS:
case CL_COMMAND_MARKER:
if (isCommandWithoutKernel(cmdType)) {
return EnqueueOperation<GfxFamily>::getSizeRequiredCSNonKernel(reserveProfilingCmdsSpace, reservePerfCounters, commandQueue);
case CL_COMMAND_NDRANGE_KERNEL:
default:
} else {
return EnqueueOperation<GfxFamily>::getSizeRequiredCSKernel(reserveProfilingCmdsSpace, reservePerfCounters, commandQueue, pKernel);
}
}