From afd38f0c617d6f89b2b4532c6c44f116617e2b6f Mon Sep 17 00:00:00 2001 From: Felix Thomasmathibalan Date: Wed, 27 Sep 2023 17:46:17 +0100 Subject: Apply clang-format on repository Code is formatted as per a revised clang format configuration file(not part of this delivery). Version 14.0.6 is used. Exclusion List: - files with .cl extension - files that are not strictly C/C++ (e.g. Android.bp, Sconscript ...) And the following directories - compute_kernel_writer/validation/ - tests/ - include/ - src/core/NEON/kernels/convolution/ - src/core/NEON/kernels/arm_gemm/ - src/core/NEON/kernels/arm_conv/ - data/ There will be a follow up for formatting of .cl files and the files under tests/ and compute_kernel_writer/validation/. Signed-off-by: Felix Thomasmathibalan Change-Id: Ib7eb1fcf4e7537b9feaefcfc15098a804a3fde0a Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10391 Benchmark: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Gunes Bayir --- src/c/cl/AclOpenClExt.cpp | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) (limited to 'src/c/cl/AclOpenClExt.cpp') diff --git a/src/c/cl/AclOpenClExt.cpp b/src/c/cl/AclOpenClExt.cpp index e72babcae8..8e42cf5510 100644 --- a/src/c/cl/AclOpenClExt.cpp +++ b/src/c/cl/AclOpenClExt.cpp @@ -23,13 +23,12 @@ */ #include "arm_compute/AclOpenClExt.h" +#include "arm_compute/core/CL/ICLTensor.h" + #include "src/common/ITensorV2.h" #include "src/common/Types.h" #include "src/gpu/cl/ClContext.h" #include "src/gpu/cl/ClQueue.h" - -#include "arm_compute/core/CL/ICLTensor.h" - #include "support/Cast.h" extern "C" AclStatus AclGetClContext(AclContext external_ctx, cl_context *opencl_context) @@ -37,17 +36,17 @@ extern "C" AclStatus AclGetClContext(AclContext external_ctx, cl_context *opencl using namespace arm_compute; IContext *ctx = get_internal(external_ctx); - if(detail::validate_internal_context(ctx) != StatusCode::Success) + if (detail::validate_internal_context(ctx) != StatusCode::Success) { return AclStatus::AclInvalidArgument; } - if(ctx->type() != Target::GpuOcl) + if (ctx->type() != Target::GpuOcl) { return AclStatus::AclInvalidTarget; } - if(opencl_context == nullptr) + if (opencl_context == nullptr) { return AclStatus::AclInvalidArgument; } @@ -62,23 +61,23 @@ extern "C" AclStatus AclSetClContext(AclContext external_ctx, cl_context opencl_ using namespace arm_compute; IContext *ctx = get_internal(external_ctx); - if(detail::validate_internal_context(ctx) != StatusCode::Success) + if (detail::validate_internal_context(ctx) != StatusCode::Success) { return AclStatus::AclInvalidArgument; } - if(ctx->type() != Target::GpuOcl) + if (ctx->type() != Target::GpuOcl) { return AclStatus::AclInvalidTarget; } - if(ctx->refcount() != 0) + if (ctx->refcount() != 0) { return AclStatus::AclUnsupportedConfig; } auto cl_ctx = utils::cast::polymorphic_downcast(ctx); - if(!cl_ctx->set_cl_ctx(::cl::Context(opencl_context))) + if (!cl_ctx->set_cl_ctx(::cl::Context(opencl_context))) { return AclStatus::AclRuntimeError; } @@ -91,17 +90,17 @@ extern "C" AclStatus AclGetClDevice(AclContext external_ctx, cl_device_id *openc using namespace arm_compute; IContext *ctx = get_internal(external_ctx); - if(detail::validate_internal_context(ctx) != StatusCode::Success) + if (detail::validate_internal_context(ctx) != StatusCode::Success) { return AclStatus::AclInvalidArgument; } - if(ctx->type() != Target::GpuOcl) + if (ctx->type() != Target::GpuOcl) { return AclStatus::AclInvalidTarget; } - if(opencl_device == nullptr) + if (opencl_device == nullptr) { return AclStatus::AclInvalidArgument; } @@ -116,17 +115,17 @@ extern "C" AclStatus AclGetClQueue(AclQueue external_queue, cl_command_queue *op using namespace arm_compute; IQueue *queue = get_internal(external_queue); - if(detail::validate_internal_queue(queue) != StatusCode::Success) + if (detail::validate_internal_queue(queue) != StatusCode::Success) { return AclStatus::AclInvalidArgument; } - if(queue->header.ctx->type() != Target::GpuOcl) + if (queue->header.ctx->type() != Target::GpuOcl) { return AclStatus::AclInvalidTarget; } - if(opencl_queue == nullptr) + if (opencl_queue == nullptr) { return AclStatus::AclInvalidArgument; } @@ -141,18 +140,18 @@ extern "C" AclStatus AclSetClQueue(AclQueue external_queue, cl_command_queue ope using namespace arm_compute; IQueue *queue = get_internal(external_queue); - if(detail::validate_internal_queue(queue) != StatusCode::Success) + if (detail::validate_internal_queue(queue) != StatusCode::Success) { return AclStatus::AclInvalidArgument; } - if(queue->header.ctx->type() != Target::GpuOcl) + if (queue->header.ctx->type() != Target::GpuOcl) { return AclStatus::AclInvalidTarget; } auto cl_queue = utils::cast::polymorphic_downcast(queue); - if(!cl_queue->set_cl_queue(::cl::CommandQueue(opencl_queue))) + if (!cl_queue->set_cl_queue(::cl::CommandQueue(opencl_queue))) { return AclStatus::AclRuntimeError; } @@ -165,17 +164,17 @@ extern "C" AclStatus AclGetClMem(AclTensor external_tensor, cl_mem *opencl_mem) using namespace arm_compute; ITensorV2 *tensor = get_internal(external_tensor); - if(detail::validate_internal_tensor(tensor) != StatusCode::Success) + if (detail::validate_internal_tensor(tensor) != StatusCode::Success) { return AclStatus::AclInvalidArgument; } - if(tensor->header.ctx->type() != Target::GpuOcl) + if (tensor->header.ctx->type() != Target::GpuOcl) { return AclStatus::AclInvalidTarget; } - if(opencl_mem == nullptr) + if (opencl_mem == nullptr) { return AclStatus::AclInvalidArgument; } @@ -184,4 +183,4 @@ extern "C" AclStatus AclGetClMem(AclTensor external_tensor, cl_mem *opencl_mem) *opencl_mem = cl_tensor->cl_buffer().get(); return AclStatus::AclSuccess; -} \ No newline at end of file +} -- cgit v1.2.1