From 3ad158c7b9d5cd62b2c955a3393272599230a065 Mon Sep 17 00:00:00 2001 From: Sanjoy Das Date: Tue, 28 Jul 2020 12:44:25 -0700 Subject: [PATCH] Add a clarifying comment; NFC PiperOrigin-RevId: 323632239 Change-Id: Ia6c34d90e2c446eedd1a3fee1000951a70c955b8 --- tensorflow/stream_executor/gpu/redzone_allocator.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tensorflow/stream_executor/gpu/redzone_allocator.h b/tensorflow/stream_executor/gpu/redzone_allocator.h index e5e42df73bd..3e56ca386a9 100644 --- a/tensorflow/stream_executor/gpu/redzone_allocator.h +++ b/tensorflow/stream_executor/gpu/redzone_allocator.h @@ -118,6 +118,9 @@ class RedzoneAllocator : public ScratchAllocator { // isn't necessarily just first.size() - 2 * redzone_size_ because when the // user allocation size is not a multiple of 4 bytes, we round up the size of // the RHS redzone. + // + // ScratchAllocators need to free all allocated memory on destruction so we + // use `OwningDeviceMemory` here. std::vector> allocated_buffers_; int64 allocated_bytes_excluding_redzones_ = 0;