Skip to content

Commit

Permalink
Correct #20054-D errors found when compiling on ARM
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
robertmaynard committed Dec 12, 2023
1 parent 0b4429f commit ba0d5c8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions GPUTreeShap/gpu_treeshap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ba0d5c8

Please sign in to comment.