1 /** 2 * Copyright 2019-2022 Huawei Technologies Co., Ltd 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_GPU_KERNEL_CONSTANTS_H_ 18 #define MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_GPU_KERNEL_CONSTANTS_H_ 19 #include <map> 20 #include <string> 21 #include "mindspore/core/ops/framework_ops.h" 22 23 namespace mindspore { 24 namespace kernel { 25 // Used by Pooling and Conv2d 26 static constexpr char kSamePadModeUpperCase[] = "SAME"; 27 28 // Used by Pooling and Conv2d 29 static constexpr char kSamePadModeLowerCase[] = "same"; 30 31 // Used by Pooling and Conv2d 32 static constexpr char kValidPadModeUpperCase[] = "VALID"; 33 34 // Used by Pooling and Conv2d 35 static constexpr char kValidPadModeLowerCase[] = "valid"; 36 37 // Used by Pooling and Conv2d 38 static constexpr char kPadPadModeUpperCase[] = "PAD"; 39 40 // Used by Pooling and Conv2d 41 static constexpr char kPadPadModeLowerCase[] = "pad"; 42 43 // Used by Pooling 44 static constexpr char kAvgPoolingModeUpperCase[] = "AVG"; 45 46 // Used by Pooling 47 static constexpr char kAvgPoolingModeLowerCase[] = "avg"; 48 49 // Used by cholesky 50 static constexpr char kLower[] = "lower"; 51 52 // Used by cholesky 53 static constexpr char kClean[] = "clean"; 54 55 // Used by cholesky 56 static constexpr char kSplitDim[] = "split_dim"; 57 58 // Used by MatrixSetDiag 59 static constexpr char kAlignment[] = "alignment"; 60 61 // Used by MaxPool pad: The minimum value of float32 62 static constexpr float kSignedMinFloat = -3.402823466e+38F; 63 64 // Used by mixprecision, cudnn dtype select 65 static std::map<std::string, cudnnDataType_t> kCudnnDtypeMap = { 66 {"Float32", CUDNN_DATA_FLOAT}, {"Float16", CUDNN_DATA_HALF}, {"Float64", CUDNN_DATA_DOUBLE}, 67 {"Int32", CUDNN_DATA_INT32}, {"Bool", CUDNN_DATA_INT8}, {"Int8", CUDNN_DATA_INT8}, 68 {"UInt8", CUDNN_DATA_UINT8}}; 69 // Used by mixprecision, cuda dtype select 70 static std::map<std::string, cudaDataType_t> kCudaDtypeMap = { 71 {"Float64", CUDA_R_64F}, {"Float32", CUDA_R_32F}, {"Float16", CUDA_R_16F}, {"Complex64", CUDA_C_32F}, 72 {"Complex128", CUDA_C_64F}, {"Int8", CUDA_R_8I}, {"Int32", CUDA_R_32I}}; 73 } // namespace kernel 74 } // namespace mindspore 75 76 #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_GPU_KERNEL_CONSTANTS_H_ 77