projects
/
platform
/
upstream
/
nnstreamer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f6568b4
)
[C-API] same mem ptr
author
Jaeyun
<jy1210.jung@samsung.com>
Thu, 9 Apr 2020 10:05:34 +0000
(19:05 +0900)
committer
MyungJoo Ham
<myungjoo.ham@samsung.com>
Fri, 10 Apr 2020 05:15:40 +0000
(14:15 +0900)
If user gets tensor data and tries to update it, memcpy is unnecessary.
Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
api/capi/src/nnstreamer-capi-util.c
patch
|
blob
|
history
diff --git
a/api/capi/src/nnstreamer-capi-util.c
b/api/capi/src/nnstreamer-capi-util.c
index
4ed2867
..
beebba4
100644
(file)
--- a/
api/capi/src/nnstreamer-capi-util.c
+++ b/
api/capi/src/nnstreamer-capi-util.c
@@
-690,7
+690,8
@@
ml_tensors_data_set_tensor_data (ml_tensors_data_h data, unsigned int index,
if (data_size <= 0 || _data->tensors[index].size < data_size)
return ML_ERROR_INVALID_PARAMETER;
- memcpy (_data->tensors[index].tensor, raw_data, data_size);
+ if (_data->tensors[index].tensor != raw_data)
+ memcpy (_data->tensors[index].tensor, raw_data, data_size);
return ML_ERROR_NONE;
}