aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/GLES_COMPUTE
diff options
context:
space:
mode:
authorJoel Liang <joel.liang@arm.com>2017-11-10 09:59:19 +0800
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commitf1f3ebd517089e934cf3f06e64d90619a395ad87 (patch)
tree8dac05909b5f522a1c78e0ac4423cb6f65254391 /arm_compute/core/GLES_COMPUTE
parent283c1790da45ab562ecfb2aa7741297191886d85 (diff)
downloadComputeLibrary-f1f3ebd517089e934cf3f06e64d90619a395ad87.tar.gz
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 <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Reviewed-by: Frank Lei <frank.lei@arm.com> (cherry picked from commit 0a4f83570d261f839d9866b68979efe8d7a95883) Reviewed-on: http://mpd-gerrit.cambridge.arm.com/95601 Reviewed-by: Jim He <jim.he@arm.com>
Diffstat (limited to 'arm_compute/core/GLES_COMPUTE')
-rw-r--r--arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h26
-rw-r--r--arm_compute/core/GLES_COMPUTE/kernels/GCSoftmaxLayerKernel.h3
2 files changed, 13 insertions, 16 deletions
diff --git a/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h b/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h
index e601b529ed..9a5376c876 100644
--- a/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h
+++ b/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h
@@ -129,28 +129,28 @@ public:
* @return program id.
*/
void unuse();
- /** Set value at uniform idx.
+ /** Set argument value at index of shader params.
*
- * @param[in] idx Index in vector.
- * @param[in] value Set value.
+ * @param[in] idx Index in shader params.
+ * @param[in] value Argument value to be set.
*/
template <class T>
- void set_params(unsigned int idx, T value)
+ void set_argument(unsigned int idx, T value)
{
- if(idx >= _params.size())
+ if(idx >= _shader_arguments.size())
{
- _params.resize(idx + 1, 0);
+ _shader_arguments.resize(idx + 1, 0);
}
- unsigned int *p = reinterpret_cast<unsigned int *>(&value);
- _params[idx] = *p;
+ unsigned int *p = reinterpret_cast<unsigned int *>(&value);
+ _shader_arguments[idx] = *p;
}
- /** Clear params.
+ /** Clear shader arguments.
*
*/
- void clear_params()
+ void clear_arguments()
{
- _params.clear();
+ _shader_arguments.clear();
}
/** Set shader params binding point.
*
@@ -172,8 +172,8 @@ public:
private:
std::string _name; /**< Kernel name */
GLuint _program; /**< Linked program id */
- std::vector<unsigned int> _params; /**< Store all the values of the shader parameters */
- GLuint _shader_params; /**< Uniform buffer object name for shader parameters */
+ std::vector<unsigned int> _shader_arguments; /**< Store all the values of the shader arguments */
+ GLuint _shader_params_ubo_name; /**< Uniform buffer object name for shader parameters */
GLuint _shader_params_binding_point; /**< The binding point of the uniform block for shader parameters */
GLuint _shader_params_index; /**< The index of the uniform block */
GLint _shader_params_size; /**< The uniform block data size in the shader */
diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCSoftmaxLayerKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCSoftmaxLayerKernel.h
index b9eb305bab..483e19b213 100644
--- a/arm_compute/core/GLES_COMPUTE/kernels/GCSoftmaxLayerKernel.h
+++ b/arm_compute/core/GLES_COMPUTE/kernels/GCSoftmaxLayerKernel.h
@@ -40,9 +40,6 @@ public:
* @param[out] output Destination tensor. Data types supported: same as @p input
*/
void configure(const IGCTensor *input, IGCTensor *output);
-
- // Inherited methods overridden:
- void run(const Window &window) override;
};
/** Interface for shifting the logits values around the max value and exponentiating the result */