aboutsummaryrefslogtreecommitdiff
path: root/compute_kernel_writer/include/ckw
diff options
context:
space:
mode:
Diffstat (limited to 'compute_kernel_writer/include/ckw')
-rw-r--r--compute_kernel_writer/include/ckw/KernelWriter.h15
-rw-r--r--compute_kernel_writer/include/ckw/types/TensorSamplerTypes.h10
2 files changed, 20 insertions, 5 deletions
diff --git a/compute_kernel_writer/include/ckw/KernelWriter.h b/compute_kernel_writer/include/ckw/KernelWriter.h
index 0c8f3de0a1..93ae8aecd6 100644
--- a/compute_kernel_writer/include/ckw/KernelWriter.h
+++ b/compute_kernel_writer/include/ckw/KernelWriter.h
@@ -267,7 +267,7 @@ public:
* @param[in] x x-coordinate
* @param[in] y y-coordinate
* @param[in] z z-coordinate
- * @param[in] batch batch offset
+ * @param[in] batch batch
*/
virtual void op_load(
const TileOperand &tile_op, const TensorOperand &tensor_op, TensorSampler &sampler,
@@ -302,6 +302,19 @@ public:
const TileOperand &x, const TileOperand &y, const TileOperand &z, const TileOperand &batch,
const TileOperand &dilation_x, const TileOperand &dilation_y) = 0;
+ /** Load the data from the tensor memory to the tile using the indirect buffer approach and respecting the sampling information.
+ *
+ * @param[in] tile_op The tile to be loaded.
+ * @param[in] tensor_op The tensor to be read.
+ * @param[in] sampler The tensor sampling information.
+ * @param[in] x x-coordinate
+ * @param[in] y y-coordinate
+ * @param[in] z z-coordinate
+ * @param[in] batch batch
+ */
+ virtual void op_load_indirect(const TileOperand &tile_op, const TensorOperand &tensor_op, TensorSampler &sampler,
+ const TileOperand &x, const TileOperand &y, const TileOperand &z, const TileOperand &batch_op) = 0;
+
protected:
// =============================================================================================
// ID space management
diff --git a/compute_kernel_writer/include/ckw/types/TensorSamplerTypes.h b/compute_kernel_writer/include/ckw/types/TensorSamplerTypes.h
index 3a9f4f5722..43dce1d4e4 100644
--- a/compute_kernel_writer/include/ckw/types/TensorSamplerTypes.h
+++ b/compute_kernel_writer/include/ckw/types/TensorSamplerTypes.h
@@ -22,8 +22,8 @@
* SOFTWARE.
*/
-#ifndef CKW_INCLUDE_CKW_TENSORSAMPLERTYPES_H
-#define CKW_INCLUDE_CKW_TENSORSAMPLERTYPES_H
+#ifndef CKW_INCLUDE_CKW_TYPES_TENSORSAMPLERTYPES_H
+#define CKW_INCLUDE_CKW_TYPES_TENSORSAMPLERTYPES_H
#include <cstdint>
@@ -47,6 +47,7 @@ enum class TensorSamplerFormat : int32_t
* Leftover elements can be handled using overlapping. This involves processing some of the elements in the array twice.
* ClampToBorderMaxOnly : Clamp to max value allowed in the corresponding dimension, and construct an if/else guard to prevent out of bound access,
* e.g. if( y < size-of-dimension-y ){ <do the operation> }
+ * SkipLessThanZero : Skip loading/storing if the index is less than 0
*
* Individual dimensions choose which adddress mode to implement in their respective enum classes.
*/
@@ -65,7 +66,8 @@ enum class TensorSamplerAddressModeY : int32_t
Unknown = 0,
None = 1,
OverlappingMin = 2,
- ClampToBorderMaxOnly = 3
+ ClampToBorderMaxOnly = 3,
+ SkipLessThanZero = 4
};
/**
@@ -79,4 +81,4 @@ enum class TensorSamplerAddressModeZ : int32_t
} // namespace ckw
-#endif //CKW_INCLUDE_CKW_TENSORSAMPLERTYPES_H
+#endif // CKW_INCLUDE_CKW_TYPES_TENSORSAMPLERTYPES_H