Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
cc62b1c3
Commit
cc62b1c3
authored
Mar 15, 2017
by
Guolin Ke
Browse files
use std::memcpy to copy array.
parent
516e66a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
src/c_api.cpp
src/c_api.cpp
+1
-3
No files found.
src/c_api.cpp
View file @
cc62b1c3
...
@@ -1140,9 +1140,7 @@ LIGHTGBM_C_EXPORT int LGBM_AllocateArray(int64_t len, int type, ArrayHandle* out
...
@@ -1140,9 +1140,7 @@ LIGHTGBM_C_EXPORT int LGBM_AllocateArray(int64_t len, int type, ArrayHandle* out
template
<
typename
T
>
template
<
typename
T
>
void
Copy
(
T
*
dst
,
const
T
*
src
,
int64_t
len
)
{
void
Copy
(
T
*
dst
,
const
T
*
src
,
int64_t
len
)
{
for
(
int64_t
i
=
0
;
i
<
len
;
++
i
)
{
std
::
memcpy
(
dst
,
src
,
sizeof
(
T
)
*
len
);
dst
[
i
]
=
src
[
i
];
}
}
}
LIGHTGBM_C_EXPORT
int
LGBM_CopyToArray
(
ArrayHandle
arr
,
int
type
,
int64_t
start_idx
,
const
void
*
src
,
int64_t
len
)
{
LIGHTGBM_C_EXPORT
int
LGBM_CopyToArray
(
ArrayHandle
arr
,
int
type
,
int64_t
start_idx
,
const
void
*
src
,
int64_t
len
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment