Skip to content

Commit ebd27e2

Browse files
committed
format
Signed-off-by: chentong319 <[email protected]>
1 parent 432e4be commit ebd27e2

File tree

1 file changed

+14
-11
lines changed
  • src/Accelerators/NNPA/Runtime/zDNNExtension

1 file changed

+14
-11
lines changed

src/Accelerators/NNPA/Runtime/zDNNExtension/MatMul.c

+14-11
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ static inline zdnn_status call_zdnn_matmul_op(const zdnn_ztensor *inputA,
4242
inputA, inputB, inputC, (zdnn_matmul_ops)opType, output);
4343
}
4444

45-
static float get_elapse(const struct timeval start_t, const struct timeval end_t) {
46-
return
47-
(((end_t.tv_sec * 1000000.) + end_t.tv_usec) - ((start_t.tv_sec * 1000000) + start_t.tv_usec))/1000;
45+
static float get_elapse(
46+
const struct timeval start_t, const struct timeval end_t) {
47+
return (((end_t.tv_sec * 1000000.) + end_t.tv_usec) -
48+
((start_t.tv_sec * 1000000) + start_t.tv_usec)) /
49+
1000;
4850
}
4951

5052
// It is supposed that sched.h should have the declaration of sched_getcpu.
@@ -89,13 +91,14 @@ static zdnn_status zdnn_matmul_op_common(const zdnn_ztensor *inputA,
8991
printf("[MatMul] Not split zTensor ...\n");
9092
if (OMZTensorSplitDebug)
9193
gettimeofday(&start_t, NULL);
92-
zdnn_status status = call_zdnn_matmul_op(inputA, inputB, inputC, opType, output, isBcast);
94+
zdnn_status status =
95+
call_zdnn_matmul_op(inputA, inputB, inputC, opType, output, isBcast);
9396
assert(status == ZDNN_OK && ("call_zdnn_matmul_op failed"));
94-
if (OMZTensorSplitDebug) {
95-
gettimeofday(&end_t, NULL);
96-
elapse = get_elapse(start_t, end_t);
97-
printf("[MatMul] mm, %f, (milliseconds)\n", elapse);
98-
}
97+
if (OMZTensorSplitDebug) {
98+
gettimeofday(&end_t, NULL);
99+
elapse = get_elapse(start_t, end_t);
100+
printf("[MatMul] mm, %f, (milliseconds)\n", elapse);
101+
}
99102
return status;
100103
}
101104

@@ -119,8 +122,8 @@ static zdnn_status zdnn_matmul_op_common(const zdnn_ztensor *inputA,
119122
if (OMZTensorSplitDebug)
120123
gettimeofday(&start_t, NULL);
121124

122-
// Parallelize the mm part over each chunk
123-
// Thread binding is done at runtime with OMP_PLACES and OMP_PROC_BIND
125+
// Parallelize the mm part over each chunk
126+
// Thread binding is done at runtime with OMP_PLACES and OMP_PROC_BIND
124127
#pragma omp parallel for proc_bind(spread)
125128
for (uint32_t i = 0; i < splitInfoA.numOfChunks; ++i) {
126129
zdnn_ztensor *zaTensor = (splitInfoA.chunks + i)->ztensor;

0 commit comments

Comments
 (0)