Accelerated Computation Engine
Signals | Public Member Functions | Protected Member Functions | List of all members
Ace::Analytic::OpenCLRun::Thread Class Reference

#include <ace_analytic_openclrun_thread.h>

Inheritance diagram for Ace::Analytic::OpenCLRun::Thread:

Signals

void blockFinished ()
 

Public Member Functions

 Thread (std::unique_ptr< EAbstractAnalytic::OpenCL::Worker > &&worker, QObject *parent=nullptr)
 
void execute (std::unique_ptr< EAbstractAnalytic::Block > &&block)
 
std::unique_ptr< EAbstractAnalytic::Blockresult ()
 

Protected Member Functions

virtual void run () override final
 

Detailed Description

This is a single thread of execution used by its parent OpenCL run class to process work blocks into result blocks. The execution of this processing is done on a separate thread t enhance speed. An abstract OpenCL worker object is used for actual processing using an OpenCL device for acceleration.

Constructor & Destructor Documentation

◆ Thread()

OpenCLRun::Thread::Thread ( std::unique_ptr< EAbstractAnalytic::OpenCL::Worker > &&  worker,
QObject *  parent = nullptr 
)
explicit

Constructs a new thread object with the given abstract OpenCL worker and optional parent.

Parameters
workerAn abstract OpenCL worker used to do the actual processing of work blocks into result blocks.
parentOptional parent of this new thread object.

Member Function Documentation

◆ execute()

void OpenCLRun::Thread::execute ( std::unique_ptr< EAbstractAnalytic::Block > &&  block)

Executes the processing of the given work block on a separate thread from the one called this method. This returns immediately after starting the separate thread. If this thread already contains a result block then an exception is thrown.

Parameters
blockThe work block that is processed on a separate thread.

◆ result()

std::unique_ptr< EAbstractAnalytic::Block > OpenCLRun::Thread::result ( )

Returns the result block produces on this object's separate thread after finishing. If the separate thread threw an exception that exception is thrown again on the thread calling this method. If there is not result block an exception is also thrown.

Returns
Result block produced by this object's separate thread execution.

◆ run()

void OpenCLRun::Thread::run ( )
finaloverrideprotectedvirtual

Executes this object's saved work block on its separate thread, saving the result block. If any exception is thrown within this separate thread it is caught and saved.


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