...
 
Commits (5)
......@@ -57,8 +57,8 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(PROCESSLIB_MASTER_PROJECT ON)
endif()
# Enable C++11 and later
set(CMAKE_CXX_STANDARD 11)
# Enable C++14
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(MSVC AND MSVC_VERSION GREATER 1500)
......@@ -196,7 +196,7 @@ if(CMAKE_THREAD_LIBS_INIT)
endif()
if(WIN32)
target_compile_definitions(processlib PRIVATE processlib_EXPORTS)
target_compile_definitions(processlib PUBLIC processlib_EXPORTS)
set_target_properties(processlib PROPERTIES PREFIX "lib")
set_target_properties(processlib PROPERTIES IMPORT_PREFIX "lib")
endif()
......@@ -285,8 +285,14 @@ endif()
## Tests
if(PROCESSLIB_ENABLE_TESTS)
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost COMPONENTS
unit_test_framework
REQUIRED
)
enable_testing()
#add_subdirectory(test)
add_subdirectory(test)
endif()
# Packages
......
......@@ -70,9 +70,10 @@ struct PROCESSLIB_EXPORT Buffer
}
void unref()
{
std::lock_guard<std::mutex> lock(_mutex);
_mutex.lock();
if (!(--refcount))
{
_mutex.unlock();
if (owner == SHARED && data)
#ifdef __unix
free(data);
......@@ -81,6 +82,8 @@ struct PROCESSLIB_EXPORT Buffer
#endif
delete this;
}
else
_mutex.unlock();
}
void ref()
{
......
......@@ -67,7 +67,7 @@ class PROCESSLIB_EXPORT LinkTask
bool _processingInPlaceFlag;
TaskEventCallback *_eventCbkPt;
mutable std::mutex _lock;
mutable std::mutex _mutex;
private:
int _refCounter;
......
......@@ -30,6 +30,7 @@
#pragma warning(disable : 4251)
#endif
#include <algorithm>
#include <condition_variable>
#include <map>
#include <mutex>
......@@ -42,11 +43,44 @@
class TaskMgr;
struct Data;
class PROCESSLIB_EXPORT PoolThreadMgr
namespace detail {
// Add a remove method to std::priority_queue
template <typename T, typename Container = std::vector<T>, typename Compare = std::less<typename Container::value_type>>
class priority_queue : public std::priority_queue<T, Container, Compare>
{
public:
typedef std::pair<int, int> TaskPriority;
bool remove(const T &value)
{
auto it = std::find(this->c.cbegin(), this->c.cend(), value);
if (it != this->c.cend())
{
this->c.erase(it);
std::make_heap(this->c.begin(), this->c.end(), this->comp);
return true;
} else
return false;
}
auto begin() noexcept { return this->c.begin(); }
auto end() noexcept { return this->c.end(); }
void clear() noexcept { return this->c.clear(); }
};
} // namespace detail
/// Task priority is set with two levels (first = major and second = minor)
using TaskPriority = std::pair<int, int>;
inline bool operator<(const TaskPriority &a, const TaskPriority &b)
{
if (a.first == b.first)
return b.second < a.second;
else
return b.first < a.first;
}
class PROCESSLIB_EXPORT PoolThreadMgr
{
public:
static PoolThreadMgr &get();
void addProcess(TaskMgr *aProcess, bool lock = true);
......@@ -62,22 +96,22 @@ class PROCESSLIB_EXPORT PoolThreadMgr
private:
// Thread safe Singleton (guaranted in C++11)
PoolThreadMgr() : _stopFlag(false), _suspendFlag(false), _runningThread(0), _taskMgr(NULL) {}
~PoolThreadMgr()= default;
PoolThreadMgr() : _stopFlag(false), _suspendFlag(false), _runningThread(0), _taskMgr(NULL) { }
~PoolThreadMgr() { quit(); }
PoolThreadMgr(const PoolThreadMgr&)= delete;
PoolThreadMgr& operator=(const PoolThreadMgr&)= delete;
struct cmp
/// Compare two Process by priority
struct less_than
{
bool operator()(const TaskPriority &a, const TaskPriority &b)
template <typename Process>
bool operator()(Process const *const lhs, Process const *const rhs) const
{
if (a.first == b.first)
return b.second < a.second;
else
return b.first < a.first;
return lhs->priority() < rhs->priority();
}
};
typedef std::multimap<TaskPriority, TaskMgr *, cmp> QueueType;
using QueueType = detail::priority_queue<TaskMgr *, std::vector<TaskMgr *>, less_than>;
std::mutex m_mutex;
std::condition_variable m_cond;
......
......@@ -53,7 +53,7 @@ class PROCESSLIB_EXPORT SinkTaskBase
protected:
virtual ~SinkTaskBase();
mutable std::mutex _lock;
mutable std::mutex _mutex;
private:
TaskEventCallback *_eventCbkPt;
......
......@@ -300,6 +300,8 @@ void SinkTaskMgr<Result>::unref()
_lock.unlock();
delete this;
}
else
_lock.unlock();
}
#endif //! defined(PROCESSLIB_SINKTASKMGR_H)
......@@ -42,16 +42,10 @@ struct Data::HeaderContainer::HeaderHolder
_lock.unlock();
delete this;
}
else
_lock.unlock();
}
// inline void lock()
//{
// while(pthread_mutex_lock(&_lock));
//}
// inline void unlock()
//{
// pthread_mutex_unlock(&_lock);
//}
int refcount;
std::recursive_mutex _lock;
Data::HeaderContainer::Header header;
......
......@@ -44,7 +44,7 @@ LinkTask::~LinkTask()
}
void LinkTask::setEventCallback(TaskEventCallback *aEventCbk)
{
std::lock_guard<std::mutex> aLock(_lock);
std::lock_guard<std::mutex> aLock(_mutex);
if (aEventCbk)
aEventCbk->ref();
if (_eventCbkPt)
......@@ -54,22 +54,24 @@ void LinkTask::setEventCallback(TaskEventCallback *aEventCbk)
void LinkTask::ref()
{
std::lock_guard<std::mutex> aLock(_lock);
std::lock_guard<std::mutex> aLock(_mutex);
++_refCounter;
}
void LinkTask::unref()
{
_lock.lock();
_mutex.lock();
if (!(--_refCounter))
{
_lock.unlock();
_mutex.unlock();
delete this;
}
else
_mutex.unlock();
}
int LinkTask::getRefCounter() const
{
std::lock_guard<std::mutex> aLock(_lock);
std::lock_guard<std::mutex> aLock(_mutex);
return _refCounter;
}
......@@ -40,23 +40,32 @@ std::once_flag PoolThreadMgr::init_flag;
*/
void PoolThreadMgr::addProcess(TaskMgr *aProcess, bool aFlag)
{
std::lock_guard<std::mutex> lock(m_mutex);
_processQueue.insert(QueueType::value_type(aProcess->priority(), aProcess));
aProcess->_pool = this;
m_cond.notify_all();
// Recursive mutex should be used here
if (aFlag)
{
std::lock_guard<std::mutex> lock(m_mutex);
_processQueue.push(aProcess);
aProcess->_pool = this;
m_cond.notify_all();
}
else
{
_processQueue.push(aProcess);
aProcess->_pool = this;
m_cond.notify_all();
}
}
void PoolThreadMgr::removeProcess(TaskMgr *aProcess, bool aFlag)
{
std::lock_guard<std::mutex> lock(m_mutex);
for (QueueType::iterator i = _processQueue.begin(); i != _processQueue.end(); ++i)
// Recursive mutex should be used here
if (aFlag)
{
if (i->second == aProcess)
{
_processQueue.erase(i);
break;
}
std::lock_guard<std::mutex> lock(m_mutex);
_processQueue.remove(aProcess);
}
else
_processQueue.remove(aProcess);
}
/** @brief change the number of thread in the pool
......@@ -115,8 +124,9 @@ void PoolThreadMgr::abort()
m_cond.wait(lock, [&] { return _runningThread; });
for (QueueType::iterator i = _processQueue.begin(); i != _processQueue.end(); ++i)
delete i->second;
for (auto &&proc : _processQueue)
delete proc;
_processQueue.clear();
_suspendFlag = false;
}
......@@ -142,7 +152,7 @@ void *PoolThreadMgr::_run(void *arg)
// that is the equivalent of this (but this is a reserved keyword)
PoolThreadMgr *that = reinterpret_cast<PoolThreadMgr *>(arg);
std::lock_guard<std::mutex> lock(that->m_mutex);
std::unique_lock<std::mutex> lock(that->m_mutex);
that->_runningThread++;
while (1)
{
......@@ -157,17 +167,17 @@ void *PoolThreadMgr::_run(void *arg)
aBroadcastFlag = false;
}
std::unique_lock<std::mutex> lock(that->m_mutex);
that->m_cond.wait(lock);
}
that->_runningThread++;
if (!that->_processQueue.empty())
{
QueueType::iterator i = that->_processQueue.begin();
TaskMgr *processPt = i->second;
TaskMgr *processPt = that->_processQueue.top();
that->_processQueue.pop();
TaskMgr::TaskWrap *aNextTask = processPt->next();
// aLock.unLock();
lock.unlock();
try
{
......@@ -180,7 +190,7 @@ void *PoolThreadMgr::_run(void *arg)
aNextTask->error("Unknown exception!");
}
// aLock.lock();
lock.lock();
} else
break; // stop
}
......
......@@ -39,7 +39,7 @@ SinkTaskBase::~SinkTaskBase()
void SinkTaskBase::setEventCallback(TaskEventCallback *aEventCbk)
{
std::lock_guard<std::mutex> aLock(_lock);
std::lock_guard<std::mutex> aLock(_mutex);
if (aEventCbk)
aEventCbk->ref();
if (_eventCbkPt)
......@@ -49,22 +49,24 @@ void SinkTaskBase::setEventCallback(TaskEventCallback *aEventCbk)
void SinkTaskBase::ref()
{
std::lock_guard<std::mutex> aLock(_lock);
std::lock_guard<std::mutex> aLock(_mutex);
++_refCounter;
}
void SinkTaskBase::unref()
{
_lock.lock();
_mutex.lock();
if (!(--_refCounter))
{
_lock.unlock();
_mutex.unlock();
delete this;
}
else
_mutex.unlock();
}
int SinkTaskBase::getRefCounter() const
{
std::lock_guard<std::mutex> aLock(_lock);
std::lock_guard<std::mutex> aLock(_mutex);
return _refCounter;
}
......@@ -39,4 +39,6 @@ void TaskEventCallback::unref()
_lock.unlock();
delete this;
}
else
_lock.unlock();
}
.build
.doxygen
# Algorithms
## Task graph
# -*- coding: utf-8 -*-
#
# Lima documentation build configuration file, created by
# sphinx-quickstart on Fri Feb 18 10:19:02 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os, subprocess, re
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.append(os.path.abspath('.'))
# Read The Docs.
read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
# -- RunDoxygen first thing ------------------------------------------------
if read_the_docs_build:
subprocess.call('doxygen core.dox; doxygen tasks.dox', shell=True)
# -- General configuration -----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.ifconfig',
'sphinx.ext.mathjax', 'breathe'
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
from recommonmark.parser import CommonMarkParser
source_parsers = {
'.md': CommonMarkParser,
}
# The suffix of source filenames.
source_suffix = ['.rst', '.md']
# The encoding of source files.
#source_encoding = 'utf-8'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'Processlib'
copyright = u'2019, Lima Team'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = re.sub('^v', '', os.popen('git describe').read().strip())
# The full version, including alpha/beta/rc tags.
release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of documents that shouldn't be included in the build.
#unused_docs = []
# List of directories, relative to source directory, that shouldn't be searched
# for source files.
exclude_trees = []
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# Tell breathe about the projects
breathe_projects = { "core": ".doxygen/core/", "tasks": ".doxygen/tasks/" }
breathe_default_project = "core"
breathe_domain_by_extension = {"h" : "cpp"}
# -- Options for HTML output ---------------------------------------------------
# only import and set the theme if we're building docs locally
if not read_the_docs_build:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# otherwise, readthedocs.org uses their theme by default, so no need to specify it
# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
#html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = 'lima-logo-2-40perc.png'
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_use_modindex = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = ''
# Output file base name for HTML help builder.
htmlhelp_basename = 'Processlib'
# -- Options for LaTeX output --------------------------------------------------
# The paper size ('letter' or 'a4').
latex_paper_size = 'a4'
# The font size ('10pt', '11pt' or '12pt').
latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'Processlib.tex', u'Processlib Documentation',
u'Lima Team', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
latex_logo = 'lima-logo-3.png'
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_use_modindex = True
This source diff could not be displayed because it is too large. You can view the blob instead.
# Core
## Data
C++ API
=======
Unfortunately very limited documentation is available from the source but that should improve over time.
.. doxygenclass:: PoolThreadMgr
:project: core
:members:
=========================================
Processlib : Library for Image Processing
=========================================
Processlib is a companion library of LImA (**L** ibrary for **Im** age **A** cquisition) project that provides image processing.
Processlib is a C++ library but the library also comes with a Python_ binding.
We provide Conda binary package for Windows and Linux for some cameras. Check out our `Conda channel <https://anaconda.org/esrf-bcu>`_.
If you want to get in touch with the LIMA community, please send an email to lima@esrf.fr. You may also want to subscribe to our mailing list by sending a message to `sympa@esrf.fr <mailto:sympa@esrf.fr?subject=subscribe%20lima>`_ with ``subscribe lima`` as subject.
.. toctree::
:maxdepth: 1
:caption: User Documentation
core
algorithms
tasks
concurrency
.. toctree::
:maxdepth: 1
:caption: Reference Documentation
cpp_api
python_api
.. _Python: https://python.org
.. _Conda: https://conda.io
@ECHO OFF
REM Command file for Sphinx documentation
set SPHINXBUILD=sphinx-build
set BUILDDIR=.build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
)
if "%1" == "" goto help
if "%1" == "help" (
:help
echo.Please use `make ^<target^>` where ^<target^> is one of
echo. html to make standalone HTML files
echo. dirhtml to make HTML files named index.html in directories
echo. pickle to make pickle files
echo. json to make JSON files
echo. htmlhelp to make HTML files and a HTML help project
echo. qthelp to make HTML files and a qthelp project
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
echo. changes to make an overview over all changed/added/deprecated items
echo. linkcheck to check all external links for integrity
echo. doctest to run all doctests embedded in the documentation if enabled
goto end
)
if "%1" == "clean" (
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
del /q /s %BUILDDIR%\*
goto end
)
if "%1" == "html" (
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end
)
if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
goto end
)
if "%1" == "pickle" (
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
echo.
echo.Build finished; now you can process the pickle files.
goto end
)
if "%1" == "json" (
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
echo.
echo.Build finished; now you can process the JSON files.
goto end
)
if "%1" == "htmlhelp" (
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
echo.
echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
goto end
)
if "%1" == "qthelp" (
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Lima.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Lima.ghc
goto end
)
if "%1" == "latex" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
echo.
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "changes" (
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
echo.
echo.The overview file is in %BUILDDIR%/changes.
goto end
)
if "%1" == "linkcheck" (
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
echo.
echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
goto end
)
if "%1" == "doctest" (
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
echo.
echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
goto end
)
:end
Python API
==========
Most of the previous sections about the user interface routines applies to the Python binding. Naturally, some specifics concerning Python come into play.
This documentation is very much a work in progress. Stay tuned!
This source diff could not be displayed because it is too large. You can view the blob instead.
add_subdirectory(cpp)
macro(add_utf_test name)
add_executable(${name} ${name}.cpp)
target_link_libraries(${name}
processlib
Boost::unit_test_framework
Boost::disable_autolinking
)
add_test(NAME ${name} COMMAND ${name})
endmacro(add_utf_test)
add_utf_test(test_data)
add_utf_test(test_pool_thread_mgr)
#define BOOST_TEST_MODULE core
#include <boost/test/unit_test.hpp>
#define BOOST_TEST_MODULE data
#include <boost/test/unit_test.hpp>
#include <processlib/Data.h>
BOOST_AUTO_TEST_CASE(test_data)
{
Data beam_data;
beam_data.frameNumber = 1;
beam_data.dimensions = { 2048, 2048 };
beam_data.type = Data::INT8;
Buffer *buffer = new Buffer(2048 * 2048);
//Transfer ownership to Data
beam_data.setBuffer(buffer);
buffer->unref();
BOOST_CHECK_EQUAL(0, 0);
}
#define BOOST_TEST_MODULE pool_thread_mgr
#include <boost/test/unit_test.hpp>
#include <processlib/TaskMgr.h>
#include <processlib/PoolThreadMgr.h>
#include <processlib/BackgroundSubstraction.h>
#include <processlib/Binning.h>
#include <processlib/RoiCounter.h>
BOOST_AUTO_TEST_CASE(test_pool_thread_mgr)
{
// Order of Data, Buffer and TaskMgr construction matters!
Buffer *backgroundBuffer = new Buffer(2048 * 2048);
TaskMgr *task_mgr = new TaskMgr();
// Background
Tasks::BackgroundSubstraction *bckground = new Tasks::BackgroundSubstraction();
Data backgroundData;
backgroundData.setBuffer(backgroundBuffer);
backgroundBuffer->unref();
backgroundData.type = Data::INT8;
backgroundData.dimensions = { 2048, 2048 };
bckground->setBackgroundImageData(backgroundData);
task_mgr->setLinkTask(0, bckground);
// Binning
Tasks::Binning *binning = new Tasks::Binning();
binning->mXFactor = 2;
binning->mYFactor = 2;
task_mgr->setLinkTask(1, binning);
// Roi Counter
Tasks::RoiCounterManager * rc_mgr = new Tasks::RoiCounterManager();
Tasks::RoiCounterTask *RCTask = new Tasks::RoiCounterTask(*rc_mgr);
RCTask->setRoi(0, 0, 2048, 2048);
task_mgr->addSinkTask(1, RCTask);
// NOTE: TaskMgr takes ownership of the tasks pointer
// And finnaly set the chain task for all input images
PoolThreadMgr& poolThreadMgr = PoolThreadMgr::get();
poolThreadMgr.setNumberOfThread(2);
Buffer *inputBuffer = new Buffer(2048 * 2048);
Data inputData;
inputData.setBuffer(inputBuffer);
inputBuffer->unref();
inputData.type = Data::INT8;
inputData.dimensions = { 2048, 2048 };
task_mgr->setInputData(inputData);
poolThreadMgr.addProcess(task_mgr);
poolThreadMgr.wait(1000);
BOOST_CHECK_EQUAL(0, 0);
}