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
5784ffe7
Unverified
Commit
5784ffe7
authored
Jan 11, 2021
by
Chip Kerchner
Committed by
GitHub
Jan 11, 2021
Browse files
Ensure CUDA vector length is consistent with AlignedSize (#3748)
parent
1abc2e06
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
include/LightGBM/cuda/vector_cudahost.h
include/LightGBM/cuda/vector_cudahost.h
+1
-0
No files found.
include/LightGBM/cuda/vector_cudahost.h
View file @
5784ffe7
...
@@ -42,6 +42,7 @@ struct CHAllocator {
...
@@ -42,6 +42,7 @@ struct CHAllocator {
T
*
allocate
(
std
::
size_t
n
)
{
T
*
allocate
(
std
::
size_t
n
)
{
T
*
ptr
;
T
*
ptr
;
if
(
n
==
0
)
return
NULL
;
if
(
n
==
0
)
return
NULL
;
n
=
(
n
+
kAlignedSize
-
1
)
&
-
kAlignedSize
;
#ifdef USE_CUDA
#ifdef USE_CUDA
if
(
LGBM_config_
::
current_device
==
lgbm_device_cuda
)
{
if
(
LGBM_config_
::
current_device
==
lgbm_device_cuda
)
{
cudaError_t
ret
=
cudaHostAlloc
(
&
ptr
,
n
*
sizeof
(
T
),
cudaHostAllocPortable
);
cudaError_t
ret
=
cudaHostAlloc
(
&
ptr
,
n
*
sizeof
(
T
),
cudaHostAllocPortable
);
...
...
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