mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-18 21:21:17 +00:00
use constexpr (#12953)
This commit is contained in:
parent
dd39f0293d
commit
4113df0e21
2 changed files with 6 additions and 6 deletions
|
|
@ -101,7 +101,7 @@ TEST(CudaKernelTest, LayerNormGrad_SmallSizeTensor) {
|
|||
|
||||
TEST(CudaKernelTest, LayerNormGrad_SmallSizeTensor_IntermediateAxis) {
|
||||
const std::vector<int64_t> X_dims{4, 20, 16, 8};
|
||||
const int64_t axis = -2;
|
||||
constexpr int64_t axis = -2;
|
||||
TestLayerNormGrad(X_dims, LAYER_NORM_GRAD_OP, axis);
|
||||
}
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ TEST(CudaKernelTest, SimplifiedLayerNormGrad_SmallSizeTensor) {
|
|||
|
||||
TEST(CudaKernelTest, SimplifiedLayerNormGrad_SmallSizeTensor_IntermediateAxis) {
|
||||
const std::vector<int64_t> X_dims{4, 20, 16, 8};
|
||||
const int64_t axis = -2;
|
||||
constexpr int64_t axis = -2;
|
||||
TestLayerNormGrad(X_dims, SIMPLIFIED_LAYER_NORM_GRAD_OP, axis);
|
||||
}
|
||||
|
||||
|
|
@ -239,7 +239,7 @@ TEST(CudaKernelTest, InvertibleLayerNormGrad_SmallSizeTensor) {
|
|||
|
||||
TEST(CudaKernelTest, InvertibleLayerNormGrad_SmallSizeTensor_IntermediateAxis) {
|
||||
const std::vector<int64_t> X_dims{4, 20, 16, 8};
|
||||
const int64_t axis = -2;
|
||||
constexpr int64_t axis = -2;
|
||||
TestInvertibleLayerNormGrad(X_dims, axis);
|
||||
}
|
||||
|
||||
|
|
@ -260,7 +260,7 @@ TEST(CudaKernelTest, InvertibleLayerNormGrad_SmallSizeTensor_FP16) {
|
|||
|
||||
TEST(CudaKernelTest, InvertibleLayerNormGrad_SmallSizeTensor_IntermediateAxis_FP16) {
|
||||
const std::vector<int64_t> X_dims{4, 20, 16, 8};
|
||||
const int64_t axis = -2;
|
||||
constexpr int64_t axis = -2;
|
||||
TestInvertibleLayerNormGrad(X_dims, axis, 2e-3, true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -135,10 +135,10 @@ Status InvertibleLayerNormGrad<T, U, V>::ComputeInternal(OpKernelContext* p_op_k
|
|||
auto bias_grad_data = reinterpret_cast<CudaV*>(bias_grad->template MutableData<V>());
|
||||
|
||||
#ifndef USE_ROCM
|
||||
const int part_size = 16;
|
||||
constexpr int part_size = 16;
|
||||
#else
|
||||
// Optimization for ROCm MI100
|
||||
const int part_size = 64;
|
||||
constexpr int part_size = 64;
|
||||
#endif
|
||||
auto part_grad_gamma = GetScratchBuffer<CudaU>(part_size * n2);
|
||||
auto part_grad_beta = GetScratchBuffer<CudaU>(part_size * n2);
|
||||
|
|
|
|||
Loading…
Reference in a new issue