Compute Library
 22.05
RuntimeContext Class Reference

Runtime context. More...

#include <RuntimeContext.h>

Collaboration diagram for RuntimeContext:
[legend]

Public Member Functions

 RuntimeContext ()
 Default Constructor. More...
 
 ~RuntimeContext ()=default
 Destructor. More...
 
 RuntimeContext (const RuntimeContext &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 RuntimeContext (RuntimeContext &&)=default
 Default move constructor. More...
 
RuntimeContextoperator= (const RuntimeContext &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
RuntimeContextoperator= (RuntimeContext &&)=default
 Default move assignment operator. More...
 
void set_scheduler (IScheduler *scheduler)
 CPU Scheduler setter. More...
 
ISchedulerscheduler () override
 Scheduler accessor. More...
 
IAssetManagerasset_manager () override
 Asset manager accessor. More...
 
- Public Member Functions inherited from IRuntimeContext
virtual ~IRuntimeContext ()=default
 Destructor. More...
 

Detailed Description

Runtime context.

Definition at line 34 of file RuntimeContext.h.

Constructor & Destructor Documentation

◆ RuntimeContext() [1/3]

Default Constructor.

Definition at line 31 of file RuntimeContext.cpp.

32  : _owned_scheduler(SchedulerFactory::create()), _scheduler(_owned_scheduler.get())
33 {
34 }
static std::unique_ptr< IScheduler > create(Type type=_default_type)
Create a scheduler depending on the scheduler type.

◆ ~RuntimeContext()

~RuntimeContext ( )
default

Destructor.

◆ RuntimeContext() [2/3]

RuntimeContext ( const RuntimeContext )
delete

Prevent instances of this class from being copied (As this class contains pointers)

◆ RuntimeContext() [3/3]

RuntimeContext ( RuntimeContext &&  )
default

Default move constructor.

Member Function Documentation

◆ asset_manager()

IAssetManager * asset_manager ( )
overridevirtual

Asset manager accessor.

Note
Asset manager is used to manage objects/tensors within functions
Returns
The asset manager registered to the context

Implements IRuntimeContext.

Definition at line 47 of file RuntimeContext.cpp.

Referenced by arm_compute::test::validation::TEST_CASE().

48 {
49  return nullptr;
50 }

◆ operator=() [1/2]

RuntimeContext& operator= ( const RuntimeContext )
delete

Prevent instances of this class from being copied (As this class contains pointers)

◆ operator=() [2/2]

RuntimeContext& operator= ( RuntimeContext &&  )
default

Default move assignment operator.

◆ scheduler()

IScheduler * scheduler ( )
overridevirtual

Scheduler accessor.

Note
Scheduler is used to schedule workloads
Returns
The scheduler registered to the context

Implements IRuntimeContext.

Definition at line 42 of file RuntimeContext.cpp.

Referenced by ContextSchedulerUser::ContextSchedulerUser(), CLRuntimeContext::set_gpu_scheduler(), RuntimeContext::set_scheduler(), and arm_compute::test::validation::TEST_CASE().

43 {
44  return _scheduler;
45 }

◆ set_scheduler()

void set_scheduler ( IScheduler scheduler)

CPU Scheduler setter.

Definition at line 36 of file RuntimeContext.cpp.

References ARM_COMPUTE_ERROR_ON_NULLPTR, and RuntimeContext::scheduler().

Referenced by ContextSchedulerUser::intercept_scheduler(), ContextSchedulerUser::restore_scheduler(), and arm_compute::test::validation::TEST_CASE().

37 {
39  _scheduler = scheduler;
40 }
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:157
IScheduler * scheduler() override
Scheduler accessor.

The documentation for this class was generated from the following files: