Files
compute-runtime/opencl/source/helpers/enqueue_properties.h
Piotr Zdunowski 7cac94b597 Fix profiling for marker commands.
Resolves: NEO-4867

Signed-off-by: Piotr Zdunowski <piotr.zdunowski@intel.com>
2021-05-27 12:15:07 +02:00

66 lines
1.8 KiB
C++

/*
* Copyright (C) 2019-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/helpers/blit_commands_helper.h"
namespace NEO {
struct EnqueueProperties {
enum class Operation {
None,
Blit,
ExplicitCacheFlush,
EnqueueWithoutSubmission,
DependencyResolveOnGpu,
GpuKernel,
ProfilingOnly
};
EnqueueProperties() = delete;
EnqueueProperties(bool blitEnqueue, bool hasKernels, bool isCacheFlushCmd, bool flushDependenciesOnly, bool isMarkerWithEvent,
const BlitPropertiesContainer *blitPropertiesContainer) {
if (blitEnqueue) {
operation = Operation::Blit;
this->blitPropertiesContainer = blitPropertiesContainer;
return;
}
if (hasKernels) {
operation = Operation::GpuKernel;
this->blitPropertiesContainer = blitPropertiesContainer;
return;
}
if (isCacheFlushCmd) {
operation = Operation::ExplicitCacheFlush;
return;
}
if (flushDependenciesOnly) {
operation = Operation::DependencyResolveOnGpu;
return;
}
if (isMarkerWithEvent) {
operation = Operation::ProfilingOnly;
return;
}
operation = Operation::EnqueueWithoutSubmission;
}
bool isFlushWithoutKernelRequired() const {
return (operation == Operation::Blit) || (operation == Operation::ExplicitCacheFlush) ||
(operation == Operation::DependencyResolveOnGpu) || (operation == EnqueueProperties::Operation::ProfilingOnly);
}
const BlitPropertiesContainer *blitPropertiesContainer = nullptr;
Operation operation = Operation::EnqueueWithoutSubmission;
};
} // namespace NEO