2019-11-07 09:15:53 +01:00
|
|
|
/*
|
2023-01-18 15:52:24 +00:00
|
|
|
* Copyright (C) 2019-2023 Intel Corporation
|
2019-11-07 09:15:53 +01:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
2023-01-18 15:52:24 +00:00
|
|
|
#include "shared/source/helpers/blit_properties_container.h"
|
2019-11-07 09:15:53 +01:00
|
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
|
|
|
|
|
struct EnqueueProperties {
|
|
|
|
|
enum class Operation {
|
2023-12-13 16:09:52 +00:00
|
|
|
none,
|
|
|
|
|
blit,
|
|
|
|
|
explicitCacheFlush,
|
|
|
|
|
enqueueWithoutSubmission,
|
|
|
|
|
dependencyResolveOnGpu,
|
|
|
|
|
gpuKernel,
|
|
|
|
|
profilingOnly
|
2019-11-07 09:15:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
EnqueueProperties() = delete;
|
2023-09-12 14:17:52 +00:00
|
|
|
EnqueueProperties(bool blitEnqueue, bool hasKernels, bool isCacheFlushCmd, bool flushDependenciesOnly, bool isMarkerWithEvent, bool hasStallingCmds,
|
|
|
|
|
const BlitPropertiesContainer *blitPropertiesContainer) : hasStallingCmds(hasStallingCmds) {
|
2019-11-07 09:15:53 +01:00
|
|
|
if (blitEnqueue) {
|
2023-12-13 16:09:52 +00:00
|
|
|
operation = Operation::blit;
|
2019-11-07 09:15:53 +01:00
|
|
|
this->blitPropertiesContainer = blitPropertiesContainer;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (hasKernels) {
|
2023-12-13 16:09:52 +00:00
|
|
|
operation = Operation::gpuKernel;
|
2019-11-09 19:02:25 +01:00
|
|
|
this->blitPropertiesContainer = blitPropertiesContainer;
|
2019-11-07 09:15:53 +01:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isCacheFlushCmd) {
|
2023-12-13 16:09:52 +00:00
|
|
|
operation = Operation::explicitCacheFlush;
|
2019-11-07 09:15:53 +01:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (flushDependenciesOnly) {
|
2023-12-13 16:09:52 +00:00
|
|
|
operation = Operation::dependencyResolveOnGpu;
|
2019-11-07 09:15:53 +01:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-20 15:07:00 +00:00
|
|
|
if (isMarkerWithEvent) {
|
2023-12-13 16:09:52 +00:00
|
|
|
operation = Operation::profilingOnly;
|
2021-05-20 15:07:00 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-13 16:09:52 +00:00
|
|
|
operation = Operation::enqueueWithoutSubmission;
|
2019-11-07 09:15:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool isFlushWithoutKernelRequired() const {
|
2023-12-13 16:09:52 +00:00
|
|
|
return (operation == Operation::blit) || (operation == Operation::explicitCacheFlush) ||
|
|
|
|
|
(operation == Operation::dependencyResolveOnGpu) || (operation == EnqueueProperties::Operation::profilingOnly);
|
2019-11-07 09:15:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const BlitPropertiesContainer *blitPropertiesContainer = nullptr;
|
2023-12-13 16:09:52 +00:00
|
|
|
Operation operation = Operation::enqueueWithoutSubmission;
|
2023-09-12 14:17:52 +00:00
|
|
|
const bool hasStallingCmds;
|
2019-11-07 09:15:53 +01:00
|
|
|
};
|
|
|
|
|
} // namespace NEO
|