Changed format used for debugging in most files.
Signed-off-by: Denis Maksimenko <d.maksimenko@partner.samsung.com>
file(GLOB_RECURSE MAIN "src/main.cpp")
list(REMOVE_ITEM SOURCES ${MAIN})
+include_directories(include)
+
# Used by unit tests
set(NNC_SOFT_BACKEND_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/backend/soft)
set(NNC_CORE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/core)
#include "ConfigException.h"
#include "PluginType.h"
+// Enable debugging
+#include "debug.h"
+#define DEBUG_AREA "examples"
+using nncc::contrib::dbgs;
+
static const std::string pluginName = "Your plugin name here";
static const std::string pluginVersion = "Your plugin version here";
static const std::string pluginDesc = "Your plugin description here";
AbstractPluginInstance &SamplePluginInstance::getInstance()
{
static SamplePluginInstance instance;
- std::cout << std::endl << "!!! plugin (" << pluginName << ") " << __func__ << std::endl;
+ NNC_DEBUG(dbgs() << std::endl << "!!! plugin (" << pluginName << ") " << __func__ << std::endl);
return instance;
}
void SamplePluginInstance::checkConfig()
{
- std::cout << std::endl << "!!! plugin (" << pluginName << ") " << __func__ << std::endl;
+ NNC_DEBUG(dbgs() << std::endl << "!!! plugin (" << pluginName << ") " << __func__ << std::endl);
}
void *SamplePluginInstance::execute(void *data)
{
- std::cout << std::endl << "!!! plugin (" << pluginName << ") " << __func__ << std::endl;
+ NNC_DEBUG(dbgs() << std::endl << "!!! plugin (" << pluginName << ") " << __func__ << std::endl);
return data;
}
void SamplePluginInstance::setParam(const std::string &name)
{
- std::cout << "bad parameter <" << name << ">";
+ NNC_DEBUG(dbgs() << "bad parameter <" << name << ">");
}
void SamplePluginInstance::setParam(const std::string &name, const std::string &value)
{
throw nncc::contrib::ConfigException("unsupported parameter <" + name + ">");
}
- std::cout << __func__ << " : " << name << " = " << value << std::endl;
+ NNC_DEBUG(dbgs() << __func__ << " : " << name << " = " << value << std::endl);
}
extern "C" AbstractPluginInstance *get_instance()
{
- std::cout << std::endl << "!!! plugin (" << pluginName << ") " << __func__ << std::endl;
+ NNC_DEBUG(dbgs() << std::endl << "!!! plugin (" << pluginName << ") " << __func__ << std::endl);
return &SamplePluginInstance::getInstance();
}
target_link_libraries(soft_backend_common PRIVATE nncc_core)
target_link_libraries(soft_backend_common PRIVATE nnc_plugin_core)
target_link_libraries(soft_backend_common PRIVATE nnc_core)
+# This is included because right now common functional is built into nnc_module
+target_link_libraries(soft_backend_common PRIVATE nnc_module)
function(make_soft_backend NAME)
add_library(${NAME} SHARED ${ARGN} ${SOFT_GENERATED_SOURCES})
#include <sys/types.h>
#include <dirent.h>
+#include "debug.h"
+#define DEBUG_AREA "soft_backend"
+
using namespace std;
using namespace nncc::contrib;
using namespace nncc::contrib::config;
assert(data);
Graph *graph = static_cast<Graph*>(data);
generate(graph);
- clog << "[" << _pluginName << "] Plugin executed" << endl;
+ NNC_DEBUG(dbgs() << "[" << _pluginName << "] Plugin executed" << endl);
return data;
}
#define STR_EXTENSION_PLUGIN ".so"
#endif /* __APPLE__ */
+#include "debug.h"
+#define DEBUG_AREA "plugins"
+
namespace nncc
{
namespace contrib
}
void PluginManager::loadPlugins(std::vector<AbstractModule *> &modules) {
- // FIXME: it's necessary to make this printing via debugging system (see issue #893)
- //std::cout << "Current plugin path is <" << _pluginsPath << ">" << std::endl;
+ NNC_DEBUG(dbgs() << "Current plugin path is <" << _pluginsPath << ">" << std::endl);
auto plugins = getPluginPathList();
for (const auto &pluginPath : plugins) {
}
void PluginManager::applyParam(const std::string &name, const std::string &value) {
- // FIXME: it's necessary to make this printing via debugging system (see issue #893)
- //std::cout << __func__ << " <" + name + "> = " + value << std::endl;
+ NNC_DEBUG(dbgs() << __func__ << " <" + name + "> = " + value << std::endl);
if (name == paramPluginPath) {
_pluginsPath = value;
} else {
#include "module/plugin/shared_library.h"
+#include "debug.h"
+#define DEBUG_AREA "plugins"
+
namespace nncc
{
namespace contrib
_isLoaded = true;
// open the library
- std::cout << "Opening " << _path << std::endl;
+ NNC_DEBUG(dbgs() << "Opening " << _path << std::endl);
_handle = dlopen(_path.c_str(), RTLD_LAZY);