From 793039017ef89bf60cecdafb8eff5c681b38ff3b Mon Sep 17 00:00:00 2001 From: fis Date: Fri, 25 Sep 2020 16:49:44 +0800 Subject: [PATCH] Initialization. --- src/tree/updater_gpu_hist.cu | 2 +- tests/cpp/tree/test_gpu_hist.cu | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tree/updater_gpu_hist.cu b/src/tree/updater_gpu_hist.cu index 8d0efd41872e..394dfd5d5c1a 100644 --- a/src/tree/updater_gpu_hist.cu +++ b/src/tree/updater_gpu_hist.cu @@ -602,7 +602,7 @@ struct GPUHistMakerDevice { auto is_cat = candidate.split.is_cat; if (is_cat) { auto cat = common::AsCat(candidate.split.fvalue); - std::vector split_cats(LBitField32::ComputeStorageSize(std::max(cat+1, 1))); + std::vector split_cats(LBitField32::ComputeStorageSize(std::max(cat+1, 1)), 0); LBitField32 cats_bits(split_cats); cats_bits.Set(cat); dh::CopyToD(split_cats, &node_categories); diff --git a/tests/cpp/tree/test_gpu_hist.cu b/tests/cpp/tree/test_gpu_hist.cu index 4a96cb2877a3..37f738c24ae7 100644 --- a/tests/cpp/tree/test_gpu_hist.cu +++ b/tests/cpp/tree/test_gpu_hist.cu @@ -133,6 +133,7 @@ TEST(GpuHist, BuildHistSharedMem) { TEST(GpuHist, ApplySplit) { RegTree tree; ExpandEntry candidate; + candidate.nid = 0; candidate.left_weight = 1.0f; candidate.right_weight = 2.0f; candidate.base_weight = 3.0f;