mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Cleanup builtins dependencies
move builtins builders to ClExecutionEnvironment Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
cb2f18e3bc
commit
3f94399dbb
@ -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
|
||||
|
@ -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
|
Reference in New Issue
Block a user