Revamp a few ScratchAllocator classes in cudnn_rnn_ops
authorJames Qin <jamesqin@google.com>
Sat, 7 Apr 2018 22:56:24 +0000 (15:56 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Sat, 7 Apr 2018 22:59:36 +0000 (15:59 -0700)
commit22cb902924b3b6e243af6ee386e660c826d60d12
treef4ded03c58500d2f0fefba99309ab1c15291265f
parent4947ccc20b291dc317da7971fdad1b91c7f553b7
Revamp a few ScratchAllocator classes in cudnn_rnn_ops

Prepare for RNN autotune.
* The scratch allocator classes are renamed s.t. they're named by the duration of memory allocated.
  * CudnnReservespaceAllocator ==> CudnnRnnAllocatorInOutput.
  * CudnnWorkspaceAllocator ==> CudnnRnnAllocatorInTemp

* The old CudnnWorkspaceAllocator (new CudnnRnnAllocatorInTemp) is made a template s.t. it works with different tensor dtypes, which is used later in autotune, during which both workspace (uint8) and reserve space (input_dtype) are temp-allocated.

* Change CudnnModelShapes  ==> CudnnRnnModelShapes

PiperOrigin-RevId: 192018334
tensorflow/core/kernels/cudnn_rnn_ops.cc
tensorflow/stream_executor/cuda/cuda_dnn.cc