35 : _config(), _memory_managers(), _weights_managers()
41 _memory_managers.clear();
42 _weights_managers.clear();
58 Target target = memory_ctx.target;
64 _memory_managers[target] = std::move(memory_ctx);
70 return (_memory_managers.find(target) !=
std::end(_memory_managers)) ? &_memory_managers[target] :
nullptr;
75 return _memory_managers;
82 if(_weights_managers.find(target) !=
std::end(_weights_managers))
94 return (_weights_managers.find(target) !=
std::end(_weights_managers)) ? &_weights_managers[target] :
nullptr;
99 return _weights_managers;
104 const size_t num_pools = 1;
105 for(
auto &mm_obj : _memory_managers)
110 if(mm_obj.second.intra_mm !=
nullptr)
112 mm_obj.second.intra_mm->populate(*mm_obj.second.allocator, num_pools);
115 if(mm_obj.second.cross_mm !=
nullptr)
117 mm_obj.second.cross_mm->populate(*mm_obj.second.allocator, num_pools);
Graph configuration structure Device target types.
std::map< Target, WeightsManagerContext > & weights_managers()
Gets the weights managers map.
std::map< Target, MemoryManagerContext > & memory_managers()
Gets the memory managers map.
bool insert_weights_management_ctx(WeightsManagerContext &&weights_ctx)
Inserts a weights manager context.
bool insert_memory_management_ctx(MemoryManagerContext &&memory_ctx)
Inserts a memory manager context.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Includes all the Graph headers at once.
WeightsManagerContext * weights_management_ctx(Target target)
Gets a weights manager context for a given target.
GraphContext()
Constructor.
Copyright (c) 2017-2021 Arm Limited.
void set_config(const GraphConfig &config)
Sets graph configuration.
void finalize()
Finalizes memory managers in graph context.
void end(TokenStream &in, bool &valid)
~GraphContext()
Destructor.
const GraphConfig & config() const
Graph configuration accessor.
Contains structs required for weights management.
Contains structs required for memory management.
MemoryManagerContext * memory_management_ctx(Target target)
Gets a memory manager context for a given target.
void release_default_graph_context(GraphContext &ctx)
Default releases the graph context if not done manually.