Files
compute-runtime/opencl/source/execution_environment/cl_execution_environment.h
rcombs e4ed6f07f3 refactor: don't redeclare an STL type in cl_execution_environment.h
Depending on the compiler and STL used, `std::once_flag` may actually be
aliased into an internal namespace (e.g. `std::__1::once_flag`).
Declaring it directly within `std` here may conflict with that
if the actual `<mutex>` header is included in the same translation unit.

This regressed in 77b88f19a1.

Signed-off-by: rcombs <rcombs@rcombs.me>
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-05-04 16:45:54 +02:00

34 lines
940 B
C++

/*
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/execution_environment/execution_environment.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