Skip to content

Commit ba5c5ab

Browse files
committed
remove trailing whitespace
1 parent 42ee0cb commit ba5c5ab

File tree

4 files changed

+34
-34
lines changed

4 files changed

+34
-34
lines changed

ggml/src/ggml-cann/aclnn_ops.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ void ggml_cann_acc(ggml_backend_cann_context& ctx, ggml_tensor* dst) {
450450

451451
if (!inplace) {
452452
size_t cpy_size = ggml_nbytes(dst);
453-
ggml_cann_async_memcpy(ctx, dst->data, src0->data, cpy_size,
453+
ggml_cann_async_memcpy(ctx, dst->data, src0->data, cpy_size,
454454
ACL_MEMCPY_DEVICE_TO_DEVICE);
455455
aclTensor* acl_src0 = ggml_cann_create_tensor(
456456
src0, src1->ne, src0->nb, GGML_MAX_DIMS, ACL_FORMAT_ND, offset);
@@ -991,7 +991,7 @@ static void ggml_cann_im2col_1d_post_process(
991991
c * KH * KW * n_step_w * ggml_type_size(dst->type);
992992

993993
for (int i = 0; i < n_step_w; i++) {
994-
ggml_cann_async_memcpy(ctx, cur_dst_buffer, cur_permute_buffer, size_cpy,
994+
ggml_cann_async_memcpy(ctx, cur_dst_buffer, cur_permute_buffer, size_cpy,
995995
ACL_MEMCPY_DEVICE_TO_DEVICE);
996996
cur_dst_buffer =
997997
(char*)cur_dst_buffer + KH * KW * ggml_type_size(dst->type);
@@ -1002,7 +1002,7 @@ static void ggml_cann_im2col_1d_post_process(
10021002
} else {
10031003
offset = KH * KW * n_step_w *
10041004
ggml_type_size(dst->type); // equal to ggml_nbytes(dst)
1005-
ggml_cann_async_memcpy(ctx, dst->data, (char*)tmp_permute_buffer + offset, offset,
1005+
ggml_cann_async_memcpy(ctx, dst->data, (char*)tmp_permute_buffer + offset, offset,
10061006
ACL_MEMCPY_DEVICE_TO_DEVICE);
10071007
}
10081008

@@ -1102,7 +1102,7 @@ void ggml_cann_im2col(ggml_backend_cann_context& ctx, ggml_tensor* dst) {
11021102
tmp_im2col_tensor, im2col_op_params);
11031103
}
11041104

1105-
ggml_cann_release_resources(ctx, acl_src1, tmp_im2col_tensor, tmp_cast_tensor,
1105+
ggml_cann_release_resources(ctx, acl_src1, tmp_im2col_tensor, tmp_cast_tensor,
11061106
kernel_size, dilations, paddings, strides);
11071107
}
11081108

@@ -1239,7 +1239,7 @@ void ggml_cann_timestep_embedding(ggml_backend_cann_context& ctx,
12391239

12401240
// release
12411241
// segmentation fault when delete both tensorList and his elements.
1242-
ggml_cann_release_resources(ctx, tensor_list, acl_src, tmp_arange_tensor,
1242+
ggml_cann_release_resources(ctx, tensor_list, acl_src, tmp_arange_tensor,
12431243
tmp_permute_tensor, tmp_mul_tensor, acl_dst);
12441244
}
12451245

@@ -1430,8 +1430,8 @@ static void aclnn_alibi(ggml_backend_cann_context& ctx, aclTensor* acl_src,
14301430

14311431
// add
14321432
aclnn_add(ctx, tmp_output_tensor, acl_src, acl_dst);
1433-
ggml_cann_release_resources(ctx, tmp_arange1_tensor, tmp_arange2_tensor,
1434-
tmp_mk_base1_tensor, tmp_mk_base2_tensor, tmp_mk_base_tensor,
1433+
ggml_cann_release_resources(ctx, tmp_arange1_tensor, tmp_arange2_tensor,
1434+
tmp_mk_base1_tensor, tmp_mk_base2_tensor, tmp_mk_base_tensor,
14351435
tmp_arange_tensor, tmp_mk_tensor, tmp_output_tensor);
14361436
}
14371437

@@ -1563,7 +1563,7 @@ void ggml_cann_softmax(ggml_backend_cann_context& ctx, ggml_tensor* dst) {
15631563
aclnn_softmax(ctx, acl_input_mul_scale_tensor, 3, acl_dst);
15641564
}
15651565

1566-
ggml_cann_release_resources(ctx, acl_src0, acl_src1_fp32_tensor, acl_dst,
1566+
ggml_cann_release_resources(ctx, acl_src0, acl_src1_fp32_tensor, acl_dst,
15671567
acl_scale, acl_input_mul_scale_tensor, tmp_mask_tensor);
15681568
}
15691569

@@ -2076,7 +2076,7 @@ static void aclnn_cache_init(ggml_backend_cann_context& ctx, ggml_tensor* dst,
20762076

20772077
// power
20782078
aclScalar* acl_theta_scale = aclCreateScalar(&theta_scale, aclDataType::ACL_FLOAT);
2079-
GGML_CANN_CALL_ACLNN_OP(ctx, PowScalarTensor, acl_theta_scale, acl_theta_scale_tensor,
2079+
GGML_CANN_CALL_ACLNN_OP(ctx, PowScalarTensor, acl_theta_scale, acl_theta_scale_tensor,
20802080
acl_theta_scale_tensor);
20812081

20822082
// freq_scale
@@ -2159,7 +2159,7 @@ static void aclnn_cache_init(ggml_backend_cann_context& ctx, ggml_tensor* dst,
21592159
}
21602160

21612161
// release
2162-
ggml_cann_release_resources(ctx, acl_theta_scale_tensor, acl_position_tensor,
2162+
ggml_cann_release_resources(ctx, acl_theta_scale_tensor, acl_position_tensor,
21632163
acl_theta_tensor, acl_sin_tensor, acl_cos_tensor, acl_theta_scale);
21642164
}
21652165

@@ -2307,7 +2307,7 @@ void ggml_cann_rope(ggml_backend_cann_context& ctx, ggml_tensor* dst) {
23072307
int64_t shifts[] = {src0->ne[0] / 2};
23082308
int64_t dims[] = {3};
23092309
aclnn_roll(ctx, acl_input_tensor, acl_input_roll_tensor, shifts, dims);
2310-
2310+
23112311
ggml_cann_release_resources(ctx, acl_input_roll_tensor, acl_input_tensor);
23122312
// init [-1, -1, -1, 1, 1,1,...]
23132313
minus_one_scale_buffer = minus_one_scale_allocator.get();
@@ -2411,7 +2411,7 @@ void ggml_cann_rope(ggml_backend_cann_context& ctx, ggml_tensor* dst) {
24112411

24122412
switch (src0->type) {
24132413
case GGML_TYPE_F32: {
2414-
GGML_CANN_CALL_ACLNN_OP(ctx, RotaryPositionEmbedding, acl_src,
2414+
GGML_CANN_CALL_ACLNN_OP(ctx, RotaryPositionEmbedding, acl_src,
24152415
acl_cos_reshape_tensor, acl_sin_reshape_tensor, acl_mode, acl_dst);
24162416
break;
24172417
}
@@ -2438,8 +2438,8 @@ void ggml_cann_rope(ggml_backend_cann_context& ctx, ggml_tensor* dst) {
24382438

24392439
aclnn_cast(ctx, acl_src, acl_src_trans_tensor, ACL_FLOAT);
24402440

2441-
GGML_CANN_CALL_ACLNN_OP(ctx, RotaryPositionEmbedding, acl_src_trans_tensor,
2442-
acl_cos_reshape_tensor, acl_sin_reshape_tensor, acl_mode,
2441+
GGML_CANN_CALL_ACLNN_OP(ctx, RotaryPositionEmbedding, acl_src_trans_tensor,
2442+
acl_cos_reshape_tensor, acl_sin_reshape_tensor, acl_mode,
24432443
acl_dst_trans_tensor);
24442444

24452445
aclnn_cast(ctx, acl_dst_trans_tensor, acl_dst, ACL_FLOAT16);
@@ -2452,7 +2452,7 @@ void ggml_cann_rope(ggml_backend_cann_context& ctx, ggml_tensor* dst) {
24522452
GGML_ABORT("Unsupported tensor type for GGML_OP_ROPE");
24532453
break;
24542454
}
2455-
ggml_cann_release_resources(ctx, acl_cos_reshape_tensor,
2455+
ggml_cann_release_resources(ctx, acl_cos_reshape_tensor,
24562456
acl_sin_reshape_tensor, acl_src, acl_dst);
24572457
}
24582458

ggml/src/ggml-cann/aclnn_ops.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ using any_acl_resource = std::unique_ptr<void, std::function<void(void*)>>;
721721

722722
/**
723723
* @brief Trait structure used to define how to destroy a given ACL resource type.
724-
*
724+
*
725725
* @tparam T ACL resource type.
726726
*/
727727
template<typename T>
@@ -769,7 +769,7 @@ struct acl_resource_traits<aclTensorList> {
769769

770770
/**
771771
* @brief Creates a generic ACL resource wrapper with proper destruction logic.
772-
*
772+
*
773773
* @tparam T ACL resource type.
774774
* @param ptr Raw pointer to ACL resource.
775775
* @return any_acl_resource Smart pointer that handles destruction.
@@ -786,7 +786,7 @@ any_acl_resource make_acl_resource(T* ptr) {
786786

787787
/**
788788
* @brief Registers multiple ACL resources into a vector for lifetime management.
789-
*
789+
*
790790
* @tparam Args Variadic list of ACL resource types.
791791
* @param vec Target vector to hold ACL resources.
792792
* @param args Raw pointers to ACL resources.
@@ -863,7 +863,7 @@ class async_memset_task : public cann_task {
863863
public:
864864
async_memset_task(void* buffer, size_t size, int32_t value, aclrtStream stream)
865865
: buffer_(buffer), size_(size), value_(value), stream_(stream) {}
866-
866+
867867
virtual void run_task() override {
868868
ACL_CHECK(aclrtMemsetAsync(buffer_, size_, value_, size_, stream_));
869869
}
@@ -914,14 +914,14 @@ class async_memset_task : public cann_task {
914914
} while (0)
915915

916916
/**
917-
* @brief Registers and releases multiple ACL resources, optionally deferring the release
917+
* @brief Registers and releases multiple ACL resources, optionally deferring the release
918918
* using a task.
919-
*
919+
*
920920
* @tparam Args Types of the ACL resources.
921921
* @param ctx Backend context which manages task submission and async mode.
922922
* @param args Pointers to ACL resources to be released.
923923
*/
924-
template <typename... Args>
924+
template <typename... Args>
925925
void ggml_cann_release_resources(ggml_backend_cann_context & ctx, Args &&... args) {
926926
std::vector<any_acl_resource> resources;
927927
register_acl_resources(resources, std::forward<Args>(args)...);
@@ -933,7 +933,7 @@ void ggml_cann_release_resources(ggml_backend_cann_context & ctx, Args &&... arg
933933

934934
/**
935935
* @brief Performs an asynchronous memory copy operation, optionally deferred via task submission.
936-
*
936+
*
937937
* @param ctx Backend context containing stream and async configuration.
938938
* @param dst Destination memory address.
939939
* @param src Source memory address.
@@ -962,7 +962,7 @@ inline void ggml_cann_async_memcpy(ggml_backend_cann_context * ctx, void * dst,
962962

963963
/**
964964
* @brief Performs an asynchronous memory set operation, optionally deferred via task submission.
965-
*
965+
*
966966
* @param ctx Backend context containing stream and async configuration.
967967
* @param buffer Memory buffer to be set.
968968
* @param size Size of the memory buffer (in bytes).

ggml/src/ggml-cann/common.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ using aclnn_func_t = aclnnStatus (*)(void*, uint64_t, aclOpExecutor*, aclrtStrea
220220

221221
/**
222222
* @brief Base class for all CANN tasks to be submitted to the task queue.
223-
*
223+
*
224224
* Users should override the run_task() method with actual task logic.
225225
*/
226226
class cann_task {
@@ -235,7 +235,7 @@ class cann_task_queue {
235235
public:
236236
/**
237237
* @brief Constructs a task queue with a fixed power-of-two capacity for a specific device.
238-
*
238+
*
239239
* @param capacity Queue capacity. Must be a power of 2.
240240
* @param device Target device ID (used for context setting).
241241
*/
@@ -248,7 +248,7 @@ class cann_task_queue {
248248

249249
/**
250250
* @brief Attempts to enqueue a task into the queue.
251-
*
251+
*
252252
* @param item Unique pointer to the task.
253253
* @return true if the task was successfully enqueued, false if the queue was full.
254254
*/
@@ -268,20 +268,20 @@ class cann_task_queue {
268268

269269
/**
270270
* @brief Submits a task to the queue, and starts the worker thread if not already running.
271-
*
271+
*
272272
* @param task Task to be submitted.
273273
*/
274274
void submit_task(std::unique_ptr<cann_task>&& task) {
275275
while(!enqueue(std::move(task))) {
276276
std::this_thread::yield();
277277
continue;
278278
}
279-
279+
280280
if (!running_) {
281281
running_ = true;
282282
thread_ = std::thread(&cann_task_queue::execute, this);
283283
}
284-
284+
285285
}
286286

287287
/**

ggml/src/ggml-cann/ggml-cann.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1791,7 +1791,7 @@ static void ggml_backend_cann_free(ggml_backend_t backend) {
17911791
/**
17921792
* @brief Sets tensor data asynchronously in the CANN backend.
17931793
*
1794-
* This function asynchronously sets tensor data in the CANN backend.
1794+
* This function asynchronously sets tensor data in the CANN backend.
17951795
*
17961796
* @param backend Pointer to the CANN backend structure.
17971797
* @param tensor Pointer to the tensor structure to set data for.
@@ -1813,14 +1813,14 @@ static void ggml_backend_cann_set_tensor_async(ggml_backend_t backend,
18131813
"unsupported buffer type");
18141814
GGML_ASSERT(!ggml_is_quantized(tensor->type));
18151815

1816-
ggml_cann_async_memcpy(cann_ctx, (char *)tensor->data + offset, data, size,
1816+
ggml_cann_async_memcpy(cann_ctx, (char *)tensor->data + offset, data, size,
18171817
ACL_MEMCPY_HOST_TO_DEVICE);
18181818
}
18191819

18201820
/**
18211821
* @brief Gets tensor data asynchronously in the CANN backend.
18221822
*
1823-
* This function asynchronously gets tensor data in the CANN backend.
1823+
* This function asynchronously gets tensor data in the CANN backend.
18241824
*
18251825
* @param backend Pointer to the CANN backend structure.
18261826
* @param tensor Pointer to the tensor structure to get data from.
@@ -1842,7 +1842,7 @@ static void ggml_backend_cann_get_tensor_async(
18421842

18431843
ggml_cann_async_memcpy(cann_ctx, data, (char *)tensor->data + offset, size,
18441844
ACL_MEMCPY_DEVICE_TO_HOST);
1845-
1845+
18461846
}
18471847

18481848
/**

0 commit comments

Comments
 (0)