Commit 6638e02b authored by Chris Sullivan's avatar Chris Sullivan Committed by Robert Kimball

Added per argument alignment to GPUAllocator::reserve_argspace. (#1069)

* Added per argument alignment to GPUAllocator::reserve_argspace.

* Changed alignment in tests to match update to alignment in backend.
parent f3c2160c
......@@ -84,6 +84,7 @@ runtime::gpu::GPUAllocator::GPUAllocator(const GPUAllocator& g)
size_t runtime::gpu::GPUAllocator::reserve_argspace(const void* data, size_t size)
{
// add parameter data to host buffer that will be transfered to device
size = pass::MemoryManager::align(size, runtime::gpu::GPUMemoryManager::alignment);
size_t offset = m_manager->queue_for_transfer(data, size);
// required to capture m_manager pointer
// directly rather than `this` pointer
......
......@@ -68,7 +68,7 @@ namespace ngraph
size_t m_buffer_offset;
std::vector<uint8_t> m_buffered_mem;
pass::MemoryManager m_workspace_manager;
static constexpr const uint16_t alignment = 4;
static constexpr const uint16_t alignment = 8;
void* m_argspace;
void* m_workspace;
size_t m_allocation_size;
......
......@@ -108,7 +108,7 @@ TEST(gpu_test, memory_manager_seperate_workspaces_allocsize)
{
size_t size = std::pow(2, i);
allocator.reserve_workspace(size);
total_size += pass::MemoryManager::align(size, 4);
total_size += pass::MemoryManager::align(size, 8);
}
}
emitter.allocate_primitive_memory();
......
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