diff options
Diffstat (limited to 'src/core/GLES_COMPUTE')
-rw-r--r-- | src/core/GLES_COMPUTE/GCHelpers.cpp | 34 | ||||
-rw-r--r-- | src/core/GLES_COMPUTE/IGCKernel.cpp | 2 | ||||
-rw-r--r-- | src/core/GLES_COMPUTE/OpenGLES.cpp | 18 | ||||
-rw-r--r-- | src/core/GLES_COMPUTE/gl_entries.in | 1 | ||||
-rw-r--r-- | src/core/GLES_COMPUTE/kernels/GCGEMMInterleave4x4Kernel.cpp | 1 | ||||
-rw-r--r-- | src/core/GLES_COMPUTE/kernels/GCGEMMMatrixAdditionKernel.cpp | 3 | ||||
-rw-r--r-- | src/core/GLES_COMPUTE/kernels/GCGEMMMatrixMultiplyKernel.cpp | 6 | ||||
-rw-r--r-- | src/core/GLES_COMPUTE/kernels/GCTensorShiftKernel.cpp | 1 | ||||
-rw-r--r-- | src/core/GLES_COMPUTE/kernels/GCWeightsReshapeKernel.cpp | 1 |
9 files changed, 57 insertions, 10 deletions
diff --git a/src/core/GLES_COMPUTE/GCHelpers.cpp b/src/core/GLES_COMPUTE/GCHelpers.cpp new file mode 100644 index 0000000000..8970688ca7 --- /dev/null +++ b/src/core/GLES_COMPUTE/GCHelpers.cpp @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include "arm_compute/core/GLES_COMPUTE/GCHelpers.h" + +namespace arm_compute +{ +GPUTarget get_target_from_device() +{ + const std::string device_name = reinterpret_cast<const char *>(glGetString(GL_RENDERER)); + + return get_target_from_name(device_name); +} +} // namespace arm_compute diff --git a/src/core/GLES_COMPUTE/IGCKernel.cpp b/src/core/GLES_COMPUTE/IGCKernel.cpp index 55b7f0da4a..ecd63b54a4 100644 --- a/src/core/GLES_COMPUTE/IGCKernel.cpp +++ b/src/core/GLES_COMPUTE/IGCKernel.cpp @@ -62,7 +62,7 @@ void arm_compute::enqueue(IGCKernel &kernel, const Window &window, const gles::N } IGCKernel::IGCKernel() - : _kernel(), _lws_hint(gles::NDRange(1U, 1U, 1U)) + : _kernel(), _lws_hint(gles::NDRange(1U, 1U, 1U)), _target(GPUTarget::MIDGARD) { } diff --git a/src/core/GLES_COMPUTE/OpenGLES.cpp b/src/core/GLES_COMPUTE/OpenGLES.cpp index d2539d0775..e93b360125 100644 --- a/src/core/GLES_COMPUTE/OpenGLES.cpp +++ b/src/core/GLES_COMPUTE/OpenGLES.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -66,7 +66,8 @@ using glMapBufferRange_func = void *GL_APIENTRY (*)(GLenum target, GLin using glMemoryBarrier_func = void GL_APIENTRY (*)(GLbitfield barriers); using glUniform1ui_func = void GL_APIENTRY (*)(GLint location, GLuint v0); using glUnmapBuffer_func = GLboolean GL_APIENTRY (*)(GLenum target); -using glGetError_func = GLenum GL_APIENTRY (*)(); +using glGetError_func = GLenum GL_APIENTRY (*)(); +using glGetString_func = const GLubyte * GL_APIENTRY (*)(GLenum name); using glGetActiveUniformBlockiv_func = void GL_APIENTRY (*)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); using glUniformBlockBinding_func = void GL_APIENTRY (*)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); using glGetUniformBlockIndex_func = GLuint GL_APIENTRY (*)(GLuint program, const GLchar *uniformBlockName); @@ -668,6 +669,19 @@ GLenum GL_APIENTRY glGetError(void) } } +const GLubyte *GL_APIENTRY glGetString(GLenum name) +{ + auto func = GLESSymbols::get().glGetString; + if(func != nullptr) + { + return func(name); + } + else + { + return nullptr; + } +} + void GL_APIENTRY glGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params) { auto func = GLESSymbols::get().glGetActiveUniformBlockiv; diff --git a/src/core/GLES_COMPUTE/gl_entries.in b/src/core/GLES_COMPUTE/gl_entries.in index 15ce8ee819..17e3aeead7 100644 --- a/src/core/GLES_COMPUTE/gl_entries.in +++ b/src/core/GLES_COMPUTE/gl_entries.in @@ -61,3 +61,4 @@ GL_ENTRY(glGenFramebuffers) GL_ENTRY(glDeleteFramebuffers) GL_ENTRY(glBindFramebuffer) GL_ENTRY(glFramebufferTexture2D) +GL_ENTRY(glGetString) diff --git a/src/core/GLES_COMPUTE/kernels/GCGEMMInterleave4x4Kernel.cpp b/src/core/GLES_COMPUTE/kernels/GCGEMMInterleave4x4Kernel.cpp index dc86bfb2cc..171fbad702 100644 --- a/src/core/GLES_COMPUTE/kernels/GCGEMMInterleave4x4Kernel.cpp +++ b/src/core/GLES_COMPUTE/kernels/GCGEMMInterleave4x4Kernel.cpp @@ -35,7 +35,6 @@ #include "arm_compute/core/Window.h" using namespace arm_compute; -using namespace arm_compute::gles_compute; GCGEMMInterleave4x4Kernel::GCGEMMInterleave4x4Kernel() : _input(nullptr), _output(nullptr) diff --git a/src/core/GLES_COMPUTE/kernels/GCGEMMMatrixAdditionKernel.cpp b/src/core/GLES_COMPUTE/kernels/GCGEMMMatrixAdditionKernel.cpp index 43846dcf32..1a68a62ea5 100644 --- a/src/core/GLES_COMPUTE/kernels/GCGEMMMatrixAdditionKernel.cpp +++ b/src/core/GLES_COMPUTE/kernels/GCGEMMMatrixAdditionKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -34,7 +34,6 @@ #include "arm_compute/core/Window.h" using namespace arm_compute; -using namespace arm_compute::gles_compute; GCGEMMMatrixAdditionKernel::GCGEMMMatrixAdditionKernel() : _input(nullptr), _output(nullptr) diff --git a/src/core/GLES_COMPUTE/kernels/GCGEMMMatrixMultiplyKernel.cpp b/src/core/GLES_COMPUTE/kernels/GCGEMMMatrixMultiplyKernel.cpp index b4bb5470ad..2bd769cac4 100644 --- a/src/core/GLES_COMPUTE/kernels/GCGEMMMatrixMultiplyKernel.cpp +++ b/src/core/GLES_COMPUTE/kernels/GCGEMMMatrixMultiplyKernel.cpp @@ -42,7 +42,6 @@ #include <string> using namespace arm_compute; -using namespace arm_compute::gles_compute; using namespace arm_compute::misc::shape_calculator; namespace @@ -195,10 +194,13 @@ void GCGEMMMatrixMultiplyKernel::configure(const IGCTensor *input0, const IGCTen _input1 = input1; _output = output; + // Get target architecture + GPUTarget gpu_target = get_target(); + ElementsProcessed num_elements_processed{}; // Configure kernel window - auto win_config = validate_and_configure_window(input0->info(), input1->info(), output->info(), is_interleaved_transposed, reshape_info, GPUTarget::UNKNOWN, num_elements_processed); + auto win_config = validate_and_configure_window(input0->info(), input1->info(), output->info(), is_interleaved_transposed, reshape_info, gpu_target, num_elements_processed); ARM_COMPUTE_ERROR_THROW_ON(win_config.first); IGCKernel::configure(win_config.second); diff --git a/src/core/GLES_COMPUTE/kernels/GCTensorShiftKernel.cpp b/src/core/GLES_COMPUTE/kernels/GCTensorShiftKernel.cpp index 21946b7f8d..f0057df769 100644 --- a/src/core/GLES_COMPUTE/kernels/GCTensorShiftKernel.cpp +++ b/src/core/GLES_COMPUTE/kernels/GCTensorShiftKernel.cpp @@ -36,7 +36,6 @@ #include "support/ToolchainSupport.h" using namespace arm_compute; -using namespace arm_compute::gles_compute; GCTensorShiftKernel::GCTensorShiftKernel() : _input(nullptr), _lws(gles::NDRange(1U, 1U, 1U)), _left_padding(0) diff --git a/src/core/GLES_COMPUTE/kernels/GCWeightsReshapeKernel.cpp b/src/core/GLES_COMPUTE/kernels/GCWeightsReshapeKernel.cpp index 55bf9b754b..ccbfaf8410 100644 --- a/src/core/GLES_COMPUTE/kernels/GCWeightsReshapeKernel.cpp +++ b/src/core/GLES_COMPUTE/kernels/GCWeightsReshapeKernel.cpp @@ -36,7 +36,6 @@ #include "arm_compute/core/GLES_COMPUTE/GCHelpers.h" using namespace arm_compute; -using namespace arm_compute::gles_compute; using namespace arm_compute::misc::shape_calculator; GCWeightsReshapeKernel::GCWeightsReshapeKernel() |