aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/common_runtime/gpu/dma_helper.h
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/core/common_runtime/gpu/dma_helper.h')
-rw-r--r--tensorflow/core/common_runtime/gpu/dma_helper.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/tensorflow/core/common_runtime/gpu/dma_helper.h b/tensorflow/core/common_runtime/gpu/dma_helper.h
new file mode 100644
index 0000000000..7b0750f405
--- /dev/null
+++ b/tensorflow/core/common_runtime/gpu/dma_helper.h
@@ -0,0 +1,18 @@
+#ifndef TENSORFLOW_COMMON_RUNTIME_GPU_DMA_HELPER_H_
+#define TENSORFLOW_COMMON_RUNTIME_GPU_DMA_HELPER_H_
+
+#include "tensorflow/core/public/tensor.h"
+
+// For internal use only. Visibility should be limited to brain/framework.
+
+namespace tensorflow {
+class DMAHelper {
+ public:
+ static bool CanUseDMA(const Tensor* t) { return t->CanUseDMA(); }
+ static const void* base(const Tensor* t) { return t->base<const void>(); }
+ static void* base(Tensor* t) { return t->base<void>(); }
+ static TensorBuffer* buffer(Tensor* t) { return t->buf_; }
+ static const TensorBuffer* buffer(const Tensor* t) { return t->buf_; }
+};
+} // namespace tensorflow
+#endif // TENSORFLOW_COMMON_RUNTIME_GPU_DMA_HELPER_H_