chromium/third_party/ruy/src/ruy/ctx_impl.h

/* Copyright 2019 Google LLC. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

// Internal implementation details for Ctx. Drags in the entire world. Avoid
// #including this, use "ctx.h" instead.

#ifndef RUY_RUY_CTX_IMPL_H_
#define RUY_RUY_CTX_IMPL_H_

#include <cstddef>
#include <memory>
#include <vector>

#include "ruy/allocator.h"
#include "ruy/cpuinfo.h"
#include "ruy/ctx.h"
#include "ruy/path.h"
#include "ruy/performance_advisory.h"
#include "ruy/prepacked_cache.h"
#include "ruy/strategy_controls.h"
#include "ruy/thread_pool.h"
#include "ruy/tune.h"

namespace ruy {

// The resources private to each Ruy thread.
struct ThreadSpecificResource final {};

// CtxImpl is what actually holds all the data members in a context.
// It is a subclass of Ctx, which provides the interface that is what most
// of ruy's code needs.
//
// A key requirement is that since many ruy files, including public headers,
// need a definition of Ctx, the "ctx.h" header defining it must minimize how
// many other ruy internal headers it includes. That is achieved by putting data
// members in the CtxImpl subclass, and ensuring that only a few .cc files, not
// header files, need a definition of CtxImpl.
class CtxImpl final : public Ctx {};

}  // namespace ruy

#endif  // RUY_RUY_CTX_IMPL_H_