Cleanup builtins dependencies

move builtins builders to ClExecutionEnvironment

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2021-10-15 12:02:31 +00:00
committed by Compute-Runtime-Automation
parent cb2f18e3bc
commit 3f94399dbb
45 changed files with 143 additions and 165 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Intel Corporation
* Copyright (C) 2020-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -7,6 +7,7 @@
#include "opencl/source/execution_environment/cl_execution_environment.h"
#include "opencl/source/built_ins/builtins_dispatch_builder.h"
#include "opencl/source/event/async_events_handler.h"
namespace NEO {
@ -22,4 +23,11 @@ AsyncEventsHandler *ClExecutionEnvironment::getAsyncEventsHandler() const {
ClExecutionEnvironment::~ClExecutionEnvironment() {
asyncEventsHandler->closeThread();
};
void ClExecutionEnvironment::prepareRootDeviceEnvironments(uint32_t numRootDevices) {
ExecutionEnvironment::prepareRootDeviceEnvironments(numRootDevices);
builtinOpsBuilders.resize(numRootDevices);
for (auto i = 0u; i < numRootDevices; i++) {
builtinOpsBuilders[i] = std::make_unique<BuilderT[]>(EBuiltInOps::COUNT);
}
}
} // namespace NEO

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Intel Corporation
* Copyright (C) 2020-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -8,17 +8,28 @@
#pragma once
#include "shared/source/execution_environment/execution_environment.h"
#include "built_in_ops.h"
#include <mutex>
#include <utility>
#include <vector>
namespace NEO {
class AsyncEventsHandler;
class BuiltinDispatchInfoBuilder;
class ClExecutionEnvironment : public ExecutionEnvironment {
public:
ClExecutionEnvironment();
AsyncEventsHandler *getAsyncEventsHandler() const;
~ClExecutionEnvironment() override;
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(); }
protected:
std::vector<std::unique_ptr<BuilderT[]>> builtinOpsBuilders;
std::unique_ptr<AsyncEventsHandler> asyncEventsHandler;
};
} // namespace NEO