2020-03-17 19:37:38 +08:00
|
|
|
/*
|
2022-04-26 18:09:28 +08:00
|
|
|
* Copyright (C) 2020-2022 Intel Corporation
|
2020-03-17 19:37:38 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-04-24 18:58:39 +08:00
|
|
|
#pragma once
|
2022-04-26 18:09:28 +08:00
|
|
|
#include "shared/source/built_ins/builtinops/built_in_ops.h"
|
2020-03-17 19:37:38 +08:00
|
|
|
#include "shared/source/execution_environment/execution_environment.h"
|
|
|
|
|
2021-10-15 20:02:31 +08:00
|
|
|
#include <mutex>
|
|
|
|
#include <utility>
|
|
|
|
#include <vector>
|
|
|
|
|
2020-03-17 19:37:38 +08:00
|
|
|
namespace NEO {
|
|
|
|
|
|
|
|
class AsyncEventsHandler;
|
2021-10-15 20:02:31 +08:00
|
|
|
class BuiltinDispatchInfoBuilder;
|
2020-03-17 19:37:38 +08:00
|
|
|
|
|
|
|
class ClExecutionEnvironment : public ExecutionEnvironment {
|
|
|
|
public:
|
|
|
|
ClExecutionEnvironment();
|
|
|
|
AsyncEventsHandler *getAsyncEventsHandler() const;
|
|
|
|
~ClExecutionEnvironment() override;
|
2021-10-15 20:02:31 +08:00
|
|
|
void prepareRootDeviceEnvironments(uint32_t numRootDevices) override;
|
|
|
|
using BuilderT = std::pair<std::unique_ptr<BuiltinDispatchInfoBuilder>, std::once_flag>;
|
|
|
|
BuilderT *peekBuilders(uint32_t rootDeviceIndex) { return builtinOpsBuilders[rootDeviceIndex].get(); }
|
2020-03-17 19:37:38 +08:00
|
|
|
|
|
|
|
protected:
|
2021-10-15 20:02:31 +08:00
|
|
|
std::vector<std::unique_ptr<BuilderT[]>> builtinOpsBuilders;
|
2020-03-17 19:37:38 +08:00
|
|
|
std::unique_ptr<AsyncEventsHandler> asyncEventsHandler;
|
|
|
|
};
|
|
|
|
} // namespace NEO
|