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
2e98916f
Commit
2e98916f
authored
Sep 25, 2025
by
Jeff Daily
Browse files
apply reviewer suggestions
parent
1b550a7a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
include/LightGBM/cuda/cuda_rocm_interop.h
include/LightGBM/cuda/cuda_rocm_interop.h
+4
-1
src/treelearner/cuda/cuda_single_gpu_tree_learner.hpp
src/treelearner/cuda/cuda_single_gpu_tree_learner.hpp
+2
-2
src/treelearner/serial_tree_learner.h
src/treelearner/serial_tree_learner.h
+1
-1
No files found.
include/LightGBM/cuda/cuda_rocm_interop.h
View file @
2e98916f
/*!
/*!
* Copyright(C) 2023 Advanced Micro Devices, Inc. All rights reserved.
* Copyright(C) 2023 Advanced Micro Devices, Inc. All rights reserved.
*/
*/
#pragma once
#ifndef LIGHTGBM_CUDA_CUDA_ROCM_INTEROP_H_
#define LIGHTGBM_CUDA_CUDA_ROCM_INTEROP_H_
#ifdef USE_CUDA
#ifdef USE_CUDA
...
@@ -63,3 +64,5 @@ static inline constexpr int WARP_SIZE_INTERNAL() {
...
@@ -63,3 +64,5 @@ static inline constexpr int WARP_SIZE_INTERNAL() {
#endif
#endif
#endif // USE_CUDA
#endif // USE_CUDA
#endif // LIGHTGBM_CUDA_CUDA_ROCM_INTEROP_H_
src/treelearner/cuda/cuda_single_gpu_tree_learner.hpp
View file @
2e98916f
...
@@ -144,7 +144,7 @@ class CUDASingleGPUTreeLearner: public SerialTreeLearner {
...
@@ -144,7 +144,7 @@ class CUDASingleGPUTreeLearner: public SerialTreeLearner {
}
// namespace LightGBM
}
// namespace LightGBM
#else // USE_CUDA
|| USE_ROCM
#else // USE_CUDA
// When GPU support is not compiled in, quit with an error message
// When GPU support is not compiled in, quit with an error message
...
@@ -155,7 +155,7 @@ class CUDASingleGPUTreeLearner: public SerialTreeLearner {
...
@@ -155,7 +155,7 @@ class CUDASingleGPUTreeLearner: public SerialTreeLearner {
#pragma warning(disable : 4702)
#pragma warning(disable : 4702)
explicit
CUDASingleGPUTreeLearner
(
const
Config
*
tree_config
,
const
bool
/*boosting_on_cuda*/
)
:
SerialTreeLearner
(
tree_config
)
{
explicit
CUDASingleGPUTreeLearner
(
const
Config
*
tree_config
,
const
bool
/*boosting_on_cuda*/
)
:
SerialTreeLearner
(
tree_config
)
{
Log
::
Fatal
(
"CUDA Tree Learner was not enabled in this build.
\n
"
Log
::
Fatal
(
"CUDA Tree Learner was not enabled in this build.
\n
"
"Please recompile with CMake option -DUSE_CUDA=1 or -DUSE_ROCM=1"
);
"Please recompile with CMake option -DUSE_CUDA=1
(NVIDIA GPUs)
or -DUSE_ROCM=1
(AMD GPUs)
"
);
}
}
};
};
...
...
src/treelearner/serial_tree_learner.h
View file @
2e98916f
...
@@ -216,7 +216,7 @@ class SerialTreeLearner: public TreeLearner {
...
@@ -216,7 +216,7 @@ class SerialTreeLearner: public TreeLearner {
std
::
vector
<
score_t
,
boost
::
alignment
::
aligned_allocator
<
score_t
,
4096
>>
ordered_gradients_
;
std
::
vector
<
score_t
,
boost
::
alignment
::
aligned_allocator
<
score_t
,
4096
>>
ordered_gradients_
;
/*! \brief hessians of current iteration, ordered for cache optimized, aligned to 4K page */
/*! \brief hessians of current iteration, ordered for cache optimized, aligned to 4K page */
std
::
vector
<
score_t
,
boost
::
alignment
::
aligned_allocator
<
score_t
,
4096
>>
ordered_hessians_
;
std
::
vector
<
score_t
,
boost
::
alignment
::
aligned_allocator
<
score_t
,
4096
>>
ordered_hessians_
;
#elif defined(USE_CUDA)
|| defined(USE_ROCM)
#elif defined(USE_CUDA)
/*! \brief gradients of current iteration, ordered for cache optimized */
/*! \brief gradients of current iteration, ordered for cache optimized */
std
::
vector
<
score_t
,
CHAllocator
<
score_t
>>
ordered_gradients_
;
std
::
vector
<
score_t
,
CHAllocator
<
score_t
>>
ordered_gradients_
;
/*! \brief hessians of current iteration, ordered for cache optimized */
/*! \brief hessians of current iteration, ordered for cache optimized */
...
...
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