aboutsummaryrefslogtreecommitdiff
path: root/src/c/cl/AclOpenClExt.cpp
diff options
context:
space:
mode:
authorFelix Thomasmathibalan <felixjohnny.thomasmathibalan@arm.com>2023-09-27 17:46:17 +0100
committerfelixjohnny.thomasmathibalan <felixjohnny.thomasmathibalan@arm.com>2023-09-28 12:08:05 +0000
commitafd38f0c617d6f89b2b4532c6c44f116617e2b6f (patch)
tree03bc7d5a762099989b16a656fa8d397b490ed70e /src/c/cl/AclOpenClExt.cpp
parentbdcb4c148ee2fdeaaddf4cf1e57bbb0de02bb894 (diff)
downloadComputeLibrary-afd38f0c617d6f89b2b4532c6c44f116617e2b6f.tar.gz
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 <felixjohnny.thomasmathibalan@arm.com> Change-Id: Ib7eb1fcf4e7537b9feaefcfc15098a804a3fde0a Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10391 Benchmark: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Diffstat (limited to 'src/c/cl/AclOpenClExt.cpp')
-rw-r--r--src/c/cl/AclOpenClExt.cpp45
1 files changed, 22 insertions, 23 deletions
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<arm_compute::gpu::opencl::ClContext *>(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<arm_compute::gpu::opencl::ClQueue *>(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
+}