Unverified Commit 222dff54 authored by Guolin Ke's avatar Guolin Ke Committed by GitHub
Browse files

fix clang warning for GPU (#2807)



* try the fix

* fix 2

* try clang

* Apply suggestions from code review

* get back to gcc
Co-authored-by: default avatarNikita Titov <nekit94-08@mail.ru>
parent 790c1e33
...@@ -700,17 +700,20 @@ void GPUTreeLearner::InitGPU(int platform_id, int device_id) { ...@@ -700,17 +700,20 @@ void GPUTreeLearner::InitGPU(int platform_id, int device_id) {
} }
// determine which kernel to use based on the max number of bins // determine which kernel to use based on the max number of bins
if (max_num_bin_ <= 16) { if (max_num_bin_ <= 16) {
kernel_source_ = kernel16_src_; // the +9 skips extra characters ")", newline, "#endif" and newline at the beginning
kernel_source_ = kernel16_src_ + 9;
kernel_name_ = "histogram16"; kernel_name_ = "histogram16";
device_bin_size_ = 16; device_bin_size_ = 16;
dword_features_ = 8; dword_features_ = 8;
} else if (max_num_bin_ <= 64) { } else if (max_num_bin_ <= 64) {
kernel_source_ = kernel64_src_; // the +9 skips extra characters ")", newline, "#endif" and newline at the beginning
kernel_source_ = kernel64_src_ + 9;
kernel_name_ = "histogram64"; kernel_name_ = "histogram64";
device_bin_size_ = 64; device_bin_size_ = 64;
dword_features_ = 4; dword_features_ = 4;
} else if (max_num_bin_ <= 256) { } else if (max_num_bin_ <= 256) {
kernel_source_ = kernel256_src_; // the +9 skips extra characters ")", newline, "#endif" and newline at the beginning
kernel_source_ = kernel256_src_ + 9;
kernel_name_ = "histogram256"; kernel_name_ = "histogram256";
device_bin_size_ = 256; device_bin_size_ = 256;
dword_features_ = 4; dword_features_ = 4;
......
...@@ -762,6 +762,5 @@ R""() ...@@ -762,6 +762,5 @@ R""()
} }
// The following line ends the string literal, adds an extra #endif at the end // The following line ends the string literal, adds an extra #endif at the end
// the +9 skips extra characters ")", newline, "#endif" and newline at the beginning // )"" "\n#endif"
// )"" "\n#endif" + 9
#endif #endif
...@@ -787,7 +787,5 @@ R""() ...@@ -787,7 +787,5 @@ R""()
} }
// The following line ends the string literal, adds an extra #endif at the end // The following line ends the string literal, adds an extra #endif at the end
// the +9 skips extra characters ")", newline, "#endif" and newline at the beginning // )"" "\n#endif"
// )"" "\n#endif" + 9
#endif #endif
...@@ -738,7 +738,5 @@ R""() ...@@ -738,7 +738,5 @@ R""()
} }
// The following line ends the string literal, adds an extra #endif at the end // The following line ends the string literal, adds an extra #endif at the end
// the +9 skips extra characters ")", newline, "#endif" and newline at the beginning // )"" "\n#endif"
// )"" "\n#endif" + 9
#endif #endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment