提交 2f9984ff 编写于 作者: B Berkin Ilbeyi 提交者: TensorFlower Gardener

Allocate input/output buffers at the correct memory space.

PiperOrigin-RevId: 317761146
Change-Id: Ia27b6765a547451575240e76ea419f705e29bd32
上级 d2b35a79
......@@ -35,7 +35,6 @@ XlaInterpreterExecutor::~XlaInterpreterExecutor() {}
DeviceMemoryBase XlaInterpreterExecutor::Allocate(uint64 size,
int64 memory_space) {
CHECK_EQ(memory_space, 0);
return DeviceMemoryBase(new char[size], size);
}
......
......@@ -355,7 +355,9 @@ StatusOr<ScopedShapedBuffer> TransferManager::AllocateScopedShapedBuffer(
ShapeUtil::GetSubshape(shaped_buffer.on_device_shape(), index);
TF_ASSIGN_OR_RETURN(auto memory,
allocator->Allocate(shaped_buffer.device_ordinal(),
GetByteSizeRequirement(subshape)));
GetByteSizeRequirement(subshape),
/*retry_on_failure=*/true,
subshape.layout().memory_space()));
// Move the allocated buffer into the ScopedShapedBuffer, which owns it.
memory_base = memory.Release();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册