diff options
author | Felix Thomasmathibalan <felixjohnny.thomasmathibalan@arm.com> | 2023-09-27 17:46:17 +0100 |
---|---|---|
committer | felixjohnny.thomasmathibalan <felixjohnny.thomasmathibalan@arm.com> | 2023-09-28 12:08:05 +0000 |
commit | afd38f0c617d6f89b2b4532c6c44f116617e2b6f (patch) | |
tree | 03bc7d5a762099989b16a656fa8d397b490ed70e /src/core/CL/CLCompatCommandBuffer.cpp | |
parent | bdcb4c148ee2fdeaaddf4cf1e57bbb0de02bb894 (diff) | |
download | ComputeLibrary-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/core/CL/CLCompatCommandBuffer.cpp')
-rw-r--r-- | src/core/CL/CLCompatCommandBuffer.cpp | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/src/core/CL/CLCompatCommandBuffer.cpp b/src/core/CL/CLCompatCommandBuffer.cpp index f1a902c7b9..242fd7719c 100644 --- a/src/core/CL/CLCompatCommandBuffer.cpp +++ b/src/core/CL/CLCompatCommandBuffer.cpp @@ -31,8 +31,7 @@ namespace arm_compute { -CLCompatCommandBuffer::CLCompatCommandBuffer(cl_command_queue queue) - : _queue(queue) +CLCompatCommandBuffer::CLCompatCommandBuffer(cl_command_queue queue) : _queue(queue) { } @@ -40,11 +39,14 @@ CLCompatCommandBuffer::~CLCompatCommandBuffer() { } -void CLCompatCommandBuffer::add_kernel(cl_kernel kernel, const cl::NDRange &offset, const cl::NDRange &global, const cl::NDRange &local) +void CLCompatCommandBuffer::add_kernel(cl_kernel kernel, + const cl::NDRange &offset, + const cl::NDRange &global, + const cl::NDRange &local) { ARM_COMPUTE_ERROR_ON(state() != State::Created); - _kernel_cmds.push_back(KernelCommand{ kernel, offset, global, local, {} }); + _kernel_cmds.push_back(KernelCommand{kernel, offset, global, local, {}}); } void CLCompatCommandBuffer::add_mutable_argument_generic(cl_uint arg_idx, const void *value, size_t size) @@ -52,7 +54,7 @@ void CLCompatCommandBuffer::add_mutable_argument_generic(cl_uint arg_idx, const ARM_COMPUTE_ERROR_ON(state() != State::Created); ARM_COMPUTE_ERROR_ON(_kernel_cmds.empty()); - _kernel_cmds.back().mutable_args.push_back(cl_mutable_dispatch_arg_khr{ arg_idx, size, value }); + _kernel_cmds.back().mutable_args.push_back(cl_mutable_dispatch_arg_khr{arg_idx, size, value}); } void CLCompatCommandBuffer::finalize() @@ -61,7 +63,7 @@ void CLCompatCommandBuffer::finalize() _kernel_cmds.shrink_to_fit(); - for(auto &cmd : _kernel_cmds) + for (auto &cmd : _kernel_cmds) { cmd.mutable_args.shrink_to_fit(); } @@ -80,25 +82,19 @@ void CLCompatCommandBuffer::enqueue() { ARM_COMPUTE_ERROR_ON(state() != State::Finalized); - for(const auto &cmd : _kernel_cmds) + for (const auto &cmd : _kernel_cmds) { - for(const auto &arg : cmd.mutable_args) + for (const auto &arg : cmd.mutable_args) { const auto error = clSetKernelArg(cmd.kernel, arg.arg_index, arg.arg_size, arg.arg_value); handle_cl_error("clSetKernelArg", error); } - const auto error = clEnqueueNDRangeKernel( - _queue, - cmd.kernel, - static_cast<cl_uint>(cmd.global.dimensions()), - cmd.offset.dimensions() != 0 ? cmd.offset.get() : nullptr, - cmd.global.get(), - cmd.local.dimensions() != 0 ? cmd.local.get() : nullptr, - 0, - nullptr, - nullptr); + const auto error = + clEnqueueNDRangeKernel(_queue, cmd.kernel, static_cast<cl_uint>(cmd.global.dimensions()), + cmd.offset.dimensions() != 0 ? cmd.offset.get() : nullptr, cmd.global.get(), + cmd.local.dimensions() != 0 ? cmd.local.get() : nullptr, 0, nullptr, nullptr); handle_cl_error("clEnqueueNDRangeKernel", error); } |