target_link_libraries(armnn ${CMAKE_DL_LIBS})
install(TARGETS armnn
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if(BUILD_CAFFE_PARSER)
install(TARGETS armnnCaffeParser
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
if(BUILD_ONNX_PARSER)
install(TARGETS armnnOnnxParser
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
if(BUILD_TF_PARSER)
install(TARGETS armnnTfParser
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
BOOST_ASSERT(axis <= inputNumDimensions);
- unsigned int dimensionSizes[inputNumDimensions + 1];
+ std::vector<unsigned int> dimensionSizes(inputNumDimensions + 1, 0);
for (unsigned int i = 0; i < axis; ++i)
{
dimensionSizes[i] = inputShape[i];
dimensionSizes[i] = inputShape[i-1];
}
- TensorShape targetShape = TensorShape(inputNumDimensions + 1, dimensionSizes);
+ TensorShape targetShape = TensorShape(inputNumDimensions + 1, dimensionSizes.data());
return std::vector<TensorShape>({ targetShape });
}
target_link_libraries(armnnTfLiteParser armnn ${FLATBUFFERS_LIBRARY})
install(TARGETS armnnTfLiteParser
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
#include "ParserFlatbuffersFixture.hpp"
#include "../TfLiteParser.hpp"
-#include <unistd.h>
-
using armnnTfLiteParser::TfLiteParser;
using ModelPtr = TfLiteParser::ModelPtr;
using SubgraphPtr = TfLiteParser::SubgraphPtr;
void* DynamicBackendUtils::OpenHandle(const std::string& sharedObjectPath)
{
+#if defined(__unix__)
if (sharedObjectPath.empty())
{
throw RuntimeException("OpenHandle error: shared object path must not be empty");
}
return sharedObjectHandle;
+#else
+ throw RuntimeException("Dynamic backends not supported on this platform");
+#endif
}
void DynamicBackendUtils::CloseHandle(const void* sharedObjectHandle)
{
+#if defined(__unix__)
if (!sharedObjectHandle)
{
return;
}
dlclose(const_cast<void*>(sharedObjectHandle));
+#else
+ throw RuntimeException("Dynamic backends not supported on this platform");
+#endif
}
bool DynamicBackendUtils::IsBackendCompatible(const BackendVersion &backendVersion)
std::string DynamicBackendUtils::GetDlError()
{
+#if defined(__unix__)
const char* errorMessage = dlerror();
if (!errorMessage)
{
}
return std::string(errorMessage);
+#else
+ throw RuntimeException("Dynamic backends not supported on this platform");
+#endif
}
std::vector<std::string> DynamicBackendUtils::GetBackendPaths(const std::string& overrideBackendPath)
#include <armnn/Exceptions.hpp>
+#include <boost/format.hpp>
+
#include <string>
-#include <dlfcn.h>
#include <vector>
-
-#include <boost/format.hpp>
+#if defined(__unix__)
+#include <dlfcn.h>
+#endif
#if !defined(DYNAMIC_BACKEND_PATHS)
#define DYNAMIC_BACKEND_PATHS ""
template<typename EntryPointType>
EntryPointType DynamicBackendUtils::GetEntryPoint(const void* sharedObjectHandle, const char* symbolName)
{
+#if defined(__unix__)
if (sharedObjectHandle == nullptr)
{
throw RuntimeException("GetEntryPoint error: invalid handle");
}
return entryPoint;
+#else
+ throw RuntimeException("Dynamic backends not supported on this platform");
+#endif
}
} // namespace armnn
#include <boost/assert.hpp>
+#include <algorithm>
+
namespace armnn
{
void* RefMemoryManager::Pool::GetPointer()
{
- BOOST_ASSERT_MSG(m_Pointer, "RefMemoryManager::Pool::GetPointer() called when memory not acquired");
+ BOOST_ASSERT_MSG(m_Pointer, "RefMemoryManager::Pool::GetPointer() called when memory not acquired");
return m_Pointer;
}
void RefMemoryManager::Pool::Acquire()
{
- BOOST_ASSERT_MSG(!m_Pointer, "RefMemoryManager::Pool::Acquire() called when memory already acquired");
+ BOOST_ASSERT_MSG(!m_Pointer, "RefMemoryManager::Pool::Acquire() called when memory already acquired");
BOOST_ASSERT(m_Size >= 0);
m_Pointer = ::operator new(size_t(m_Size));
}
void RefMemoryManager::Pool::Release()
{
- BOOST_ASSERT_MSG(m_Pointer, "RefMemoryManager::Pool::Release() called when memory not acquired");
+ BOOST_ASSERT_MSG(m_Pointer, "RefMemoryManager::Pool::Release() called when memory not acquired");
::operator delete(m_Pointer);
m_Pointer = nullptr;
}