Compute Library
 21.02
CLLogLayer Class Reference

Basic function to perform elementwise log on an input tensor. More...

#include <CLElementWiseUnaryLayer.h>

Collaboration diagram for CLLogLayer:
[legend]

Public Member Functions

 CLLogLayer ()
 Default Constructor. More...
 
 ~CLLogLayer ()
 Default Destructor. More...
 
 CLLogLayer (const CLLogLayer &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 CLLogLayer (CLLogLayer &&)
 Default move constructor. More...
 
CLLogLayeroperator= (const CLLogLayer &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
CLLogLayeroperator= (CLLogLayer &&)
 Default move assignment operator. More...
 
void configure (const ICLTensor *input, ICLTensor *output)
 Initialize the function. More...
 
void configure (const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output)
 Initialize the function. More...
 
void run () override
 Run the kernels contained in the function. More...
 
- Public Member Functions inherited from IFunction
virtual ~IFunction ()=default
 Destructor. More...
 
virtual void prepare ()
 Prepare the function for executing. More...
 

Static Public Member Functions

static Status validate (const ITensorInfo *input, const ITensorInfo *output)
 Static function to check if given info will lead to a valid configuration of CLLogLayer. More...
 

Detailed Description

Basic function to perform elementwise log on an input tensor.

Definition at line 224 of file CLElementWiseUnaryLayer.h.

Constructor & Destructor Documentation

◆ CLLogLayer() [1/3]

Default Constructor.

Definition at line 247 of file CLElementWiseUnaryLayer.cpp.

References CLLogLayer::operator=(), and CLLogLayer::~CLLogLayer().

248  : _impl(std::make_unique<Impl>())
249 {
250 }

◆ ~CLLogLayer()

~CLLogLayer ( )
default

Default Destructor.

Referenced by CLLogLayer::CLLogLayer().

◆ CLLogLayer() [2/3]

CLLogLayer ( const CLLogLayer )
delete

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

◆ CLLogLayer() [3/3]

CLLogLayer ( CLLogLayer &&  )
default

Default move constructor.

Member Function Documentation

◆ configure() [1/2]

void configure ( const ICLTensor input,
ICLTensor output 
)

Initialize the function.

Parameters
[in]inputInput tensor. Data types supported: F16/F32.
[out]outputOutput tensor. Data types supported: same as input.

Definition at line 256 of file CLElementWiseUnaryLayer.cpp.

References CLKernelLibrary::get().

257 {
258  configure(CLKernelLibrary::get().get_compile_context(), input, output);
259 }
void configure(const ICLTensor *input, ICLTensor *output)
Initialize the function.
static CLKernelLibrary & get()
Access the KernelLibrary singleton.

◆ configure() [2/2]

void configure ( const CLCompileContext compile_context,
const ICLTensor input,
ICLTensor output 
)

Initialize the function.

Parameters
[in]compile_contextThe compile context to be used.
[in]inputInput tensor. Data types supported: F16/F32.
[out]outputOutput tensor. Data types supported: same as input.

Definition at line 261 of file CLElementWiseUnaryLayer.cpp.

References ITensor::info(), and arm_compute::test::validation::input.

262 {
263  _impl->src = input;
264  _impl->dst = output;
265  _impl->op = std::make_unique<opencl::ClLog>();
266  _impl->op->configure(compile_context, input->info(), output->info());
267 }

◆ operator=() [1/2]

CLLogLayer& operator= ( const CLLogLayer )
delete

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

Referenced by CLLogLayer::CLLogLayer().

◆ operator=() [2/2]

CLLogLayer & operator= ( CLLogLayer &&  )
default

Default move assignment operator.

◆ run()

void run ( )
overridevirtual

Run the kernels contained in the function.

For Neon kernels:

  • Multi-threading is used for the kernels which are parallelisable.
  • By default std::thread::hardware_concurrency() threads are used.
Note
CPPScheduler::set_num_threads() can be used to manually set the number of threads

For OpenCL kernels:

  • All the kernels are enqueued on the queue associated with CLScheduler.
  • The queue is then flushed.
Note
The function will not block until the kernels are executed. It is the user's responsibility to wait.
Will call prepare() on first run if hasn't been done

Implements IFunction.

Definition at line 273 of file CLElementWiseUnaryLayer.cpp.

References arm_compute::ACL_DST, arm_compute::ACL_SRC, ITensorPack::add_tensor(), arm_compute::test::validation::dst, and arm_compute::test::validation::src.

274 {
275  ITensorPack pack;
276  pack.add_tensor(TensorType::ACL_SRC, _impl->src);
277  pack.add_tensor(TensorType::ACL_DST, _impl->dst);
278  _impl->op->run(pack);
279 }

◆ validate()

Status validate ( const ITensorInfo input,
const ITensorInfo output 
)
static

Static function to check if given info will lead to a valid configuration of CLLogLayer.

Parameters
[in]inputFirst tensor input info. Data types supported: F16/F32.
[in]outputOutput tensor info. Data types supported: Same as input.
Returns
a status

Definition at line 268 of file CLElementWiseUnaryLayer.cpp.

References ClLog::validate().

269 {
270  return opencl::ClLog::validate(input, output);
271 }
static Status validate(const ITensorInfo *src, const ITensorInfo *dst)
Static function to check if given info will lead to a valid configuration of ClLog.

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