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
d951be99
Unverified
Commit
d951be99
authored
Jan 23, 2021
by
Chip Kerchner
Committed by
GitHub
Jan 23, 2021
Browse files
Don't copy more than has been allocated to device_features. (#3752)
parent
e754f23a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/treelearner/cuda_tree_learner.cpp
src/treelearner/cuda_tree_learner.cpp
+1
-1
No files found.
src/treelearner/cuda_tree_learner.cpp
View file @
d951be99
...
@@ -408,7 +408,7 @@ void CUDATreeLearner::copyDenseFeature() {
...
@@ -408,7 +408,7 @@ void CUDATreeLearner::copyDenseFeature() {
// looking for dword_features_ non-sparse feature-groups
// looking for dword_features_ non-sparse feature-groups
if
(
!
train_data_
->
IsMultiGroup
(
i
))
{
if
(
!
train_data_
->
IsMultiGroup
(
i
))
{
dense_feature_group_map_
.
push_back
(
i
);
dense_feature_group_map_
.
push_back
(
i
);
auto
sizes_in_byte
=
train_data_
->
FeatureGroupSizesInByte
(
i
);
auto
sizes_in_byte
=
std
::
min
(
train_data_
->
FeatureGroupSizesInByte
(
i
)
,
static_cast
<
size_t
>
(
num_data_
))
;
void
*
tmp_data
=
train_data_
->
FeatureGroupData
(
i
);
void
*
tmp_data
=
train_data_
->
FeatureGroupData
(
i
);
Log
::
Debug
(
"Started copying dense features from CPU to GPU - 2"
);
Log
::
Debug
(
"Started copying dense features from CPU to GPU - 2"
);
CUDASUCCESS_OR_FATAL
(
cudaMemcpyAsync
(
&
device_features
[
copied_feature
*
num_data_
],
tmp_data
,
sizes_in_byte
,
cudaMemcpyHostToDevice
,
stream_
[
device_id
]));
CUDASUCCESS_OR_FATAL
(
cudaMemcpyAsync
(
&
device_features
[
copied_feature
*
num_data_
],
tmp_data
,
sizes_in_byte
,
cudaMemcpyHostToDevice
,
stream_
[
device_id
]));
...
...
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