arm_compute v18.05
[platform/upstream/armcl.git] / arm_compute / core / ITensor.h
index ef4ea7b..255a236 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2018 ARM Limited.
  *
  * SPDX-License-Identifier: MIT
  *
@@ -24,7 +24,7 @@
 #ifndef __ARM_COMPUTE_ITENSOR_H__
 #define __ARM_COMPUTE_ITENSOR_H__
 
-#include "arm_compute/core/TensorInfo.h"
+#include "arm_compute/core/ITensorInfo.h"
 
 #include <cstdint>
 
@@ -40,12 +40,12 @@ public:
      *
      * @return A pointer to the tensor's metadata.
      */
-    virtual TensorInfo *info() const = 0;
+    virtual ITensorInfo *info() const = 0;
     /** Interface to be implemented by the child class to return the tensor's metadata
      *
      * @return A pointer to the tensor's metadata.
      */
-    virtual TensorInfo *info() = 0;
+    virtual ITensorInfo *info() = 0;
     /** Default virtual destructor */
     virtual ~ITensor() = default;
     /** Interface to be implemented by the child class to return a pointer to CPU memory
@@ -76,6 +76,23 @@ public:
      * @param[in] src Source tensor to copy from.
      */
     void copy_from(const ITensor &src);
+
+    /** Print a tensor to a given stream using user defined formatting information
+     *
+     * @param s      Output stream
+     * @param io_fmt Format information
+     */
+    void print(std::ostream &s, IOFormatInfo io_fmt = IOFormatInfo()) const;
+    /** Flags if the tensor is used or not
+     *
+     * @return True if it is used else false
+     */
+    bool is_used() const;
+    /** Marks a tensor as unused */
+    void mark_as_unused() const;
+
+private:
+    mutable bool _is_used = { true }; /**< Flag that marks if the tensor is used or not */
 };
 
 using IImage = ITensor;