From ceaa0bfe219631b5a4e638613f90f9fa47a3defe Mon Sep 17 00:00:00 2001 From: Manuel Bottini Date: Tue, 16 Feb 2021 15:15:19 +0000 Subject: Remove OpenGL ES support Remove the following: - Relevant backend kernels - Relevant backend functions - Relevant backend validation tests - Relevant backend specific examples - Remove backend support from Graph API - Remove backend support from build system Update documentation Resolves: COMPMID-4149 Change-Id: Id0621d6ee35169754de458103907aaba4ef770c0 Signed-off-by: Manuel Bottini Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5097 Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio Reviewed-by: Georgios Pinitas --- src/runtime/GLES_COMPUTE/GCBufferAllocator.cpp | 59 ----- src/runtime/GLES_COMPUTE/GCHelpers.cpp | 85 -------- src/runtime/GLES_COMPUTE/GCMemory.cpp | 81 ------- src/runtime/GLES_COMPUTE/GCMemoryRegion.cpp | 96 --------- src/runtime/GLES_COMPUTE/GCRuntimeContext.cpp | 67 ------ src/runtime/GLES_COMPUTE/GCScheduler.cpp | 142 ------------ src/runtime/GLES_COMPUTE/GCTensor.cpp | 83 ------- src/runtime/GLES_COMPUTE/GCTensorAllocator.cpp | 104 --------- src/runtime/GLES_COMPUTE/IGCSimpleFunction.cpp | 47 ---- .../functions/GCAbsoluteDifference.cpp | 39 ---- .../GLES_COMPUTE/functions/GCActivationLayer.cpp | 44 ---- .../functions/GCArithmeticAddition.cpp | 44 ---- .../functions/GCBatchNormalizationLayer.cpp | 49 ----- .../GLES_COMPUTE/functions/GCConcatenateLayer.cpp | 81 ------- .../GLES_COMPUTE/functions/GCConvolutionLayer.cpp | 240 --------------------- .../functions/GCDepthwiseConvolutionLayer.cpp | 73 ------- .../functions/GCDirectConvolutionLayer.cpp | 84 -------- .../GLES_COMPUTE/functions/GCDropoutLayer.cpp | 50 ----- .../GLES_COMPUTE/functions/GCFillBorder.cpp | 39 ---- .../functions/GCFullyConnectedLayer.cpp | 193 ----------------- src/runtime/GLES_COMPUTE/functions/GCGEMM.cpp | 211 ------------------ .../GLES_COMPUTE/functions/GCGEMMInterleave4x4.cpp | 35 --- .../GLES_COMPUTE/functions/GCGEMMTranspose1xW.cpp | 37 ---- .../functions/GCNormalizationLayer.cpp | 66 ------ .../functions/GCNormalizePlanarYUVLayer.cpp | 54 ----- .../functions/GCPixelWiseMultiplication.cpp | 38 ---- .../GLES_COMPUTE/functions/GCPoolingLayer.cpp | 64 ------ src/runtime/GLES_COMPUTE/functions/GCScale.cpp | 40 ---- .../GLES_COMPUTE/functions/GCSoftmaxLayer.cpp | 81 ------- .../GLES_COMPUTE/functions/GCTensorShift.cpp | 39 ---- src/runtime/GLES_COMPUTE/functions/GCTranspose.cpp | 37 ---- 31 files changed, 2402 deletions(-) delete mode 100644 src/runtime/GLES_COMPUTE/GCBufferAllocator.cpp delete mode 100644 src/runtime/GLES_COMPUTE/GCHelpers.cpp delete mode 100644 src/runtime/GLES_COMPUTE/GCMemory.cpp delete mode 100644 src/runtime/GLES_COMPUTE/GCMemoryRegion.cpp delete mode 100644 src/runtime/GLES_COMPUTE/GCRuntimeContext.cpp delete mode 100644 src/runtime/GLES_COMPUTE/GCScheduler.cpp delete mode 100644 src/runtime/GLES_COMPUTE/GCTensor.cpp delete mode 100644 src/runtime/GLES_COMPUTE/GCTensorAllocator.cpp delete mode 100644 src/runtime/GLES_COMPUTE/IGCSimpleFunction.cpp delete mode 100644 src/runtime/GLES_COMPUTE/functions/GCAbsoluteDifference.cpp delete mode 100644 src/runtime/GLES_COMPUTE/functions/GCActivationLayer.cpp delete mode 100755 src/runtime/GLES_COMPUTE/functions/GCArithmeticAddition.cpp delete mode 100755 src/runtime/GLES_COMPUTE/functions/GCBatchNormalizationLayer.cpp delete mode 100644 src/runtime/GLES_COMPUTE/functions/GCConcatenateLayer.cpp delete mode 100644 src/runtime/GLES_COMPUTE/functions/GCConvolutionLayer.cpp delete mode 100644 src/runtime/GLES_COMPUTE/functions/GCDepthwiseConvolutionLayer.cpp delete mode 100644 src/runtime/GLES_COMPUTE/functions/GCDirectConvolutionLayer.cpp delete mode 100644 src/runtime/GLES_COMPUTE/functions/GCDropoutLayer.cpp delete mode 100644 src/runtime/GLES_COMPUTE/functions/GCFillBorder.cpp delete mode 100644 src/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.cpp delete mode 100644 src/runtime/GLES_COMPUTE/functions/GCGEMM.cpp delete mode 100644 src/runtime/GLES_COMPUTE/functions/GCGEMMInterleave4x4.cpp delete mode 100644 src/runtime/GLES_COMPUTE/functions/GCGEMMTranspose1xW.cpp delete mode 100644 src/runtime/GLES_COMPUTE/functions/GCNormalizationLayer.cpp delete mode 100755 src/runtime/GLES_COMPUTE/functions/GCNormalizePlanarYUVLayer.cpp delete mode 100755 src/runtime/GLES_COMPUTE/functions/GCPixelWiseMultiplication.cpp delete mode 100644 src/runtime/GLES_COMPUTE/functions/GCPoolingLayer.cpp delete mode 100644 src/runtime/GLES_COMPUTE/functions/GCScale.cpp delete mode 100644 src/runtime/GLES_COMPUTE/functions/GCSoftmaxLayer.cpp delete mode 100644 src/runtime/GLES_COMPUTE/functions/GCTensorShift.cpp delete mode 100644 src/runtime/GLES_COMPUTE/functions/GCTranspose.cpp (limited to 'src/runtime/GLES_COMPUTE') diff --git a/src/runtime/GLES_COMPUTE/GCBufferAllocator.cpp b/src/runtime/GLES_COMPUTE/GCBufferAllocator.cpp deleted file mode 100644 index 695331d743..0000000000 --- a/src/runtime/GLES_COMPUTE/GCBufferAllocator.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2018-2020 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/runtime/GLES_COMPUTE/GCBufferAllocator.h" - -#include "arm_compute/core/Error.h" -#include "arm_compute/core/GLES_COMPUTE/OpenGLES.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCMemoryRegion.h" - -#include - -namespace arm_compute -{ -void *GCBufferAllocator::allocate(size_t size, size_t alignment) -{ - ARM_COMPUTE_UNUSED(alignment); - - auto *gl_ssbo_name = new GLuint; - ARM_COMPUTE_GL_CHECK(glBindBuffer(GL_SHADER_STORAGE_BUFFER, *gl_ssbo_name)); - ARM_COMPUTE_GL_CHECK(glBufferData(GL_SHADER_STORAGE_BUFFER, static_cast(size), nullptr, GL_STATIC_DRAW)); - ARM_COMPUTE_GL_CHECK(glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0)); - - return reinterpret_cast(gl_ssbo_name); -} - -void GCBufferAllocator::free(void *ptr) -{ - ARM_COMPUTE_ERROR_ON(ptr == nullptr); - auto *gl_ssbo_name = reinterpret_cast(ptr); - ARM_COMPUTE_GL_CHECK(glDeleteBuffers(1, gl_ssbo_name)); - delete gl_ssbo_name; -} - -std::unique_ptr GCBufferAllocator::make_region(size_t size, size_t alignment) -{ - ARM_COMPUTE_UNUSED(alignment); - return std::make_unique(size); -} -} // namespace arm_compute diff --git a/src/runtime/GLES_COMPUTE/GCHelpers.cpp b/src/runtime/GLES_COMPUTE/GCHelpers.cpp deleted file mode 100644 index f4378d0fbf..0000000000 --- a/src/runtime/GLES_COMPUTE/GCHelpers.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2019 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/runtime/GLES_COMPUTE/GCHelpers.h" - -#include "arm_compute/core/Error.h" - -namespace arm_compute -{ -std::tuple create_opengl_display_and_context() -{ - EGLBoolean res; - EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); - - ARM_COMPUTE_ERROR_ON_MSG_VAR(display == EGL_NO_DISPLAY, "Failed to get display: 0x%x.", eglGetError()); - - res = eglInitialize(display, nullptr, nullptr); - - ARM_COMPUTE_ERROR_ON_MSG_VAR(res == EGL_FALSE, "Failed to initialize egl: 0x%x.", eglGetError()); - ARM_COMPUTE_UNUSED(res); - - const char *egl_extension_st = eglQueryString(display, EGL_EXTENSIONS); - ARM_COMPUTE_ERROR_ON_MSG((strstr(egl_extension_st, "EGL_KHR_create_context") == nullptr), "Failed to query EGL_KHR_create_context"); - ARM_COMPUTE_ERROR_ON_MSG((strstr(egl_extension_st, "EGL_KHR_surfaceless_context") == nullptr), "Failed to query EGL_KHR_surfaceless_context"); - ARM_COMPUTE_UNUSED(egl_extension_st); - - const std::array config_attribs = - { - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES3_BIT_KHR, - EGL_NONE - }; - EGLConfig cfg; - EGLint count; - - res = eglChooseConfig(display, config_attribs.data(), &cfg, 1, &count); - - ARM_COMPUTE_ERROR_ON_MSG_VAR(res == EGL_FALSE, "Failed to choose config: 0x%x.", eglGetError()); - ARM_COMPUTE_UNUSED(res); - - res = eglBindAPI(EGL_OPENGL_ES_API); - - ARM_COMPUTE_ERROR_ON_MSG_VAR(res == EGL_FALSE, "Failed to bind api: 0x%x.", eglGetError()); - - const std::array attribs = - { - EGL_CONTEXT_CLIENT_VERSION, 3, - EGL_NONE - }; - EGLContext context = eglCreateContext(display, - cfg, - EGL_NO_CONTEXT, - attribs.data()); - - ARM_COMPUTE_ERROR_ON_MSG_VAR(context == EGL_NO_CONTEXT, "Failed to create context: 0x%x.", eglGetError()); - ARM_COMPUTE_UNUSED(res); - - res = eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, context); - - ARM_COMPUTE_ERROR_ON_MSG_VAR(res == EGL_FALSE, "Failed to make current: 0x%x.", eglGetError()); - ARM_COMPUTE_UNUSED(res); - - return std::make_tuple(display, context, res); -} -} // namespace arm_compute diff --git a/src/runtime/GLES_COMPUTE/GCMemory.cpp b/src/runtime/GLES_COMPUTE/GCMemory.cpp deleted file mode 100644 index 4d74555f4e..0000000000 --- a/src/runtime/GLES_COMPUTE/GCMemory.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2018-2020 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/runtime/GLES_COMPUTE/GCMemory.h" - -#include "arm_compute/runtime/GLES_COMPUTE/GCMemoryRegion.h" -#include "support/Cast.h" - -namespace arm_compute -{ -GCMemory::GCMemory() - : _region(nullptr), _region_owned(nullptr) -{ -} - -GCMemory::GCMemory(const std::shared_ptr &memory) - : _region(nullptr), _region_owned(memory) -{ - _region_owned = memory; - _region = _region_owned.get(); -} - -GCMemory::GCMemory(IGCMemoryRegion *memory) - : _region(memory), _region_owned(nullptr) -{ - _region = memory; -} - -IGCMemoryRegion *GCMemory::gc_region() -{ - return _region; -} - -IGCMemoryRegion *GCMemory::gc_region() const -{ - return _region; -} - -IMemoryRegion *GCMemory::region() -{ - return _region; -} - -IMemoryRegion *GCMemory::region() const -{ - return _region; -} - -void GCMemory::set_region(IMemoryRegion *region) -{ - auto gc_region = utils::cast::polymorphic_downcast(region); - _region_owned = nullptr; - _region = gc_region; -} - -void GCMemory::set_owned_region(std::unique_ptr region) -{ - _region_owned = utils::cast::polymorphic_downcast_unique_ptr(std::move(region)); - _region = _region_owned.get(); -} -} // namespace arm_compute diff --git a/src/runtime/GLES_COMPUTE/GCMemoryRegion.cpp b/src/runtime/GLES_COMPUTE/GCMemoryRegion.cpp deleted file mode 100644 index 562854fb2b..0000000000 --- a/src/runtime/GLES_COMPUTE/GCMemoryRegion.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2018-2020 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/runtime/GLES_COMPUTE/GCMemoryRegion.h" - -#include "arm_compute/core/Error.h" - -namespace arm_compute -{ -IGCMemoryRegion::IGCMemoryRegion(size_t size) - : IMemoryRegion(size), _mapping(nullptr), _ssbo_name(0) -{ -} - -const GLuint &IGCMemoryRegion::gc_ssbo_name() const -{ - return _ssbo_name; -} - -void *IGCMemoryRegion::buffer() -{ - return _mapping; -} - -const void *IGCMemoryRegion::buffer() const -{ - return _mapping; -} - -GCBufferMemoryRegion::GCBufferMemoryRegion(size_t size) - : IGCMemoryRegion(size) -{ - ARM_COMPUTE_GL_CHECK(glGenBuffers(1, &_ssbo_name)); - ARM_COMPUTE_GL_CHECK(glBindBuffer(GL_SHADER_STORAGE_BUFFER, _ssbo_name)); - ARM_COMPUTE_GL_CHECK(glBufferData(GL_SHADER_STORAGE_BUFFER, static_cast(size), nullptr, GL_STATIC_DRAW)); - ARM_COMPUTE_GL_CHECK(glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0)); -} - -GCBufferMemoryRegion::~GCBufferMemoryRegion() -{ - ARM_COMPUTE_GL_CHECK(glDeleteBuffers(1, &_ssbo_name)); -} - -void *GCBufferMemoryRegion::ptr() -{ - return nullptr; -} - -void *GCBufferMemoryRegion::map(bool blocking) -{ - ARM_COMPUTE_ERROR_ON(_mapping != nullptr); - ARM_COMPUTE_UNUSED(blocking); - - ARM_COMPUTE_GL_CHECK(glBindBuffer(GL_SHADER_STORAGE_BUFFER, _ssbo_name)); - void *p = ARM_COMPUTE_GL_CHECK(glMapBufferRange(GL_SHADER_STORAGE_BUFFER, 0, static_cast(size()), GL_MAP_READ_BIT | GL_MAP_WRITE_BIT)); - _mapping = reinterpret_cast(p); - - return _mapping; -} - -void GCBufferMemoryRegion::unmap() -{ - ARM_COMPUTE_ERROR_ON(_mapping == nullptr); - - ARM_COMPUTE_GL_CHECK(glBindBuffer(GL_SHADER_STORAGE_BUFFER, _ssbo_name)); - ARM_COMPUTE_GL_CHECK(glUnmapBuffer(GL_SHADER_STORAGE_BUFFER)); - ARM_COMPUTE_GL_CHECK(glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0)); - _mapping = nullptr; -} - -std::unique_ptr GCBufferMemoryRegion::extract_subregion(size_t offset, size_t size) -{ - ARM_COMPUTE_UNUSED(offset, size); - return nullptr; -} -} // namespace arm_compute \ No newline at end of file diff --git a/src/runtime/GLES_COMPUTE/GCRuntimeContext.cpp b/src/runtime/GLES_COMPUTE/GCRuntimeContext.cpp deleted file mode 100644 index 2ed78fe099..0000000000 --- a/src/runtime/GLES_COMPUTE/GCRuntimeContext.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2019-2020 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/runtime/GLES_COMPUTE/GCRuntimeContext.h" - -#include "arm_compute/core/Validate.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCHelpers.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" - -namespace arm_compute -{ -GCRuntimeContext::GCRuntimeContext() - : _gpu_owned_scheduler(std::make_unique()), - _gpu_scheduler(_gpu_owned_scheduler.get()), - _core_context() -{ - auto attrs = create_opengl_display_and_context(); - auto display = std::get<0>(attrs); - auto ctx = std::get<1>(attrs); - - _gpu_owned_scheduler->default_init_with_context(display, ctx); - _kernel_lib.init("./cs_shaders/", display, ctx); - - _core_context = GCCoreRuntimeContext(&_kernel_lib); -} - -GCKernelLibrary &GCRuntimeContext::kernel_library() -{ - return _kernel_lib; -} - -GCCoreRuntimeContext *GCRuntimeContext::core_runtime_context() -{ - return &_core_context; -} - -void GCRuntimeContext::set_gpu_scheduler(GCScheduler *scheduler) -{ - ARM_COMPUTE_ERROR_ON_NULLPTR(scheduler); - _gpu_scheduler = scheduler; -} - -GCScheduler *GCRuntimeContext::gpu_scheduler() -{ - return _gpu_scheduler; -} -} // namespace arm_compute diff --git a/src/runtime/GLES_COMPUTE/GCScheduler.cpp b/src/runtime/GLES_COMPUTE/GCScheduler.cpp deleted file mode 100644 index 946d558e05..0000000000 --- a/src/runtime/GLES_COMPUTE/GCScheduler.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 2017-2019 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/runtime/GLES_COMPUTE/GCScheduler.h" - -#include "arm_compute/core/GLES_COMPUTE/GCHelpers.h" -#include "arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h" - -using namespace arm_compute; - -std::once_flag GCScheduler::_initialize_symbols; - -GCScheduler::GCScheduler() - : _display(EGL_NO_DISPLAY), _context(EGL_NO_CONTEXT), _target(GPUTarget::MIDGARD) -{ -} - -GCScheduler::~GCScheduler() -{ - eglDestroyContext(_display, _context); - eglTerminate(_display); - - _context = EGL_NO_CONTEXT; - _display = EGL_NO_DISPLAY; -} - -void GCScheduler::default_init() -{ - setup_context(); - - init(_display, _context); -} - -void GCScheduler::default_init_with_context(EGLDisplay display, EGLContext ctx) -{ - _context = ctx; - _display = display; - - _target = get_target_from_device(); -} - -void GCScheduler::init(EGLDisplay dpy, EGLContext ctx) -{ - _target = get_target_from_device(); - - GCKernelLibrary::get().init("./cs_shaders/", dpy, ctx); -} - -GCScheduler &GCScheduler::get() -{ - std::call_once(_initialize_symbols, opengles31_is_available); - static GCScheduler scheduler; - return scheduler; -} - -void GCScheduler::dispatch(IGCKernel &kernel, bool flush) -{ - kernel.run(kernel.window()); - if(flush) - { - ARM_COMPUTE_GL_CHECK(glFlush()); - } -} - -void GCScheduler::memory_barrier() -{ - ARM_COMPUTE_GL_CHECK(glMemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT)); -} - -void GCScheduler::setup_context() -{ - EGLBoolean res; - _display = eglGetDisplay(EGL_DEFAULT_DISPLAY); - - ARM_COMPUTE_ERROR_ON_MSG_VAR(_display == EGL_NO_DISPLAY, "Failed to get display: 0x%x.", eglGetError()); - - res = eglInitialize(_display, nullptr, nullptr); - - ARM_COMPUTE_ERROR_ON_MSG_VAR(res == EGL_FALSE, "Failed to initialize egl: 0x%x.", eglGetError()); - ARM_COMPUTE_UNUSED(res); - - const char *egl_extension_st = eglQueryString(_display, EGL_EXTENSIONS); - ARM_COMPUTE_ERROR_ON_MSG((strstr(egl_extension_st, "EGL_KHR_create_context") == nullptr), "Failed to query EGL_KHR_create_context"); - ARM_COMPUTE_ERROR_ON_MSG((strstr(egl_extension_st, "EGL_KHR_surfaceless_context") == nullptr), "Failed to query EGL_KHR_surfaceless_context"); - ARM_COMPUTE_UNUSED(egl_extension_st); - - const std::array config_attribs = - { - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES3_BIT_KHR, - EGL_NONE - }; - EGLConfig cfg; - EGLint count; - - res = eglChooseConfig(_display, config_attribs.data(), &cfg, 1, &count); - - ARM_COMPUTE_ERROR_ON_MSG_VAR(res == EGL_FALSE, "Failed to choose config: 0x%x.", eglGetError()); - ARM_COMPUTE_UNUSED(res); - - res = eglBindAPI(EGL_OPENGL_ES_API); - - ARM_COMPUTE_ERROR_ON_MSG_VAR(res == EGL_FALSE, "Failed to bind api: 0x%x.", eglGetError()); - - const std::array attribs = - { - EGL_CONTEXT_CLIENT_VERSION, 3, - EGL_NONE - }; - _context = eglCreateContext(_display, - cfg, - EGL_NO_CONTEXT, - attribs.data()); - - ARM_COMPUTE_ERROR_ON_MSG_VAR(_context == EGL_NO_CONTEXT, "Failed to create context: 0x%x.", eglGetError()); - ARM_COMPUTE_UNUSED(res); - - res = eglMakeCurrent(_display, EGL_NO_SURFACE, EGL_NO_SURFACE, _context); - - ARM_COMPUTE_ERROR_ON_MSG_VAR(res == EGL_FALSE, "Failed to make current: 0x%x.", eglGetError()); - ARM_COMPUTE_UNUSED(res); -} diff --git a/src/runtime/GLES_COMPUTE/GCTensor.cpp b/src/runtime/GLES_COMPUTE/GCTensor.cpp deleted file mode 100644 index a73c9950a4..0000000000 --- a/src/runtime/GLES_COMPUTE/GCTensor.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2017-2019 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/runtime/GLES_COMPUTE/GCTensor.h" - -namespace arm_compute -{ -GCTensor::GCTensor(IRuntimeContext *) - : _allocator(this) -{ -} - -ITensorAllocator *GCTensor::allocator() -{ - return &_allocator; -} - -TensorInfo *GCTensor::info() const -{ - return &_allocator.info(); -} - -TensorInfo *GCTensor::info() -{ - return &_allocator.info(); -} - -uint8_t *GCTensor::buffer() const -{ - return _allocator.data(); -} - -GLuint GCTensor::gc_buffer() const -{ - return _allocator.get_gl_ssbo_name(); -} - -void GCTensor::associate_memory_group(arm_compute::IMemoryGroup *memory_group) -{ - _allocator.set_associated_memory_group(memory_group); -} - -void GCTensor::map(bool blocking) -{ - IGCTensor::map(blocking); -} - -void GCTensor::unmap() -{ - IGCTensor::unmap(); -} - -uint8_t *GCTensor::do_map(bool blocking) -{ - return _allocator.map(blocking); -} - -void GCTensor::do_unmap() -{ - _allocator.unmap(); -} -} // namespace arm_compute diff --git a/src/runtime/GLES_COMPUTE/GCTensorAllocator.cpp b/src/runtime/GLES_COMPUTE/GCTensorAllocator.cpp deleted file mode 100644 index b3344d8ecb..0000000000 --- a/src/runtime/GLES_COMPUTE/GCTensorAllocator.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2017-2020 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/runtime/GLES_COMPUTE/GCTensorAllocator.h" - -#include "arm_compute/core/Error.h" -#include "arm_compute/core/TensorInfo.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCMemoryRegion.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" - -using namespace arm_compute; - -GCTensorAllocator::GCTensorAllocator(IMemoryManageable *owner) - : _owner(owner), _associated_memory_group(nullptr), _memory(), _mapping(nullptr) -{ -} - -uint8_t *GCTensorAllocator::data() -{ - return _mapping; -} - -void GCTensorAllocator::allocate() -{ - if(_associated_memory_group == nullptr) - { - _memory.set_owned_region(std::make_unique(info().total_size())); - } - else - { - _associated_memory_group->finalize_memory(_owner, _memory, info().total_size(), alignment()); - } - info().set_is_resizable(false); -} - -void GCTensorAllocator::free() -{ - _mapping = nullptr; - _memory.set_region(nullptr); - info().set_is_resizable(true); -} - -void GCTensorAllocator::set_associated_memory_group(IMemoryGroup *associated_memory_group) -{ - ARM_COMPUTE_ERROR_ON(associated_memory_group == nullptr); - ARM_COMPUTE_ERROR_ON(_associated_memory_group != nullptr && _associated_memory_group != associated_memory_group); - ARM_COMPUTE_ERROR_ON(_memory.region() != nullptr && _memory.gc_region()->gc_ssbo_name() != 0); - - _associated_memory_group = associated_memory_group; -} - -uint8_t *GCTensorAllocator::lock() -{ - return map(true); -} - -void GCTensorAllocator::unlock() -{ - unmap(); -} - -GLuint GCTensorAllocator::get_gl_ssbo_name() const -{ - return (_memory.region() == nullptr) ? static_cast(0) : _memory.gc_region()->gc_ssbo_name(); -} - -uint8_t *GCTensorAllocator::map(bool blocking) -{ - ARM_COMPUTE_ERROR_ON(_mapping != nullptr); - ARM_COMPUTE_ERROR_ON(_memory.region() == nullptr); - - _mapping = reinterpret_cast(_memory.gc_region()->map(blocking)); - return _mapping; -} - -void GCTensorAllocator::unmap() -{ - ARM_COMPUTE_ERROR_ON(_mapping == nullptr); - ARM_COMPUTE_ERROR_ON(_memory.region() == nullptr); - - _memory.gc_region()->unmap(); - _mapping = nullptr; -} diff --git a/src/runtime/GLES_COMPUTE/IGCSimpleFunction.cpp b/src/runtime/GLES_COMPUTE/IGCSimpleFunction.cpp deleted file mode 100644 index 4bb6a9994f..0000000000 --- a/src/runtime/GLES_COMPUTE/IGCSimpleFunction.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2017-2019 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/runtime/GLES_COMPUTE/IGCSimpleFunction.h" - -#include "arm_compute/core/Error.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" - -using namespace arm_compute; - -IGCSimpleFunction::IGCSimpleFunction(GCRuntimeContext *ctx) //NOLINT - : _kernel(), - _border_handler(), - _ctx(ctx) -{ -} - -void IGCSimpleFunction::run() -{ - ARM_COMPUTE_ERROR_ON_MSG(!_kernel, "The child class didn't set the GLES kernel or function isn't configured"); - GCScheduler *scheduler = (_ctx != nullptr) ? _ctx->gpu_scheduler() : &GCScheduler::get().get(); - ARM_COMPUTE_ERROR_ON(scheduler == nullptr); - - scheduler->dispatch(_border_handler, false); - scheduler->memory_barrier(); - scheduler->dispatch(*_kernel); -} diff --git a/src/runtime/GLES_COMPUTE/functions/GCAbsoluteDifference.cpp b/src/runtime/GLES_COMPUTE/functions/GCAbsoluteDifference.cpp deleted file mode 100644 index 29630c8981..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCAbsoluteDifference.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2017-2020 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/runtime/GLES_COMPUTE/functions/GCAbsoluteDifference.h" - -#include "arm_compute/core/GLES_COMPUTE/kernels/GCAbsoluteDifferenceKernel.h" -#include "arm_compute/core/Helpers.h" - -#include - -using namespace arm_compute; - -void GCAbsoluteDifference::configure(const IGCTensor *input1, const IGCTensor *input2, IGCTensor *output) -{ - auto k = std::make_unique(); - k->configure(input1, input2, output); - _kernel = std::move(k); -} diff --git a/src/runtime/GLES_COMPUTE/functions/GCActivationLayer.cpp b/src/runtime/GLES_COMPUTE/functions/GCActivationLayer.cpp deleted file mode 100644 index b3815f1625..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCActivationLayer.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2017-2020 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/runtime/GLES_COMPUTE/functions/GCActivationLayer.h" - -#include "arm_compute/core/GLES_COMPUTE/kernels/GCActivationLayerKernel.h" -#include "arm_compute/core/Helpers.h" - -namespace arm_compute -{ -GCActivationLayer::GCActivationLayer(GCRuntimeContext *ctx) - : IGCSimpleFunction(ctx) -{ -} - -void GCActivationLayer::configure(IGCTensor *input, IGCTensor *output, ActivationLayerInfo act_info) -{ - auto core_ctx = _ctx ? _ctx->core_runtime_context() : /* Legacy */ nullptr; - - auto k = std::make_unique(core_ctx); - k->configure(input, output, act_info); - _kernel = std::move(k); -} -} // namespace arm_compute diff --git a/src/runtime/GLES_COMPUTE/functions/GCArithmeticAddition.cpp b/src/runtime/GLES_COMPUTE/functions/GCArithmeticAddition.cpp deleted file mode 100755 index 5661a9bfdd..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCArithmeticAddition.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2016-2020 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/runtime/GLES_COMPUTE/functions/GCArithmeticAddition.h" - -#include "arm_compute/core/GLES_COMPUTE/kernels/GCArithmeticAdditionKernel.h" - -#include - -using namespace arm_compute; - -void GCArithmeticAddition::configure(const IGCTensor *input1, const IGCTensor *input2, IGCTensor *output, ConvertPolicy policy, const ActivationLayerInfo &act_info) -{ - ARM_COMPUTE_UNUSED(act_info); - auto k = std::make_unique(); - k->configure(input1, input2, output, policy); - _kernel = std::move(k); -} - -Status GCArithmeticAddition::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, ConvertPolicy policy, const ActivationLayerInfo &act_info) -{ - ARM_COMPUTE_RETURN_ERROR_ON(act_info.enabled()); - return GCArithmeticAdditionKernel::validate(input1, input2, output, policy); -} diff --git a/src/runtime/GLES_COMPUTE/functions/GCBatchNormalizationLayer.cpp b/src/runtime/GLES_COMPUTE/functions/GCBatchNormalizationLayer.cpp deleted file mode 100755 index 7ec0e4224f..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCBatchNormalizationLayer.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2017-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/runtime/GLES_COMPUTE/functions/GCBatchNormalizationLayer.h" - -#include "arm_compute/core/Error.h" -#include "arm_compute/core/TensorInfo.h" -#include "arm_compute/core/Types.h" -#include "arm_compute/core/Validate.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" - -using namespace arm_compute; - -GCBatchNormalizationLayer::GCBatchNormalizationLayer() - : _norm_kernel() -{ -} - -void GCBatchNormalizationLayer::configure(const IGCTensor *input, IGCTensor *output, const IGCTensor *mean, const IGCTensor *var, const IGCTensor *beta, const IGCTensor *gamma, float epsilon, - ActivationLayerInfo act_info) -{ - _norm_kernel.configure(input, output, mean, var, beta, gamma, epsilon, act_info); -} - -void GCBatchNormalizationLayer::run() -{ - GCScheduler::get().dispatch(_norm_kernel, true); -} diff --git a/src/runtime/GLES_COMPUTE/functions/GCConcatenateLayer.cpp b/src/runtime/GLES_COMPUTE/functions/GCConcatenateLayer.cpp deleted file mode 100644 index 2c21d81e17..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCConcatenateLayer.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2019-2020 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/runtime/GLES_COMPUTE/functions/GCConcatenateLayer.h" - -#include "arm_compute/core/Error.h" -#include "arm_compute/core/GLES_COMPUTE/IGCTensor.h" -#include "arm_compute/core/PixelValue.h" -#include "arm_compute/core/Types.h" -#include "arm_compute/core/utils/misc/ShapeCalculator.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" -#include "src/core/helpers/AutoConfiguration.h" - -namespace arm_compute -{ -GCConcatenateLayer::GCConcatenateLayer() - : _concat_kernels(), - _num_inputs(0), - _axis(Window::DimZ) -{ -} - -void GCConcatenateLayer::configure(std::vector inputs_vector, IGCTensor *output, size_t axis) -{ - ARM_COMPUTE_ERROR_ON(inputs_vector.size() < 2); - - _num_inputs = inputs_vector.size(); - _axis = axis; - - TensorShape output_shape = arm_compute::misc::shape_calculator::calculate_concatenate_shape(inputs_vector, axis); - - // Output auto inizialitation if not yet initialized - auto_init_if_empty(*output->info(), output_shape, 1, inputs_vector[0]->info()->data_type()); - - unsigned int offset = 0; - switch(axis) - { - case Window::DimZ: - { - for(unsigned int i = 0; i < _num_inputs; ++i) - { - auto kernel = std::make_unique(); - kernel->configure(inputs_vector.at(i), offset, output); - offset += inputs_vector.at(i)->info()->dimension(axis); - _concat_kernels.emplace_back(std::move(kernel)); - } - break; - } - default: - ARM_COMPUTE_ERROR("Axis not supported"); - } -} - -void GCConcatenateLayer::run() -{ - for(auto &kernel : _concat_kernels) - { - GCScheduler::get().dispatch(*kernel, true); - } -} -} // namespace arm_compute diff --git a/src/runtime/GLES_COMPUTE/functions/GCConvolutionLayer.cpp b/src/runtime/GLES_COMPUTE/functions/GCConvolutionLayer.cpp deleted file mode 100644 index 93a66f012e..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCConvolutionLayer.cpp +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Copyright (c) 2017-2020 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/runtime/GLES_COMPUTE/functions/GCConvolutionLayer.h" - -#include "arm_compute/core/PixelValue.h" -#include "arm_compute/core/Size2D.h" -#include "arm_compute/core/Utils.h" -#include "arm_compute/core/Validate.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" - -#include -#include - -using namespace arm_compute; - -GCConvolutionLayerReshapeWeights::GCConvolutionLayerReshapeWeights() - : _weights_reshape_kernel() -{ -} - -void GCConvolutionLayerReshapeWeights::configure(const IGCTensor *weights, const IGCTensor *biases, IGCTensor *output) -{ - ARM_COMPUTE_ERROR_ON_NULLPTR(weights, output); - ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(weights, 1, DataType::F16, DataType::F32); - ARM_COMPUTE_ERROR_ON(weights->info()->num_dimensions() > 4); - - if(biases != nullptr) - { - ARM_COMPUTE_ERROR_ON(is_data_type_quantized_asymmetric(weights->info()->data_type())); - ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(weights, biases); - ARM_COMPUTE_ERROR_ON(biases->info()->dimension(0) != weights->info()->dimension(3)); - ARM_COMPUTE_ERROR_ON(biases->info()->num_dimensions() > 1); - } - - const bool append_biases = (biases != nullptr) && !is_data_type_quantized_asymmetric(weights->info()->data_type()); - const IGCTensor *biases_to_use = (append_biases) ? biases : nullptr; - - _weights_reshape_kernel.configure(weights, biases_to_use, output); -} - -void GCConvolutionLayerReshapeWeights::run() -{ - GCScheduler::get().dispatch(_weights_reshape_kernel); -} - -GCConvolutionLayer::GCConvolutionLayer(std::shared_ptr memory_manager) - : _memory_group(std::move(memory_manager)), _reshape_weights(), _input_im2col_kernel(), _mm_gemm(), _output_col2im_kernel(), _fill_border(), _activationlayer_function(), _original_weights(nullptr), - _input_im2col_reshaped(), _input_interleaved_reshaped(), _weights_reshaped(), _weights_transposed(), _gemm_output(), _tmp_output(), _is_activationlayer_enabled(false), _is_prepared(false) -{ -} - -void GCConvolutionLayer::configure_mm(const IGCTensor *input, const IGCTensor *weights, IGCTensor *output) -{ - ARM_COMPUTE_ERROR_ON_NULLPTR(input, weights); - ARM_COMPUTE_ERROR_THROW_ON(validate_mm(input->info(), weights->info(), output->info())); - - _mm_gemm.configure(input, weights, nullptr, output, 1.f, 0.0f, GEMMInfo(false, false, true /* Reshape weights only for the first run */)); -} - -Status GCConvolutionLayer::validate_mm(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *output) -{ - // Perform validation step on Matrix multiply function - GCGEMM::validate(input, weights, nullptr, output, 1.0f, 0.0f, GEMMInfo(false, false, true /* Reshape weights only for the first run */)); - return Status{}; -} - -void GCConvolutionLayer::configure(const IGCTensor *input, const IGCTensor *weights, const IGCTensor *biases, IGCTensor *output, const PadStrideInfo &conv_info, const WeightsInfo &weights_info, - const Size2D &dilation, const ActivationLayerInfo &act_info, unsigned int num_groups) -{ - ARM_COMPUTE_ERROR_ON_NULLPTR(input, weights); - ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::F16, DataType::F32); - ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(input, weights); - ARM_COMPUTE_ERROR_ON_MSG(weights_info.are_reshaped(), "Weights already reshaped are not supported!"); - ARM_COMPUTE_ERROR_ON(weights->info()->dimension(2) != input->info()->dimension(2)); - ARM_COMPUTE_ERROR_ON(weights->info()->num_dimensions() > 4); - ARM_COMPUTE_ERROR_ON(num_groups > 1); - ARM_COMPUTE_UNUSED(num_groups); - - _is_prepared = false; - _original_weights = weights; - - if(biases != nullptr) - { - ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(input, biases); - ARM_COMPUTE_ERROR_ON(biases->info()->dimension(0) != weights->info()->dimension(3)); - ARM_COMPUTE_ERROR_ON(biases->info()->num_dimensions() > 1); - } - - const DataType dt = input->info()->data_type(); - - // Set the GPU target for im2col and col2im - _input_im2col_kernel.set_target(GCScheduler::get().get_target()); - _output_col2im_kernel.set_target(GCScheduler::get().get_target()); - - const bool append_bias = (biases != nullptr); - const unsigned bias_element = (append_bias) ? 1 : 0; - const IGCTensor *biases_to_use = (append_bias) ? biases : nullptr; - - // Get parameters from conv_info - unsigned int stride_x = 0; - unsigned int stride_y = 0; - std::tie(stride_x, stride_y) = conv_info.stride(); - - // Get convolved dimensions - unsigned int conv_w = 0; - unsigned int conv_h = 0; - - const unsigned int kernel_width = weights->info()->dimension(0); - const unsigned int kernel_height = weights->info()->dimension(1); - std::tie(conv_w, conv_h) = scaled_dimensions(input->info()->dimension(0), input->info()->dimension(1), kernel_width, kernel_height, - conv_info, dilation); - - unsigned int mat_weights_cols = weights->info()->dimension(3); - unsigned int mat_weights_rows = weights->info()->dimension(0) * weights->info()->dimension(1) * weights->info()->dimension(2) + bias_element; - - // _weights_reshaped will be auto configured in the kernel. - // Just append biases and do not transpose 1xW as it will be reshaped in GCGEMM - _reshape_weights.configure(weights, biases_to_use, &_weights_reshaped); - - weights = &_weights_reshaped; - - // Create tensor to store im2col reshaped inputs - const unsigned int mat_input_cols = mat_weights_rows; - const unsigned int mat_input_rows = conv_w * conv_h; - TensorShape shape_im2col = input->info()->tensor_shape(); - shape_im2col.set(0, mat_input_cols); - shape_im2col.set(1, mat_input_rows); - shape_im2col.set(2, 1); - - // FIXME: input->clone() doesn't work with subtensors for grouped convolutions. - TensorInfo im2col_reshaped_info(shape_im2col, 1, dt); - _input_im2col_reshaped.allocator()->init(im2col_reshaped_info); - _memory_group.manage(&_input_im2col_reshaped); - - // Create GEMM output tensor - TensorShape shape_gemm = _input_im2col_reshaped.info()->tensor_shape(); - shape_gemm.set(0, mat_weights_cols); - shape_gemm.set(1, mat_input_rows); - const DataType gemm_data_type = dt; - - // FIXME: input->clone() doesn't work with subtensors for grouped convolutions. - TensorInfo info_gemm(shape_gemm, 1, gemm_data_type); - _gemm_output.allocator()->init(info_gemm); - _memory_group.manage(&_gemm_output); - - if(dt == DataType::F16) - { - BorderSize border_size = BorderSize(conv_info.pad_top(), conv_info.pad_right(), conv_info.pad_bottom(), conv_info.pad_left()); - input->info()->extend_padding(border_size); - _fill_border.configure(input, border_size, BorderMode::CONSTANT, PixelValue()); // for PAD of im2col fp16: consider it as border - } - // Configure im2col - _input_im2col_kernel.configure(input, &_input_im2col_reshaped, Size2D(kernel_width, kernel_height), conv_info, append_bias, dilation); - - // Configure GEMM - configure_mm(&_input_im2col_reshaped, weights, &_gemm_output); - - _input_im2col_reshaped.allocator()->allocate(); - - // Configure Col2Im - _output_col2im_kernel.configure(&_gemm_output, output, std::make_pair(conv_w, conv_h)); - _gemm_output.allocator()->allocate(); - - ARM_COMPUTE_ERROR_ON_MSG((output->info()->dimension(0) != conv_w) || (output->info()->dimension(1) != conv_h), "Output shape does not match the expected one"); - - //Configure Activation Layer - _is_activationlayer_enabled = act_info.enabled(); - - if(_is_activationlayer_enabled) - { - _activationlayer_function.configure(output, nullptr, act_info); - } - - ARM_COMPUTE_UNUSED(weights_info); -} - -void GCConvolutionLayer::run() -{ - prepare(); - - MemoryGroupResourceScope scope_mg(_memory_group); - - // Run im2col - GCScheduler::get().dispatch(_fill_border); - GCScheduler::get().memory_barrier(); - GCScheduler::get().dispatch(_input_im2col_kernel); - - // Run gemm on reshaped matrices - _mm_gemm.run(); - GCScheduler::get().memory_barrier(); - - // Reshape output matrix - GCScheduler::get().dispatch(_output_col2im_kernel, false); - GCScheduler::get().memory_barrier(); - - // Run Activation Layer - if(_is_activationlayer_enabled) - { - _activationlayer_function.run(); - } -} - -void GCConvolutionLayer::prepare() -{ - if(!_is_prepared) - { - ARM_COMPUTE_ERROR_ON(!_original_weights->is_used()); - - // Run weights reshaping and mark as unused - _weights_reshaped.allocator()->allocate(); - _reshape_weights.run(); - - // Mark original weights tensor as unused - _original_weights->mark_as_unused(); - - _is_prepared = true; - } -} diff --git a/src/runtime/GLES_COMPUTE/functions/GCDepthwiseConvolutionLayer.cpp b/src/runtime/GLES_COMPUTE/functions/GCDepthwiseConvolutionLayer.cpp deleted file mode 100644 index 46d5cc40d9..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCDepthwiseConvolutionLayer.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2017-2020 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/runtime/GLES_COMPUTE/functions/GCDepthwiseConvolutionLayer.h" - -#include "arm_compute/core/GLES_COMPUTE/IGCTensor.h" -#include "arm_compute/core/PixelValue.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" - -using namespace arm_compute; - -GCDepthwiseConvolutionLayer3x3::GCDepthwiseConvolutionLayer3x3() - : _kernel(nullptr), _border_handler(), _shift_handler(), _activationlayer_function(), _is_activationlayer_enabled(false) -{ -} - -void GCDepthwiseConvolutionLayer3x3::configure(IGCTensor *input, const IGCTensor *weights, const IGCTensor *biases, IGCTensor *output, const PadStrideInfo &conv_info, - unsigned int depth_multiplier, const ActivationLayerInfo &act_info, const Size2D &dilation) -{ - ARM_COMPUTE_ERROR_ON(dilation.x() != 1 || dilation.y() != 1); - ARM_COMPUTE_UNUSED(dilation); - auto k = std::make_unique(); - k->configure(input, weights, biases, output, conv_info, depth_multiplier); - _kernel = std::move(k); - - // Configure border handler - _border_handler.configure(input, _kernel->border_size(), BorderMode::CONSTANT, PixelValue()); - - _shift_handler.configure(input); - - //Configure Activation Layer - _is_activationlayer_enabled = act_info.enabled(); - - if(_is_activationlayer_enabled) - { - _activationlayer_function.configure(output, nullptr, act_info); - } -} - -void GCDepthwiseConvolutionLayer3x3::run() -{ - GCScheduler::get().dispatch(_shift_handler, false); - GCScheduler::get().memory_barrier(); - GCScheduler::get().dispatch(_border_handler, false); - GCScheduler::get().memory_barrier(); - GCScheduler::get().dispatch(*_kernel); - - // Run Activation Layer - if(_is_activationlayer_enabled) - { - _activationlayer_function.run(); - } -} diff --git a/src/runtime/GLES_COMPUTE/functions/GCDirectConvolutionLayer.cpp b/src/runtime/GLES_COMPUTE/functions/GCDirectConvolutionLayer.cpp deleted file mode 100644 index 63c963196a..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCDirectConvolutionLayer.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2017-2020 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/runtime/GLES_COMPUTE/functions/GCDirectConvolutionLayer.h" - -#include "arm_compute/core/GLES_COMPUTE/IGCTensor.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCDirectConvolutionLayerKernel.h" -#include "arm_compute/core/Helpers.h" -#include "arm_compute/core/PixelValue.h" -#include "arm_compute/core/TensorInfo.h" -#include "arm_compute/core/Utils.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" - -using namespace arm_compute; - -GCDirectConvolutionLayer::GCDirectConvolutionLayer() - : _kernel(nullptr), _border_handler(), _shift_handler() -{ -} - -void GCDirectConvolutionLayer::configure(IGCTensor *input, const IGCTensor *weights, const IGCTensor *biases, IGCTensor *output, const PadStrideInfo &conv_info, - const ActivationLayerInfo &act_info) -{ - int kernel_size = weights->info()->dimension(0); - - if(kernel_size == 1) - { - auto k = std::make_unique(); - k->configure(input, weights, biases, output, conv_info, act_info); - _kernel = std::move(k); - } - else if(kernel_size == 3) - { - auto k = std::make_unique(); - k->configure(input, weights, biases, output, conv_info, act_info); - _kernel = std::move(k); - } - else if(kernel_size == 5) - { - auto k = std::make_unique(); - k->configure(input, weights, biases, output, conv_info, act_info); - _kernel = std::move(k); - } - else - { - ARM_COMPUTE_ERROR("kernel size unsupported!"); - return; - } - - _border_handler.configure(input, _kernel->border_size(), BorderMode::CONSTANT, PixelValue()); - - _shift_handler.configure(input); -} - -void GCDirectConvolutionLayer::run() -{ - GCScheduler::get().dispatch(_shift_handler, false); - GCScheduler::get().memory_barrier(); - GCScheduler::get().dispatch(_border_handler, false); - GCScheduler::get().memory_barrier(); - GCScheduler::get().dispatch(*_kernel); - GCScheduler::get().memory_barrier(); - GCScheduler::get().dispatch(_shift_handler); -} diff --git a/src/runtime/GLES_COMPUTE/functions/GCDropoutLayer.cpp b/src/runtime/GLES_COMPUTE/functions/GCDropoutLayer.cpp deleted file mode 100644 index 661bf5f9d6..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCDropoutLayer.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2017 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/runtime/GLES_COMPUTE/functions/GCDropoutLayer.h" - -#include "arm_compute/core/Validate.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCTensor.h" - -using namespace arm_compute; - -GCDropoutLayer::GCDropoutLayer() - : _dropout_kernel() -{ -} - -void GCDropoutLayer::configure(const IGCTensor *input, IGCTensor *mask, IGCTensor *output, float ratio, bool forward) -{ - ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::F16, DataType::F32); - ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(input, mask, output); - - // Configure kernel - _dropout_kernel.configure(input, mask, output, ratio, forward); -} - -void GCDropoutLayer::run() -{ - GCScheduler::get().dispatch(_dropout_kernel); -} diff --git a/src/runtime/GLES_COMPUTE/functions/GCFillBorder.cpp b/src/runtime/GLES_COMPUTE/functions/GCFillBorder.cpp deleted file mode 100644 index 97b4fd946c..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCFillBorder.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2017-2020 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/runtime/GLES_COMPUTE/functions/GCFillBorder.h" - -#include "arm_compute/core/GLES_COMPUTE/kernels/GCFillBorderKernel.h" -#include "arm_compute/core/Helpers.h" - -#include - -using namespace arm_compute; - -void GCFillBorder::configure(IGCTensor *tensor, unsigned int border_width, BorderMode border_mode, const PixelValue &constant_border_value) -{ - auto k = std::make_unique(); - k->configure(tensor, BorderSize(border_width), border_mode, constant_border_value); - _kernel = std::move(k); -} diff --git a/src/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.cpp b/src/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.cpp deleted file mode 100644 index 299a027b42..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright (c) 2017-2020 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/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.h" - -#include "arm_compute/core/Validate.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" - -#include - -using namespace arm_compute; - -void GCFullyConnectedLayerReshapeWeights::configure(const IGCTensor *input, IGCTensor *output) -{ - auto k = std::make_unique(); - k->configure(input, output); - _kernel = std::move(k); -} - -GCFullyConnectedLayer::GCFullyConnectedLayer(std::shared_ptr memory_manager, IWeightsManager *weights_manager) - : _memory_group(std::move(memory_manager)), _weights_manager(std::move(weights_manager)), _im2col_kernel(), _reshape_weights_kernel(), _mm_kernel(), _accumulate_biases_kernel(), _im2col_output(), - _reshape_weights_output(), _original_weights(nullptr), _are_weights_reshaped(true), _is_fc_after_conv(true), _accumulate_biases(false) -{ -} - -void GCFullyConnectedLayer::configure_conv_fc(const IGCTensor *input, const IGCTensor *weights, IGCTensor *output) -{ - ARM_COMPUTE_ERROR_ON((weights->info()->dimension(1) != (input->info()->dimension(0) * input->info()->dimension(1) * input->info()->dimension(2)))); - - const DataType dt = input->info()->data_type(); - - // If the fully connected layer is called after a convolution layer, the input tensor must be linearized - - // Initialize output tensor for im2col - TensorShape shape_im2col; - shape_im2col.set(0, input->info()->dimension(0) * input->info()->dimension(1) * input->info()->dimension(2)); - shape_im2col.set(1, input->info()->dimension(3)); - shape_im2col.set(2, input->info()->dimension(4)); - shape_im2col.set(3, input->info()->dimension(5)); - _im2col_output.allocator()->init(TensorInfo(shape_im2col, 1, dt)); - - // Configure im2col kernel - _memory_group.manage(&_im2col_output); - _im2col_kernel.configure(input, &_im2col_output, Size2D(1, 1), PadStrideInfo(1, 1, 0, 0), false); - - // Configure matrix multiply kernel - _mm_kernel.configure(&_im2col_output, weights, output, 1.0f, false); - - // Allocate the output tensor for im2col once all the configure methods have been called - _im2col_output.allocator()->allocate(); -} - -void GCFullyConnectedLayer::configure_fc_fc(const IGCTensor *input, const IGCTensor *weights, IGCTensor *output) -{ - ARM_COMPUTE_ERROR_ON(input->info()->dimension(0) != weights->info()->dimension(1)); - - // Configure matrix multiply kernel - _mm_kernel.configure(input, weights, output, 1.0f, false); -} - -void GCFullyConnectedLayer::configure(const IGCTensor *input, const IGCTensor *weights, const IGCTensor *biases, IGCTensor *output, - FullyConnectedLayerInfo fc_info) -{ - ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::F32, DataType::F16); - ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(input, weights, output); - ARM_COMPUTE_ERROR_ON(weights->info()->num_dimensions() > 2); - - _original_weights = weights; - _are_weights_reshaped = fc_info.transpose_weights ? fc_info.are_weights_reshaped : true; - _is_fc_after_conv = true; - _accumulate_biases = false; - - if(biases != nullptr) - { - ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(input, biases); - - _accumulate_biases = true; - - // Configure accumulate biases kernel - _accumulate_biases_kernel.configure(output, biases); - } - - // With the Fully Connected layer we can have 4 different cases: - // 1) Convolution layer -> Fully Connected layer without batches - // 2) Fully Connected layer -> Fully Connected layer without batches - // 3) Convolution layer -> Fully Connected layer with batches - // 4) Fully Connected layer -> Fully Connected layer with batches - - const IGCTensor *weights_to_use = weights; - - if(!_are_weights_reshaped) - { - weights_to_use = &_reshape_weights_output; - - // Reshape the weights - _reshape_weights_kernel.configure(weights, &_reshape_weights_output); - } - - // Check if we have a fully connected layer with batches - const bool is_batched_fc_layer = output->info()->dimension(1) > 1; - - if(is_batched_fc_layer) - { - _is_fc_after_conv = (TensorShape::num_max_dimensions >= 4) && (std::equal(input->info()->tensor_shape().cbegin() + 3, - input->info()->tensor_shape().cend(), - output->info()->tensor_shape().cbegin() + 1)); - } - else - { - _is_fc_after_conv = input->info()->num_dimensions() > 1; - } - - if(_is_fc_after_conv) - { - // Fully Connected layer after a Convolution Layer without batches - configure_conv_fc(input, weights_to_use, output); - } - else - { - // Fully Connected layer after a Fully Connected Layer without batches - configure_fc_fc(input, weights_to_use, output); - } - - ARM_COMPUTE_ERROR_ON(fc_info.retain_internal_weights && _reshape_weights_output.gc_buffer() == 0); - _are_weights_reshaped = _are_weights_reshaped || fc_info.retain_internal_weights; -} - -void GCFullyConnectedLayer::run() -{ - prepare(); - - MemoryGroupResourceScope scope_mg(_memory_group); - - // Linearize input if it comes from a convolutional layer - if(_is_fc_after_conv) - { - GCScheduler::get().dispatch(_im2col_kernel, false); - } - - if(!_are_weights_reshaped || _is_fc_after_conv) - { - GCScheduler::get().memory_barrier(); - } - - // Run matrix multiply - GCScheduler::get().dispatch(_mm_kernel, !_accumulate_biases); - - // Accumulate biases if provided - if(_accumulate_biases) - { - GCScheduler::get().memory_barrier(); - - GCScheduler::get().dispatch(_accumulate_biases_kernel); - } -} - -void GCFullyConnectedLayer::prepare() -{ - // Reshape of the weights (happens only once) - if(!_are_weights_reshaped) - { - ARM_COMPUTE_ERROR_ON(!_original_weights->is_used()); - - // Run reshape weights kernel and mark weights as unused - _reshape_weights_output.allocator()->allocate(); - _reshape_weights_kernel.run(); - - // Mark original weights tensor as unused - _original_weights->mark_as_unused(); - - _are_weights_reshaped = true; - } -} diff --git a/src/runtime/GLES_COMPUTE/functions/GCGEMM.cpp b/src/runtime/GLES_COMPUTE/functions/GCGEMM.cpp deleted file mode 100644 index a5a26f4bb9..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCGEMM.cpp +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright (c) 2017-2019 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/runtime/GLES_COMPUTE/functions/GCGEMM.h" - -#include "arm_compute/core/Error.h" -#include "arm_compute/core/GLES_COMPUTE/GCHelpers.h" -#include "arm_compute/core/GLES_COMPUTE/IGCTensor.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCGEMMInterleave4x4Kernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixAdditionKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixMultiplyKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCGEMMTranspose1xWKernel.h" -#include "arm_compute/core/Helpers.h" -#include "arm_compute/core/TensorInfo.h" -#include "arm_compute/core/Types.h" -#include "arm_compute/core/Validate.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" -#include "arm_compute/runtime/ITensorAllocator.h" - -using namespace arm_compute; - -namespace -{ -Status validate_arguments(const ITensorInfo *a, const ITensorInfo *b, const IGCTensor *c, const ITensorInfo *output, const float alpha, const float beta, const GEMMInfo &gemm_info = GEMMInfo()) -{ - ARM_COMPUTE_ERROR_ON_NULLPTR(a, b, output); - - ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(a, 1, DataType::F16, DataType::F32); - ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(a, b, output); - ARM_COMPUTE_ERROR_ON_MSG(gemm_info.is_a_reshaped(), "Matrix A already reshaped is not supported"); - ARM_COMPUTE_ERROR_ON_MSG(gemm_info.is_b_reshaped(), "Matrix B already reshaped is not supported"); - - if(c != nullptr) - { - ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(a, c->info()); - ARM_COMPUTE_ERROR_ON_MSG(a->dimension(1) != c->info()->dimension(1), "The C matrix must have the same number of rows as the matrix A"); - ARM_COMPUTE_ERROR_ON_MSG(b->dimension(0) != c->info()->dimension(0), "The C matrix must have the same number of columns as the matrix B"); - } - - if(output->total_size() != 0) - { - ARM_COMPUTE_RETURN_ERROR_ON_MSG(b->dimension(0) != output->dimension(0), "The output matrix must have the same number of columns as the matrix B"); - ARM_COMPUTE_RETURN_ERROR_ON_MSG(a->dimension(1) != output->dimension(1), "The output matrix must have the same number of rows as the matrix A"); - } - - ARM_COMPUTE_RETURN_ERROR_ON_MSG(a->dimension(0) != b->dimension(1), "The product AB is defined only if the number of columns in A is equal to the number of rows in B"); - - ARM_COMPUTE_UNUSED(alpha); - ARM_COMPUTE_UNUSED(beta); - ARM_COMPUTE_UNUSED(gemm_info); - return Status{}; -} -} // namespace - -GCGEMM::GCGEMM(std::shared_ptr memory_manager) - : _memory_group(std::move(memory_manager)), _interleave_kernel(), _transpose_kernel(), _mm_kernel(), _ma_kernel(), _tmp_a(), _tmp_b(), _original_b(nullptr), _is_interleaved_transposed(false), - _run_addition(false), _reshape_b_only_on_first_run(false), _is_prepared(false) -{ -} - -void GCGEMM::configure(const IGCTensor *a, const IGCTensor *b, const IGCTensor *c, IGCTensor *output, float alpha, float beta, const GEMMInfo &gemm_info) -{ - ARM_COMPUTE_ERROR_ON_NULLPTR(a, b, output); - - // Perform validation step - ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(a->info(), b->info(), c, output->info(), alpha, beta, gemm_info)); - - // Check if we need to reshape the matrix B only on the first run - _reshape_b_only_on_first_run = gemm_info.reshape_b_only_on_first_run(); - _is_prepared = false; - _original_b = b; - - const IGCTensor *matrix_a = a; - const IGCTensor *matrix_b = b; - - // Get the GPU target - const GPUTarget gpu_target = GCScheduler::get().get_target(); - - // Set the target for the kernels - _interleave_kernel.set_target(gpu_target); - _mm_kernel.set_target(gpu_target); - - // Arguments used by GEMMReshapeInfo - // If we pass the matrix A and matrix B reshaped to GCGEMMMatrixMultiplyKernel, we need to pass m, n, k, mult_transpose1xW_width and mult_interleave4x4_height to GCGEMMReshapeInfo - // in order to know how the matrices have been reshaped - const int m = a->info()->dimension(1); - const int n = b->info()->dimension(0); - const int k = a->info()->dimension(0); - int mult_transpose1xW_width = 1; - int mult_interleave4x4_height = 1; - - // If the input tensor has less than 16 rows, we run a special version of GEMM without reshaping the input tensors - _is_interleaved_transposed = a->info()->dimension(1) > 16; - - if(_is_interleaved_transposed) - { - matrix_a = &_tmp_a; - matrix_b = &_tmp_b; - - // Manage intermediate buffers - _memory_group.manage(&_tmp_a); - if(!_reshape_b_only_on_first_run) - { - _memory_group.manage(&_tmp_b); - } - // _tmp_a and _tmp_b will be auto configured in _interleave_kernel and in _transpose_kernel - - // Configure interleave kernel - _interleave_kernel.configure(a, &_tmp_a); - - // Configure transpose kernel - _transpose_kernel.configure(b, &_tmp_b); - } - - _mm_kernel.configure(matrix_a, matrix_b, output, alpha, _is_interleaved_transposed, GEMMReshapeInfo(m, n, k, mult_transpose1xW_width, mult_interleave4x4_height)); - - if(_is_interleaved_transposed) - { - // Allocate intermediate tensors - _tmp_a.allocator()->allocate(); - if(!_reshape_b_only_on_first_run) - { - _tmp_b.allocator()->allocate(); - } - } - - // Configure matrix addition kernel - if(beta != 0 && c != nullptr) - { - _ma_kernel.configure(c, output, beta); - _run_addition = true; - } -} - -Status GCGEMM::validate(const ITensorInfo *a, const ITensorInfo *b, const IGCTensor *c, const ITensorInfo *output, const float alpha, const float beta, const GEMMInfo &gemm_info) -{ - ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(a, b, c, output, alpha, beta, gemm_info)); - return Status{}; -} - -void GCGEMM::run() -{ - prepare(); - - MemoryGroupResourceScope scope_mg(_memory_group); - - if(_is_interleaved_transposed) - { - // Run interleave kernel - GCScheduler::get().dispatch(_interleave_kernel, false); - - if(!_reshape_b_only_on_first_run) - { - // Run transpose kernel - GCScheduler::get().dispatch(_transpose_kernel, false); - } - - GCScheduler::get().memory_barrier(); - } - - // Run matrix multiply kernel - GCScheduler::get().dispatch(_mm_kernel, !_run_addition); - - // Run matrix addition kernel - if(_run_addition) - { - GCScheduler::get().memory_barrier(); - GCScheduler::get().dispatch(_ma_kernel); - } -} - -void GCGEMM::prepare() -{ - if(!_is_prepared) - { - if(_is_interleaved_transposed && _reshape_b_only_on_first_run) - { - ARM_COMPUTE_ERROR_ON(!_original_b->is_used()); - - // Run transpose kernel - _tmp_b.allocator()->allocate(); - GCScheduler::get().dispatch(_transpose_kernel, false); - GCScheduler::get().memory_barrier(); - - // Mark original weights tensor as unused - _original_b->mark_as_unused(); - } - - _is_prepared = true; - } -} diff --git a/src/runtime/GLES_COMPUTE/functions/GCGEMMInterleave4x4.cpp b/src/runtime/GLES_COMPUTE/functions/GCGEMMInterleave4x4.cpp deleted file mode 100644 index c1287f7e9c..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCGEMMInterleave4x4.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2017-2020 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/runtime/GLES_COMPUTE/functions/GCGEMMInterleave4x4.h" - -#include "arm_compute/core/GLES_COMPUTE/kernels/GCGEMMInterleave4x4Kernel.h" - -using namespace arm_compute; - -void GCGEMMInterleave4x4::configure(const IGCTensor *input, IGCTensor *output) -{ - auto k = std::make_unique(); - k->configure(input, output); - _kernel = std::move(k); -} diff --git a/src/runtime/GLES_COMPUTE/functions/GCGEMMTranspose1xW.cpp b/src/runtime/GLES_COMPUTE/functions/GCGEMMTranspose1xW.cpp deleted file mode 100644 index d085357eaa..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCGEMMTranspose1xW.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2017-2020 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/runtime/GLES_COMPUTE/functions/GCGEMMTranspose1xW.h" - -#include "arm_compute/core/GLES_COMPUTE/IGCTensor.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCGEMMTranspose1xWKernel.h" -#include "arm_compute/core/Types.h" - -using namespace arm_compute; - -void GCGEMMTranspose1xW::configure(const IGCTensor *input, IGCTensor *output) -{ - auto k = std::make_unique(); - k->configure(input, output); - _kernel = std::move(k); -} diff --git a/src/runtime/GLES_COMPUTE/functions/GCNormalizationLayer.cpp b/src/runtime/GLES_COMPUTE/functions/GCNormalizationLayer.cpp deleted file mode 100644 index c4bf141446..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCNormalizationLayer.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2017-2019 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/runtime/GLES_COMPUTE/functions/GCNormalizationLayer.h" - -#include "arm_compute/core/Error.h" -#include "arm_compute/core/PixelValue.h" -#include "arm_compute/core/TensorInfo.h" -#include "arm_compute/core/Types.h" -#include "arm_compute/core/Validate.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" - -using namespace arm_compute; - -GCNormalizationLayer::GCNormalizationLayer(std::shared_ptr memory_manager) - : _memory_group(std::move(memory_manager)), _squared_input(), _norm_kernel(), _multiply_kernel(), _border_handler() -{ -} - -void GCNormalizationLayer::configure(const IGCTensor *input, IGCTensor *output, const NormalizationLayerInfo &norm_info) -{ - ARM_COMPUTE_ERROR_ON(input == nullptr); - - _squared_input.allocator()->init(TensorInfo(input->info()->tensor_shape(), 1, input->info()->data_type())); - _memory_group.manage(&_squared_input); - - _norm_kernel.configure(input, &_squared_input, output, norm_info); - _multiply_kernel.configure(input, input, &_squared_input, 1.0f); - // Fill the border by 3 elements since we need vload4 in the IN_MAP normalization kernel - _border_handler.configure(&_squared_input, _norm_kernel.border_size(), BorderMode::CONSTANT, PixelValue()); - - // Allocate intermediate buffers - _squared_input.allocator()->allocate(); -} - -void GCNormalizationLayer::run() -{ - MemoryGroupResourceScope scope_mg(_memory_group); - - GCScheduler::get().dispatch(_multiply_kernel, false); - GCScheduler::get().memory_barrier(); - GCScheduler::get().dispatch(_border_handler, false); - GCScheduler::get().memory_barrier(); - GCScheduler::get().dispatch(_norm_kernel, true); -} diff --git a/src/runtime/GLES_COMPUTE/functions/GCNormalizePlanarYUVLayer.cpp b/src/runtime/GLES_COMPUTE/functions/GCNormalizePlanarYUVLayer.cpp deleted file mode 100755 index 3e677b5d97..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCNormalizePlanarYUVLayer.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2017-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/runtime/GLES_COMPUTE/functions/GCNormalizePlanarYUVLayer.h" - -#include "arm_compute/core/Error.h" -#include "arm_compute/core/TensorInfo.h" -#include "arm_compute/core/Types.h" -#include "arm_compute/core/Validate.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" - -using namespace arm_compute; - -GCNormalizePlanarYUVLayer::GCNormalizePlanarYUVLayer() - : _norm_kernel() -{ -} - -void GCNormalizePlanarYUVLayer::configure(const IGCTensor *input, IGCTensor *output, const IGCTensor *mean, const IGCTensor *std) -{ - _norm_kernel.configure(input, output, mean, std); -} - -Status GCNormalizePlanarYUVLayer::validate(const ITensorInfo *input, const ITensorInfo *output, - const ITensorInfo *mean, const ITensorInfo *std) -{ - return GCNormalizePlanarYUVLayerKernel::validate(input, output, mean, std); -} - -void GCNormalizePlanarYUVLayer::run() -{ - GCScheduler::get().dispatch(_norm_kernel, true); -} diff --git a/src/runtime/GLES_COMPUTE/functions/GCPixelWiseMultiplication.cpp b/src/runtime/GLES_COMPUTE/functions/GCPixelWiseMultiplication.cpp deleted file mode 100755 index ce50a63e53..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCPixelWiseMultiplication.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2017-2020 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/runtime/GLES_COMPUTE/functions/GCPixelWiseMultiplication.h" - -#include "arm_compute/core/GLES_COMPUTE/kernels/GCPixelWiseMultiplicationKernel.h" - -#include - -using namespace arm_compute; - -void GCPixelWiseMultiplication::configure(const IGCTensor *input1, const IGCTensor *input2, IGCTensor *output, float scale, const ActivationLayerInfo &act_info) -{ - ARM_COMPUTE_UNUSED(act_info); - auto k = std::make_unique(); - k->configure(input1, input2, output, scale); - _kernel = std::move(k); -} diff --git a/src/runtime/GLES_COMPUTE/functions/GCPoolingLayer.cpp b/src/runtime/GLES_COMPUTE/functions/GCPoolingLayer.cpp deleted file mode 100644 index 6a71fbebe7..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCPoolingLayer.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2017-2020 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/runtime/GLES_COMPUTE/functions/GCPoolingLayer.h" - -#include "arm_compute/core/GLES_COMPUTE/IGCTensor.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" - -namespace arm_compute -{ -GCPoolingLayer::GCPoolingLayer() - : _kernel(nullptr), _border_handler(), _shift_handler() -{ -} - -void GCPoolingLayer::configure(IGCTensor *input, IGCTensor *output, const PoolingLayerInfo &pool_info, IGCTensor *indices) -{ - // Configure pooling kernel - auto k = std::make_unique(); - k->configure(input, output, pool_info, indices); - _kernel = std::move(k); - - // Configure border depending on operation required - BorderMode border_mode = (PoolingType::MAX == pool_info.pool_type) ? BorderMode::REPLICATE : BorderMode::CONSTANT; - _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(0.0f)); - - _shift_handler.configure(input); -} - -Status GCPoolingLayer::validate(const ITensorInfo *input, const ITensorInfo *output, const PoolingLayerInfo &pool_info, const ITensorInfo *indices) -{ - return GCPoolingLayerKernel::validate(input, output, pool_info, indices); -} - -void GCPoolingLayer::run() -{ - GCScheduler::get().dispatch(_shift_handler, false); - GCScheduler::get().memory_barrier(); - GCScheduler::get().dispatch(_border_handler, false); - GCScheduler::get().memory_barrier(); - GCScheduler::get().dispatch(*_kernel); -} -} // namespace arm_compute diff --git a/src/runtime/GLES_COMPUTE/functions/GCScale.cpp b/src/runtime/GLES_COMPUTE/functions/GCScale.cpp deleted file mode 100644 index 225bb4131f..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCScale.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2016-2021 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/runtime/GLES_COMPUTE/functions/GCScale.h" - -#include "arm_compute/core/Error.h" -#include "arm_compute/core/GLES_COMPUTE/IGCTensor.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCScaleKernel.h" -#include "arm_compute/core/Validate.h" - -namespace arm_compute -{ -void GCScale::configure(IGCTensor *input, IGCTensor *output, const ScaleKernelInfo &info) -{ - auto k = std::make_unique(); - k->configure(input, output, info); - _kernel = std::move(k); - _border_handler.configure(input, _kernel->border_size(), info.border_mode, info.constant_border_value); -} -} // namespace arm_compute diff --git a/src/runtime/GLES_COMPUTE/functions/GCSoftmaxLayer.cpp b/src/runtime/GLES_COMPUTE/functions/GCSoftmaxLayer.cpp deleted file mode 100644 index fdb9a42f13..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCSoftmaxLayer.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2017-2020 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/runtime/GLES_COMPUTE/functions/GCSoftmaxLayer.h" - -#include "arm_compute/core/GLES_COMPUTE/kernels/GCSoftmaxLayerKernel.h" -#include "arm_compute/core/Helpers.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" - -namespace arm_compute -{ -GCSoftmaxLayer::GCSoftmaxLayer(std::shared_ptr memory_manager) - : _memory_group(std::move(memory_manager)), _max_kernel(), _shift_exp_sum_kernel(), _norm_kernel(), _max(), _sum(), _tmp() -{ -} - -void GCSoftmaxLayer::configure(const IGCTensor *input, IGCTensor *output, float beta, int32_t axis) -{ - ARM_COMPUTE_UNUSED(beta, axis); - - ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::F16, DataType::F32); - ARM_COMPUTE_ERROR_ON(beta != 1.0f); - ARM_COMPUTE_ERROR_ON_MSG(axis != 0, "axis must be 0 for GLES"); - - // Create intermediate tensors shapes - _tmp.allocator()->init(TensorInfo(input->info()->tensor_shape(), input->info()->num_channels(), input->info()->data_type())); - - TensorShape shape = input->info()->tensor_shape(); - shape.set(0, 1); - TensorInfo tensor_info_max_sum(shape, input->info()->num_channels(), input->info()->data_type()); - _max.allocator()->init(tensor_info_max_sum); - _sum.allocator()->init(tensor_info_max_sum); - - // Manage intermediate buffers - _memory_group.manage(&_tmp); - _memory_group.manage(&_max); - _memory_group.manage(&_sum); - - // Configure Kernels - _max_kernel.configure(input, &_max); - _shift_exp_sum_kernel.configure(input, &_max, &_tmp, &_sum); - _norm_kernel.configure(&_tmp, &_sum, output); - - // Allocate intermediate buffers - _tmp.allocator()->allocate(); - _max.allocator()->allocate(); - _sum.allocator()->allocate(); -} - -void GCSoftmaxLayer::run() -{ - MemoryGroupResourceScope scope_mg(_memory_group); - - GCScheduler::get().dispatch(_max_kernel, false); - GCScheduler::get().memory_barrier(); - GCScheduler::get().dispatch(_shift_exp_sum_kernel, false); - GCScheduler::get().memory_barrier(); - GCScheduler::get().dispatch(_norm_kernel); -} - -} // namespace arm_compute \ No newline at end of file diff --git a/src/runtime/GLES_COMPUTE/functions/GCTensorShift.cpp b/src/runtime/GLES_COMPUTE/functions/GCTensorShift.cpp deleted file mode 100644 index 050dc7e9f5..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCTensorShift.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2017-2020 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/runtime/GLES_COMPUTE/functions/GCTensorShift.h" - -#include "arm_compute/core/GLES_COMPUTE/IGCTensor.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCTensorShiftKernel.h" -#include "arm_compute/core/Helpers.h" -#include "arm_compute/core/PixelValue.h" -#include "arm_compute/core/Utils.h" - -using namespace arm_compute; - -void GCTensorShift::configure(IGCTensor *input) -{ - auto k = std::make_unique(); - k->configure(input); - _kernel = std::move(k); -} diff --git a/src/runtime/GLES_COMPUTE/functions/GCTranspose.cpp b/src/runtime/GLES_COMPUTE/functions/GCTranspose.cpp deleted file mode 100644 index 14125e9db2..0000000000 --- a/src/runtime/GLES_COMPUTE/functions/GCTranspose.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2017-2020 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/runtime/GLES_COMPUTE/functions/GCTranspose.h" - -#include "arm_compute/core/GLES_COMPUTE/kernels/GCTransposeKernel.h" - -#include - -using namespace arm_compute; - -void GCTranspose::configure(const IGCTensor *input, IGCTensor *output) -{ - auto k = std::make_unique(); - k->configure(input, output); - _kernel = std::move(k); -} -- cgit v1.2.1