Update softmax_grad_impl.cu: add constexpr (#15794)

### Description
Add a "constexpr" keyword to fix a static analysis warning
This commit is contained in:
Changming Sun 2023-05-04 08:10:17 -07:00 committed by GitHub
parent df7424e11f
commit 34fcdd83c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -268,7 +268,7 @@ Status SoftmaxGradImpl(cudaStream_t stream, cudnnHandle_t cudnn_handle, T* input
#define CASE_LOG2_ELEMENTS(log2_elements_value) \
case log2_elements_value: { \
if (log2_elements_value < start_to_use_register_efficient_func) { \
if constexpr (log2_elements_value < start_to_use_register_efficient_func) { \
LAUNCH_KERNEL(log2_elements_value, softmax_warp_backward); \
} else { \
LAUNCH_KERNEL(log2_elements_value, softmax_warp_backward_register_efficicent); \