2019-11-07 16:15:53 +08:00
|
|
|
/*
|
2021-05-17 02:51:16 +08:00
|
|
|
* Copyright (C) 2019-2021 Intel Corporation
|
2019-11-07 16:15:53 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/helpers/blit_commands_helper.h"
|
2019-11-07 16:15:53 +08:00
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
|
|
|
struct EnqueueProperties {
|
|
|
|
enum class Operation {
|
2020-06-24 19:32:09 +08:00
|
|
|
None,
|
2019-11-07 16:15:53 +08:00
|
|
|
Blit,
|
|
|
|
ExplicitCacheFlush,
|
|
|
|
EnqueueWithoutSubmission,
|
|
|
|
DependencyResolveOnGpu,
|
|
|
|
GpuKernel,
|
2021-05-20 23:07:00 +08:00
|
|
|
ProfilingOnly
|
2019-11-07 16:15:53 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
EnqueueProperties() = delete;
|
2021-05-20 23:07:00 +08:00
|
|
|
EnqueueProperties(bool blitEnqueue, bool hasKernels, bool isCacheFlushCmd, bool flushDependenciesOnly, bool isMarkerWithEvent,
|
2019-11-07 16:15:53 +08:00
|
|
|
const BlitPropertiesContainer *blitPropertiesContainer) {
|
|
|
|
if (blitEnqueue) {
|
|
|
|
operation = Operation::Blit;
|
|
|
|
this->blitPropertiesContainer = blitPropertiesContainer;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hasKernels) {
|
|
|
|
operation = Operation::GpuKernel;
|
2019-11-10 02:02:25 +08:00
|
|
|
this->blitPropertiesContainer = blitPropertiesContainer;
|
2019-11-07 16:15:53 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isCacheFlushCmd) {
|
|
|
|
operation = Operation::ExplicitCacheFlush;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (flushDependenciesOnly) {
|
|
|
|
operation = Operation::DependencyResolveOnGpu;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-05-20 23:07:00 +08:00
|
|
|
if (isMarkerWithEvent) {
|
|
|
|
operation = Operation::ProfilingOnly;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-11-07 16:15:53 +08:00
|
|
|
operation = Operation::EnqueueWithoutSubmission;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isFlushWithoutKernelRequired() const {
|
|
|
|
return (operation == Operation::Blit) || (operation == Operation::ExplicitCacheFlush) ||
|
2021-05-20 23:07:00 +08:00
|
|
|
(operation == Operation::DependencyResolveOnGpu) || (operation == EnqueueProperties::Operation::ProfilingOnly);
|
2019-11-07 16:15:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const BlitPropertiesContainer *blitPropertiesContainer = nullptr;
|
|
|
|
Operation operation = Operation::EnqueueWithoutSubmission;
|
|
|
|
};
|
|
|
|
} // namespace NEO
|