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
ceb6265f
Unverified
Commit
ceb6265f
authored
Oct 26, 2020
by
Pengfei Shi
Committed by
GitHub
Oct 26, 2020
Browse files
Add support for cuda version less then 10.0 (#3431)
parent
12e220b7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
include/LightGBM/cuda/vector_cudahost.h
include/LightGBM/cuda/vector_cudahost.h
+9
-3
No files found.
include/LightGBM/cuda/vector_cudahost.h
View file @
ceb6265f
...
@@ -65,9 +65,15 @@ struct CHAllocator {
...
@@ -65,9 +65,15 @@ struct CHAllocator {
if
(
LGBM_config_
::
current_device
==
lgbm_device_cuda
)
{
if
(
LGBM_config_
::
current_device
==
lgbm_device_cuda
)
{
cudaPointerAttributes
attributes
;
cudaPointerAttributes
attributes
;
cudaPointerGetAttributes
(
&
attributes
,
p
);
cudaPointerGetAttributes
(
&
attributes
,
p
);
#if CUDA_VERSION >= 10000
if
((
attributes
.
type
==
cudaMemoryTypeHost
)
&&
(
attributes
.
devicePointer
!=
NULL
))
{
if
((
attributes
.
type
==
cudaMemoryTypeHost
)
&&
(
attributes
.
devicePointer
!=
NULL
))
{
cudaFreeHost
(
p
);
cudaFreeHost
(
p
);
}
}
#else
if
((
attributes
.
memoryType
==
cudaMemoryTypeHost
)
&&
(
attributes
.
devicePointer
!=
NULL
))
{
cudaFreeHost
(
p
);
}
#endif
}
else
{
}
else
{
_mm_free
(
p
);
_mm_free
(
p
);
}
}
...
...
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