Commit d6d9e2db authored by pruthvi's avatar pruthvi

added CPUAllocator class

parent 71a8d356
...@@ -15,3 +15,11 @@ ...@@ -15,3 +15,11 @@
//***************************************************************************** //*****************************************************************************
#include "ngraph/runtime/cpu/cpu_mkl_allocator.hpp" #include "ngraph/runtime/cpu/cpu_mkl_allocator.hpp"
ngraph::runtime::cpu::CPUAllocator::CPUAllocator()
: m_buffer(nullptr)
, m_byte_size(0)
{
}
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
#include "ngraph/runtime/aligned_buffer.hpp"
#include "ngraph/util.hpp"
using namespace ngraph;
namespace mkl namespace mkl
{ {
...@@ -33,3 +37,37 @@ namespace mkl ...@@ -33,3 +37,37 @@ namespace mkl
extern i_free_t i_free; extern i_free_t i_free;
} }
} }
namespace ngraph
{
namespace runtime
{
namespace cpu
{
class CPUAllocator;
}
}
}
class ngraph::runtime::cpu::CPUAllocator
{
public:
CPUAllocator(size_t size);
CPUAllocator();
~CPUAllocator();
private:
char* m_buffer;
size_t m_byte_size;
inline void* MallocHook(size_t size)
{
m_buffer = static_cast<char*>(ngraph_malloc(size));
}
inline void FreeHook()
{
ngraph_free(m_buffer);
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment