X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=documentation%2Fpixelwise__mul__float_8cl_source.xhtml;h=94c1beeabd710639a26fca35b3ce11d9519c0c33;hb=HEAD;hp=01b77ad918156534804df8491283c824f5ba6427;hpb=bf8b01dfbfdca124673ade33c5eac8f3748d7abd;p=platform%2Fupstream%2Farmcl.git diff --git a/documentation/pixelwise__mul__float_8cl_source.xhtml b/documentation/pixelwise__mul__float_8cl_source.xhtml index 01b77ad..94c1bee 100644 --- a/documentation/pixelwise__mul__float_8cl_source.xhtml +++ b/documentation/pixelwise__mul__float_8cl_source.xhtml @@ -4,7 +4,7 @@ - + Compute Library: src/core/CL/cl_kernels/pixelwise_mul_float.cl Source File @@ -12,22 +12,24 @@ + + + @@ -38,7 +40,7 @@
Compute Library -  17.10 +  18.05
@@ -46,7 +48,7 @@ - + @@ -101,7 +103,7 @@ $(document).ready(function(){initNavTree('pixelwise__mul__float_8cl_source.xhtml onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages +
@@ -115,87 +117,26 @@ $(document).ready(function(){initNavTree('pixelwise__mul__float_8cl_source.xhtml
pixelwise_mul_float.cl
-Go to the documentation of this file.
1 /*
-
2  * Copyright (c) 2016, 2017 ARM Limited.
-
3  *
-
4  * SPDX-License-Identifier: MIT
-
5  *
-
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
-
7  * of this software and associated documentation files (the "Software"), to
-
8  * deal in the Software without restriction, including without limitation the
-
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-
10  * sell copies of the Software, and to permit persons to whom the Software is
-
11  * furnished to do so, subject to the following conditions:
-
12  *
-
13  * The above copyright notice and this permission notice shall be included in all
-
14  * copies or substantial portions of the Software.
-
15  *
-
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-
22  * SOFTWARE.
-
23  */
-
24 #include "helpers.h"
-
25 
-
26 #ifdef SATURATE
-
27 #define CONVERT_OP_FLOAT_STR(x, type, round) (convert_##type##_sat##round(x))
-
28 #else /* SATURATE */
-
29 #define CONVERT_OP_FLOAT_STR(x, type, round) (convert_##type##round(x))
-
30 #endif /* SATURATE */
-
31 #define CONVERT_OP_FLOAT(x, type, round) CONVERT_OP_FLOAT_STR(x, type, round)
-
32 
-
67 __kernel void pixelwise_mul_float(
- - - -
71  const float scale)
-
72 {
-
73  // Get pixels pointer
- - - -
77 
-
78  // Load data
-
79  VEC_DATA_TYPE(DATA_TYPE_RES, 16)
-
80  in1_data = CONVERT(vload16(0, (__global DATA_TYPE_IN1 *)in1.ptr), VEC_DATA_TYPE(DATA_TYPE_RES, 16));
-
81  VEC_DATA_TYPE(DATA_TYPE_RES, 16)
-
82  in2_data = CONVERT(vload16(0, (__global DATA_TYPE_IN2 *)in2.ptr), VEC_DATA_TYPE(DATA_TYPE_RES, 16));
-
83 
-
84  // Perform multiplication
-
85 #ifdef DATA_TYPE_FLOAT
- -
87  res = CONVERT(in1_data * in2_data * (DATA_TYPE_RES)scale, VEC_DATA_TYPE(DATA_TYPE_OUT, 16));
-
88 #else /* DATA_TYPE_FLOAT */
- -
90  res = CONVERT_OP_FLOAT(CONVERT_OP_FLOAT((convert_float16(in1_data * in2_data) * scale), VEC_DATA_TYPE(DATA_TYPE_RES, 16), ROUND), VEC_DATA_TYPE(DATA_TYPE_OUT, 16), ROUND);
-
91 #endif /* DATA_TYPE_FLOAT */
-
92 
-
93  // Store result
-
94  vstore16(res, 0, (__global DATA_TYPE_OUT *)out.ptr);
-
95 }
-
#define CONVERT(x, type)
Definition: fixed_point.h:98
-
#define CONVERT_TO_TENSOR3D_STRUCT(name)
Definition: helpers.h:111
-
Structure to hold 3D tensor information.
Definition: helpers.h:143
+Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, 2017 ARM Limited.
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #include "helpers.h"
25 
26 #ifdef SATURATE
27 #define CONVERT_OP_FLOAT_STR(x, type, round) (convert_##type##_sat##round(x))
28 #else /* SATURATE */
29 #define CONVERT_OP_FLOAT_STR(x, type, round) (convert_##type##round(x))
30 #endif /* SATURATE */
31 #define CONVERT_OP_FLOAT(x, type, round) CONVERT_OP_FLOAT_STR(x, type, round)
32 
67 __kernel void pixelwise_mul_float(
71  const float scale)
72 {
73  // Get pixels pointer
77 
78  // Load data
79  VEC_DATA_TYPE(DATA_TYPE_RES, 16)
80  in1_data = CONVERT(vload16(0, (__global DATA_TYPE_IN1 *)in1.ptr), VEC_DATA_TYPE(DATA_TYPE_RES, 16));
81  VEC_DATA_TYPE(DATA_TYPE_RES, 16)
82  in2_data = CONVERT(vload16(0, (__global DATA_TYPE_IN2 *)in2.ptr), VEC_DATA_TYPE(DATA_TYPE_RES, 16));
83 
84  // Perform multiplication
85 #ifdef DATA_TYPE_FLOAT
87  res = CONVERT(in1_data * in2_data * (DATA_TYPE_RES)scale, VEC_DATA_TYPE(DATA_TYPE_OUT, 16));
88 #else /* DATA_TYPE_FLOAT */
90  res = CONVERT_OP_FLOAT(CONVERT_OP_FLOAT((convert_float16(in1_data * in2_data) * scale), VEC_DATA_TYPE(DATA_TYPE_RES, 16), ROUND), VEC_DATA_TYPE(DATA_TYPE_OUT, 16), ROUND);
91 #endif /* DATA_TYPE_FLOAT */
92 
93  // Store result
94  vstore16(res, 0, (__global DATA_TYPE_OUT *)out.ptr);
95 }
#define CONVERT(x, type)
Definition: fixed_point.h:98
+
#define CONVERT_TO_TENSOR3D_STRUCT(name)
Definition: helpers.h:119
+
Structure to hold 3D tensor information.
Definition: helpers.h:151
#define CONVERT_OP_FLOAT(x, type, round)
__kernel void pixelwise_mul_float(__global uchar *in1_ptr, uint in1_stride_x, uint in1_step_x, uint in1_stride_y, uint in1_step_y, uint in1_stride_z, uint in1_step_z, uint in1_offset_first_element_in_bytes, __global uchar *in2_ptr, uint in2_stride_x, uint in2_step_x, uint in2_stride_y, uint in2_step_y, uint in2_stride_z, uint in2_step_z, uint in2_offset_first_element_in_bytes, __global uchar *out_ptr, uint out_stride_x, uint out_step_x, uint out_stride_y, uint out_step_y, uint out_stride_z, uint out_step_z, uint out_offset_first_element_in_bytes, const float scale)
Performs a pixelwise multiplication with float scale of either integer or float inputs.
-
#define TENSOR3D_DECLARATION(name)
Definition: helpers.h:68
+
#define TENSOR3D_DECLARATION(name)
Definition: helpers.h:76
+
#define VEC_DATA_TYPE(type, size)
Definition: fixed_point.h:93
#define DATA_TYPE_OUT
-
__global uchar * ptr
Pointer to the starting postion of the buffer.
Definition: helpers.h:145
-
SimpleTensor< T > scale(const SimpleTensor< T > &in, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, T constant_border_value)
Definition: Scale.cpp:39
+
__global uchar * ptr
Pointer to the starting postion of the buffer.
Definition: helpers.h:153