From f1f3ebd517089e934cf3f06e64d90619a395ad87 Mon Sep 17 00:00:00 2001 From: Joel Liang Date: Fri, 10 Nov 2017 09:59:19 +0800 Subject: APPBROWSER-298, APPBROWSER-306: Reimplement the common code of compute shader The new common code of compute shader is in file helpers_cs.h Rewrite the direct_convolution1x1.cs and softmax_layer.cs to use the new common code. It will also remove the dependence of the token pasting operator (##). We'll remove the "##" support after we rewrite all of the compute shader code. Change-Id: Icd8553ef6b61ad484a8507590ac8ed499bd47061 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/95455 Tested-by: Kaizen Reviewed-by: Georgios Pinitas Reviewed-by: Frank Lei (cherry picked from commit 0a4f83570d261f839d9866b68979efe8d7a95883) Reviewed-on: http://mpd-gerrit.cambridge.arm.com/95601 Reviewed-by: Jim He --- .../GLES_COMPUTE/cs_shaders/normalization_layer.cs | 96 +++++++++++----------- 1 file changed, 48 insertions(+), 48 deletions(-) (limited to 'src/core/GLES_COMPUTE/cs_shaders/normalization_layer.cs') diff --git a/src/core/GLES_COMPUTE/cs_shaders/normalization_layer.cs b/src/core/GLES_COMPUTE/cs_shaders/normalization_layer.cs index 5699340c14..166953ffc0 100755 --- a/src/core/GLES_COMPUTE/cs_shaders/normalization_layer.cs +++ b/src/core/GLES_COMPUTE/cs_shaders/normalization_layer.cs @@ -45,30 +45,30 @@ BUFFER_DECLARATION(dst, 3, float, writeonly); * @note KAPPA parameter in the normalization equation should be given as a preprocessor argument using "#define KAPPA x" * @note Number of elements on the right or left side to normalize across should be given as a preprocessor argument using "#define RADIUS x" * - * @param[in] src1_ptr Pointer to the first source tensor. Supported data types: F32 - * @param[in] src1_stride_x Stride of the first source tensor in X dimension (in bytes) - * @param[in] src1_step_x src1_stride_x * number of elements along X processed per workitem(in bytes) - * @param[in] src1_stride_y Stride of the first source tensor in Y dimension (in bytes) - * @param[in] src1_step_y src1_stride_y * number of elements along Y processed per workitem(in bytes) - * @param[in] src1_stride_z Stride of the first source tensor in Z dimension (in bytes) - * @param[in] src1_step_z src1_stride_z * number of elements along Z processed per workitem(in bytes) - * @param[in] src1_offset_first_element_in_bytes The offset of the first element in the first source tensor - * @param[in] src2_ptr Pointer to the second source tensor. Supported data types: Same as @p src1_ptr - * @param[in] src2_stride_x Stride of the second source tensor in X dimension (in bytes) - * @param[in] src2_step_x src2_stride_x * number of elements along X processed per workitem(in bytes) - * @param[in] src2_stride_y Stride of the second source tensor in Y dimension (in bytes) - * @param[in] src2_step_y src2_stride_y * number of elements along Y processed per workitem(in bytes) - * @param[in] src2_stride_z Stride of the second source tensor in Z dimension (in bytes) - * @param[in] src2_step_z src2_stride_z * number of elements along Z processed per workitem(in bytes) - * @param[in] src2_offset_first_element_in_bytes The offset of the second element in the second source tensor - * @param[out] dst_ptr Pointer to the destination tensor. Supported data types: Same as @p src1_ptr - * @param[in] dst_stride_x Stride of the destination tensor in X dimension (in bytes) - * @param[in] dst_step_x dst_stride_x * number of elements along X processed per workitem(in bytes) - * @param[in] dst_stride_y Stride of the destination tensor in Y dimension (in bytes) - * @param[in] dst_step_y dst_stride_y * number of elements along Y processed per workitem(in bytes) - * @param[in] dst_stride_z Stride of the destination tensor in Z dimension (in bytes) - * @param[in] dst_step_z dst_stride_z * number of elements along Z processed per workitem(in bytes) - * @param[in] dst_offset_first_element_in_bytes The offset of the first element in the destination tensor + * @param[in] src1_ptr Pointer to the first source tensor. Supported data types: F32 + * @param[in] src1_stride_x Stride of the first source tensor in X dimension (in bytes) + * @param[in] src1_step_x src1_stride_x * number of elements along X processed per workitem(in bytes) + * @param[in] src1_stride_y Stride of the first source tensor in Y dimension (in bytes) + * @param[in] src1_step_y src1_stride_y * number of elements along Y processed per workitem(in bytes) + * @param[in] src1_stride_z Stride of the first source tensor in Z dimension (in bytes) + * @param[in] src1_step_z src1_stride_z * number of elements along Z processed per workitem(in bytes) + * @param[in] src1_offset_first_element_in_bytes The offset of the first element in the first source tensor + * @param[in] src2_ptr Pointer to the second source tensor. Supported data types: Same as @p src1_ptr + * @param[in] src2_stride_x Stride of the second source tensor in X dimension (in bytes) + * @param[in] src2_step_x src2_stride_x * number of elements along X processed per workitem(in bytes) + * @param[in] src2_stride_y Stride of the second source tensor in Y dimension (in bytes) + * @param[in] src2_step_y src2_stride_y * number of elements along Y processed per workitem(in bytes) + * @param[in] src2_stride_z Stride of the second source tensor in Z dimension (in bytes) + * @param[in] src2_step_z src2_stride_z * number of elements along Z processed per workitem(in bytes) + * @param[in] src2_offset_first_element_in_bytes The offset of the second element in the second source tensor + * @param[out] dst_ptr Pointer to the destination tensor. Supported data types: Same as @p src1_ptr + * @param[in] dst_stride_x Stride of the destination tensor in X dimension (in bytes) + * @param[in] dst_step_x dst_stride_x * number of elements along X processed per workitem(in bytes) + * @param[in] dst_stride_y Stride of the destination tensor in Y dimension (in bytes) + * @param[in] dst_step_y dst_stride_y * number of elements along Y processed per workitem(in bytes) + * @param[in] dst_stride_z Stride of the destination tensor in Z dimension (in bytes) + * @param[in] dst_step_z dst_stride_z * number of elements along Z processed per workitem(in bytes) + * @param[in] dst_offset_first_element_in_bytes The offset of the first element in the destination tensor */ void main(void) { @@ -104,30 +104,30 @@ void main(void) * @note KAPPA parameter in the normalization equation should be given as a preprocessor argument using "#define KAPPA x" * @note Number of elements on the right or left side to normalize across should be given as a preprocessor argument using "#define RADIUS x" * - * @param[in] src1_ptr Pointer to the first source tensor. Supported data types: F32 - * @param[in] src1_stride_x Stride of the first source tensor in X dimension (in bytes) - * @param[in] src1_step_x src1_stride_x * number of elements along X processed per workitem(in bytes) - * @param[in] src1_stride_y Stride of the first source tensor in Y dimension (in bytes) - * @param[in] src1_step_y src1_stride_y * number of elements along Y processed per workitem(in bytes) - * @param[in] src1_stride_z Stride of the first source tensor in Z dimension (in bytes) - * @param[in] src1_step_z src1_stride_z * number of elements along Z processed per workitem(in bytes) - * @param[in] src1_offset_first_element_in_bytes The offset of the first element in the first source tensor - * @param[in] src2_ptr Pointer to the second source tensor. Supported data types: Same as @p src1_ptr - * @param[in] src2_stride_x Stride of the second source tensor in X dimension (in bytes) - * @param[in] src2_step_x src2_stride_x * number of elements along X processed per workitem(in bytes) - * @param[in] src2_stride_y Stride of the second source tensor in Y dimension (in bytes) - * @param[in] src2_step_y src2_stride_y * number of elements along Y processed per workitem(in bytes) - * @param[in] src2_stride_z Stride of the second source tensor in Z dimension (in bytes) - * @param[in] src2_step_z src2_stride_z * number of elements along Z processed per workitem(in bytes) - * @param[in] src2_offset_first_element_in_bytes The offset of the second element in the second source tensor - * @param[out] dst_ptr Pointer to the destination tensor. Supported data types: Same as @p src1_ptr - * @param[in] dst_stride_x Stride of the destination tensor in X dimension (in bytes) - * @param[in] dst_step_x dst_stride_x * number of elements along X processed per workitem(in bytes) - * @param[in] dst_stride_y Stride of the destination tensor in Y dimension (in bytes) - * @param[in] dst_step_y dst_stride_y * number of elements along Y processed per workitem(in bytes) - * @param[in] dst_stride_z Stride of the destination tensor in Z dimension (in bytes) - * @param[in] dst_step_z dst_stride_z * number of elements along Z processed per workitem(in bytes) - * @param[in] dst_offset_first_element_in_bytes The offset of the first element in the destination tensor + * @param[in] src1_ptr Pointer to the first source tensor. Supported data types: F32 + * @param[in] src1_stride_x Stride of the first source tensor in X dimension (in bytes) + * @param[in] src1_step_x src1_stride_x * number of elements along X processed per workitem(in bytes) + * @param[in] src1_stride_y Stride of the first source tensor in Y dimension (in bytes) + * @param[in] src1_step_y src1_stride_y * number of elements along Y processed per workitem(in bytes) + * @param[in] src1_stride_z Stride of the first source tensor in Z dimension (in bytes) + * @param[in] src1_step_z src1_stride_z * number of elements along Z processed per workitem(in bytes) + * @param[in] src1_offset_first_element_in_bytes The offset of the first element in the first source tensor + * @param[in] src2_ptr Pointer to the second source tensor. Supported data types: Same as @p src1_ptr + * @param[in] src2_stride_x Stride of the second source tensor in X dimension (in bytes) + * @param[in] src2_step_x src2_stride_x * number of elements along X processed per workitem(in bytes) + * @param[in] src2_stride_y Stride of the second source tensor in Y dimension (in bytes) + * @param[in] src2_step_y src2_stride_y * number of elements along Y processed per workitem(in bytes) + * @param[in] src2_stride_z Stride of the second source tensor in Z dimension (in bytes) + * @param[in] src2_step_z src2_stride_z * number of elements along Z processed per workitem(in bytes) + * @param[in] src2_offset_first_element_in_bytes The offset of the second element in the second source tensor + * @param[out] dst_ptr Pointer to the destination tensor. Supported data types: Same as @p src1_ptr + * @param[in] dst_stride_x Stride of the destination tensor in X dimension (in bytes) + * @param[in] dst_step_x dst_stride_x * number of elements along X processed per workitem(in bytes) + * @param[in] dst_stride_y Stride of the destination tensor in Y dimension (in bytes) + * @param[in] dst_step_y dst_stride_y * number of elements along Y processed per workitem(in bytes) + * @param[in] dst_stride_z Stride of the destination tensor in Z dimension (in bytes) + * @param[in] dst_step_z dst_stride_z * number of elements along Z processed per workitem(in bytes) + * @param[in] dst_offset_first_element_in_bytes The offset of the first element in the destination tensor */ void main(void) { -- cgit v1.2.1