mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-28 16:48:45 +08:00
Fix correct command buffer estimation for non-kernel enqueue calls
Change-Id: I8655d1824c229f13104e085f55fa15c310a17210
This commit is contained in:
committed by
sys_ocldev
parent
2110ba6ca4
commit
2d7077e138
@@ -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;
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user