From ba0d5c80f8919416ee5e15eb39b1324c7066714c Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 12 Dec 2023 13:34:00 -0500 Subject: [PATCH] Correct #20054-D errors found when compiling on ARM The nvcc compiler on ARM is more stringent and detects incorrect shared memory usage in kernels. The static shared memory approach only works with default constructor types. So we update `PathElement` to properly follow default construction rules. --- GPUTreeShap/gpu_treeshap.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/GPUTreeShap/gpu_treeshap.h b/GPUTreeShap/gpu_treeshap.h index 4318fad..b40f2c9 100644 --- a/GPUTreeShap/gpu_treeshap.h +++ b/GPUTreeShap/gpu_treeshap.h @@ -114,16 +114,16 @@ struct PathElement { } /*! Unique path index. */ - size_t path_idx; + size_t path_idx{}; /*! Feature of this split, -1 indicates bias term. */ - int64_t feature_idx; + int64_t feature_idx{}; /*! Indicates class for multiclass problems. */ - int group; - SplitConditionT split_condition; + int group{}; + SplitConditionT split_condition{}; /*! Probability of following this path when feature_idx is not in the active * set. */ - double zero_fraction; - float v; // Leaf weight at the end of the path + double zero_fraction{}; + float v{}; // Leaf weight at the end of the path }; // Helper function that accepts an index into a flat contiguous array and the