Compute Library
 22.08
ParametersLibrary Class Referencefinal

Class that contains all the global parameters used by the tests. More...

#include <ParametersLibrary.h>

Public Member Functions

 ParametersLibrary ()=default
 Default constructor. More...
 
void set_cpu_ctx (std::unique_ptr< IRuntimeContext > cpu_ctx)
 Set cpu context to be used by the tests. More...
 
void set_cl_ctx (std::unique_ptr< IRuntimeContext > cl_ctx)
 Set gpu context to be used by the tests. More...
 
void set_gc_ctx (std::unique_ptr< IRuntimeContext > gc_ctx)
 Set gpu context to be used by the tests. More...
 
template<typename TensorType >
ContextType< TensorType >::typeget_ctx ()
 Get context given a tensor type. More...
 
template<>
ContextType< Tensor >::typeget_ctx ()
 

Detailed Description

Class that contains all the global parameters used by the tests.

Definition at line 61 of file ParametersLibrary.h.

Constructor & Destructor Documentation

◆ ParametersLibrary()

ParametersLibrary ( )
default

Default constructor.

Member Function Documentation

◆ get_ctx() [1/2]

ContextType<Tensor>::type* get_ctx ( )

Definition at line 46 of file ParametersLibrary.cpp.

47 {
48  return _cpu_ctx.get();
49 }

◆ get_ctx() [2/2]

ContextType<TensorType>::type* get_ctx ( )
inline

Get context given a tensor type.

Template Parameters
TensorType
Returns
Pointer to the context

Definition at line 88 of file ParametersLibrary.h.

89  {
90  return nullptr;
91  }

◆ set_cl_ctx()

void set_cl_ctx ( std::unique_ptr< IRuntimeContext cl_ctx)

Set gpu context to be used by the tests.

Parameters
[in]cl_ctxGPU context to use

Definition at line 35 of file ParametersLibrary.cpp.

36 {
37  _cl_ctx = std::move(cl_ctx);
38 }

◆ set_cpu_ctx()

void set_cpu_ctx ( std::unique_ptr< IRuntimeContext cpu_ctx)

Set cpu context to be used by the tests.

Parameters
[in]cpu_ctxCPU context to use

Definition at line 30 of file ParametersLibrary.cpp.

31 {
32  _cpu_ctx = std::move(cpu_ctx);
33 }

◆ set_gc_ctx()

void set_gc_ctx ( std::unique_ptr< IRuntimeContext gc_ctx)

Set gpu context to be used by the tests.

Parameters
[in]gc_ctxGPU context to use

Definition at line 40 of file ParametersLibrary.cpp.

41 {
42  _gc_ctx = std::move(gc_ctx);
43 }

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