From d26dc3cea7fbdb60e5374b6f49ce5ffddaebd59b Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Wed, 13 Feb 2019 19:40:59 +0300 Subject: [PATCH] [HIPIFY][DNN] Revise and sync with CUDNN 10 and hipDNN + CUDNN_API_supported_by_HIP.md update + CUDA_Runtime_API_functions_supported_by_HIP.md update + libraryPropertyType_t is moved to Runtime + test update --- ..._Runtime_API_functions_supported_by_HIP.md | 5 ++ docs/markdown/CUDNN_API_supported_by_HIP.md | 51 +++++++++++++++---- .../src/CUDA2HIP_DNN_API_functions.cpp | 38 +++++++++++--- hipify-clang/src/CUDA2HIP_DNN_API_types.cpp | 18 +++++++ .../cuDNN/cudnn_convolution_forward.cu | 2 +- 5 files changed, 96 insertions(+), 18 deletions(-) diff --git a/docs/markdown/CUDA_Runtime_API_functions_supported_by_HIP.md b/docs/markdown/CUDA_Runtime_API_functions_supported_by_HIP.md index da3f3d4c46..d7266ac450 100644 --- a/docs/markdown/CUDA_Runtime_API_functions_supported_by_HIP.md +++ b/docs/markdown/CUDA_Runtime_API_functions_supported_by_HIP.md @@ -1070,3 +1070,8 @@ | typedef |`cudaGraphicsResource_t` | | | struct |`cudaGraphicsResource` | | | typedef |`cudaHostFn_t` | | +| enum |***`libraryPropertyType`*** | | +| typedef |***`libraryPropertyType_t`*** | | +| 0 |*`MAJOR_VERSION`* | | +| 1 |*`MINOR_VERSION`* | | +| 2 |*`PATCH_LEVEL`* | | diff --git a/docs/markdown/CUDNN_API_supported_by_HIP.md b/docs/markdown/CUDNN_API_supported_by_HIP.md index ffdeb881e5..05c49e2bff 100644 --- a/docs/markdown/CUDNN_API_supported_by_HIP.md +++ b/docs/markdown/CUDNN_API_supported_by_HIP.md @@ -27,7 +27,6 @@ | 0 |*`CUDNN_ERRQUERY_RAWCODE`* | | | 1 |*`CUDNN_ERRQUERY_NONBLOCKING`* | | | 2 |*`CUDNN_ERRQUERY_BLOCKING`* | | -| enum |***`libraryPropertyType_t`*** | | | struct |`cudnnTensorStruct` | | | struct* |`cudnnTensorDescriptor_t` |`hipdnnTensorDescriptor_t` | | struct |`cudnnConvolutionStruct` | | @@ -55,8 +54,9 @@ | 3 |*`CUDNN_DATA_INT8`* |*`HIPDNN_DATA_INT8`* | | 4 |*`CUDNN_DATA_INT32`* |*`HIPDNN_DATA_INT32`* | | 5 |*`CUDNN_DATA_INT8x4`* |*`HIPDNN_DATA_INT8x4`* | -| 6 |*`CUDNN_DATA_UINT8`* |*`HIPDNN_DATA_UINT8`* | -| 7 |*`CUDNN_DATA_UINT8x4`* |*`HIPDNN_DATA_UINT8x4`* | +| 6 |*`CUDNN_DATA_UINT8`* | | +| 7 |*`CUDNN_DATA_UINT8x4`* | | +| 8 |*`CUDNN_DATA_INT8x32`* | | | enum |***`cudnnMathType_t`*** |***`hipdnnMathType_t`*** | | 0 |*`CUDNN_DEFAULT_MATH`* |*`HIPDNN_DEFAULT_MATH`* | | 1 |*`CUDNN_TENSOR_OP_MATH`* |*`HIPDNN_TENSOR_OP_MATH`* | @@ -77,7 +77,7 @@ | 2 |*`CUDNN_OP_TENSOR_MIN`* |*`HIPDNN_OP_TENSOR_MIN`* | | 3 |*`CUDNN_OP_TENSOR_MAX`* |*`HIPDNN_OP_TENSOR_MAX`* | | 4 |*`CUDNN_OP_TENSOR_SQRT`* |*`HIPDNN_OP_TENSOR_SQRT`* | -| 5 |*`CUDNN_OP_TENSOR_NOT`* | | +| 5 |*`CUDNN_OP_TENSOR_NOT`* |*`HIPDNN_OP_TENSOR_NOT`* | | enum |***`cudnnReduceTensorOp_t`*** |***`hipdnnReduceTensorOp_t`*** | | 0 |*`CUDNN_REDUCE_TENSOR_ADD`* |*`HIPDNN_REDUCE_TENSOR_ADD`* | | 1 |*`CUDNN_REDUCE_TENSOR_MUL`* |*`HIPDNN_REDUCE_TENSOR_MUL`* | @@ -199,6 +199,22 @@ | define |`CUDNN_SEV_INFO_EN` | | | struct |`cudnnDebug_t` | | | struct |`cudnnCallback_t` | | +| enum |***`cudnnBatchNormOps_t`*** | | +| 0 |*`CUDNN_BATCHNORM_OPS_BN`* | | +| 1 |*`CUDNN_BATCHNORM_OPS_BN_ACTIVATION`* | | +| 2 |*`CUDNN_BATCHNORM_OPS_BN_ADD_ACTIVATION`* | | +| enum |***`cudnnRNNClipMode_t`*** | | +| 0 |*`CUDNN_RNN_CLIP_NONE`* | | +| 1 |*`CUDNN_RNN_CLIP_MINMAX`* | | +| struct |`cudnnRNNDataStruct` | | +| struct* |`cudnnRNNDataDescriptor_t` | | +| enum |***`cudnnRNNDataLayout_t`*** | | +| 0 |*`CUDNN_RNN_DATA_LAYOUT_SEQ_MAJOR_UNPACKED`* | | +| 1 |*`CUDNN_RNN_DATA_LAYOUT_SEQ_MAJOR_PACKED`* | | +| 2 |*`CUDNN_RNN_DATA_LAYOUT_BATCH_MAJOR_UNPACKED`* | | +| enum |***`cudnnRNNPaddingMode_t`*** | | +| 0 |*`CUDNN_RNN_PADDED_IO_DISABLED`* | | +| 1 |*`CUDNN_RNN_PADDED_IO_ENABLED`* | | ## **2. CUDNN API functions** @@ -215,7 +231,7 @@ |`cudnnSetStream` |`hipdnnGetStream` | |`cudnnCreateTensorDescriptor` |`hipdnnCreateTensorDescriptor` | |`cudnnSetTensor4dDescriptor` |`hipdnnSetTensor4dDescriptor` | -|`cudnnSetTensor4dDescriptorEx` | | +|`cudnnSetTensor4dDescriptorEx` |`hipdnnSetTensor4dDescriptorEx` | |`cudnnGetTensor4dDescriptor` |`hipdnnGetTensor4dDescriptor` | |`cudnnSetTensorNdDescriptor` |`hipdnnSetTensorNdDescriptor` | |`cudnnSetTensorNdDescriptorEx` | | @@ -239,15 +255,15 @@ |`cudnnSetTensor` |`hipdnnSetTensor` | |`cudnnScaleTensor` |`hipdnnScaleTensor` | |`cudnnCreateFilterDescriptor` |`hipdnnCreateFilterDescriptor` | -|`cudnnSetFilter4dDescriptor` |`hipdnnSetFilter4dDescriptor` | -|`cudnnGetFilter4dDescriptor` |`hipdnnGetFilter4dDescriptor` | +|`cudnnSetFilter4dDescriptor` | | +|`cudnnGetFilter4dDescriptor` | | |`cudnnSetFilterNdDescriptor` |`hipdnnSetFilterNdDescriptor` | |`cudnnGetFilterNdDescriptor` |`hipdnnGetFilterNdDescriptor` | |`cudnnDestroyFilterDescriptor` |`hipdnnDestroyFilterDescriptor` | |`cudnnCreateConvolutionDescriptor` |`hipdnnCreateConvolutionDescriptor` | |`cudnnSetConvolutionMathType` |`hipdnnSetConvolutionMathType` | |`cudnnGetConvolutionMathType` | | -|`cudnnSetConvolutionGroupCount` | | +|`cudnnSetConvolutionGroupCount` |`hipdnnSetConvolutionGroupCount` | |`cudnnGetConvolutionGroupCount` | | |`cudnnSetConvolution2dDescriptor` |`hipdnnSetConvolution2dDescriptor` | |`cudnnGetConvolution2dDescriptor` |`hipdnnGetConvolution2dDescriptor` | @@ -308,8 +324,10 @@ |`cudnnDivisiveNormalizationBackward` | | |`cudnnDeriveBNTensorDescriptor` |`hipdnnDeriveBNTensorDescriptor` | |`cudnnBatchNormalizationForwardTraining` |`hipdnnBatchNormalizationForwardTraining` | +|`cudnnBatchNormalizationForwardTrainingEx` | | |`cudnnBatchNormalizationForwardInference` |`hipdnnBatchNormalizationForwardInference` | |`cudnnBatchNormalizationBackward` |`hipdnnBatchNormalizationBackward` | +|`cudnnBatchNormalizationBackwardEx` | | |`cudnnCreateSpatialTransformerDescriptor` | | |`cudnnSetSpatialTransformerNdDescriptor` | | |`cudnnDestroySpatialTransformerDescriptor` | | @@ -340,7 +358,7 @@ |`cudnnSetPersistentRNNPlan` |`hipdnnSetPersistentRNNPlan` | |`cudnnDestroyPersistentRNNPlan` |`hipdnnDestroyPersistentRNNPlan` | |`cudnnSetRNNDescriptor` |`hipdnnSetRNNDescriptor` | -|`cudnnGetRNNDescriptor` | | +|`cudnnGetRNNDescriptor` |`hipdnnGetRNNDescriptor` | |`cudnnSetRNNProjectionLayers` | | |`cudnnGetRNNProjectionLayers` | | |`cudnnSetRNNAlgorithmDescriptor` | | @@ -352,9 +370,19 @@ |`cudnnGetRNNLinLayerMatrixParams` |`hipdnnGetRNNLinLayerMatrixParams` | |`cudnnGetRNNLinLayerBiasParams` |`hipdnnGetRNNLinLayerBiasParams` | |`cudnnRNNForwardInference` |`hipdnnRNNForwardInference` | +|`cudnnRNNForwardInferenceEx` | | |`cudnnRNNForwardTraining` |`hipdnnRNNForwardTraining` | +|`cudnnRNNForwardTrainingEx` | | |`cudnnRNNBackwardData` |`hipdnnRNNBackwardData` | +|`cudnnRNNBackwardDataEx` | | |`cudnnRNNBackwardWeights` |`hipdnnRNNBackwardWeights` | +|`cudnnRNNBackwardWeightsEx` | | +|`cudnnSetRNNPaddingMode` | | +|`cudnnGetRNNPaddingMode` | | +|`cudnnCreateRNNDataDescriptor` | | +|`cudnnDestroyRNNDataDescriptor` | | +|`cudnnSetRNNDataDescriptor` | | +|`cudnnGetRNNDataDescriptor` | | |`cudnnCreateCTCLossDescriptor` | | |`cudnnSetCTCLossDescriptor` | | |`cudnnGetCTCLossDescriptor` | | @@ -377,3 +405,8 @@ |`cudnnSetRNNDescriptor_v6` |`hipdnnSetRNNDescriptor_v6` | |`cudnnSetCallback` | | |`cudnnGetCallback` | | +|`cudnnGetBatchNormalizationForwardTrainingExWorkspaceSize` | | +|`cudnnGetBatchNormalizationBackwardExWorkspaceSize` | | +|`cudnnGetBatchNormalizationTrainingExReserveSpaceSize` | | +|`cudnnRNNSetClip` | | +|`cudnnRNNGetClip` | | diff --git a/hipify-clang/src/CUDA2HIP_DNN_API_functions.cpp b/hipify-clang/src/CUDA2HIP_DNN_API_functions.cpp index 3e58ec0418..880e03be79 100644 --- a/hipify-clang/src/CUDA2HIP_DNN_API_functions.cpp +++ b/hipify-clang/src/CUDA2HIP_DNN_API_functions.cpp @@ -41,7 +41,7 @@ const std::map CUDA_DNN_FUNCTION_MAP{ // cuDNN Tensor functions {"cudnnCreateTensorDescriptor", {"hipdnnCreateTensorDescriptor", "", CONV_LIB_FUNC, API_DNN}}, {"cudnnSetTensor4dDescriptor", {"hipdnnSetTensor4dDescriptor", "", CONV_LIB_FUNC, API_DNN}}, - {"cudnnSetTensor4dDescriptorEx", {"hipdnnSetTensor4dDescriptorEx", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, + {"cudnnSetTensor4dDescriptorEx", {"hipdnnSetTensor4dDescriptorEx", "", CONV_LIB_FUNC, API_DNN}}, {"cudnnGetTensor4dDescriptor", {"hipdnnGetTensor4dDescriptor", "", CONV_LIB_FUNC, API_DNN}}, {"cudnnSetTensorNdDescriptor", {"hipdnnSetTensorNdDescriptor", "", CONV_LIB_FUNC, API_DNN}}, {"cudnnSetTensorNdDescriptorEx", {"hipdnnSetTensorNdDescriptorEx", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, @@ -69,7 +69,7 @@ const std::map CUDA_DNN_FUNCTION_MAP{ // cuDNN Filter functions {"cudnnCreateFilterDescriptor", {"hipdnnCreateFilterDescriptor", "", CONV_LIB_FUNC, API_DNN}}, - {"cudnnSetFilter4dDescriptor", {"hipdnnSetFilter4dDescriptor", "", CONV_LIB_FUNC, API_DNN}}, + {"cudnnSetFilter4dDescriptor", {"hipdnnSetFilter4dDescriptor", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, {"cudnnGetFilter4dDescriptor", {"hipdnnGetFilter4dDescriptor", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, {"cudnnSetFilterNdDescriptor", {"hipdnnSetFilterNdDescriptor", "", CONV_LIB_FUNC, API_DNN}}, {"cudnnGetFilterNdDescriptor", {"hipdnnGetFilterNdDescriptor", "", CONV_LIB_FUNC, API_DNN}}, @@ -79,7 +79,7 @@ const std::map CUDA_DNN_FUNCTION_MAP{ {"cudnnCreateConvolutionDescriptor", {"hipdnnCreateConvolutionDescriptor", "", CONV_LIB_FUNC, API_DNN}}, {"cudnnSetConvolutionMathType", {"hipdnnSetConvolutionMathType", "", CONV_LIB_FUNC, API_DNN}}, {"cudnnGetConvolutionMathType", {"hipdnnGetConvolutionMathType", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, - {"cudnnSetConvolutionGroupCount", {"hipdnnSetConvolutionGroupCount", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, + {"cudnnSetConvolutionGroupCount", {"hipdnnSetConvolutionGroupCount", "", CONV_LIB_FUNC, API_DNN}}, {"cudnnGetConvolutionGroupCount", {"hipdnnGetConvolutionGroupCount", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, {"cudnnSetConvolution2dDescriptor", {"hipdnnSetConvolution2dDescriptor", "", CONV_LIB_FUNC, API_DNN}}, {"cudnnGetConvolution2dDescriptor", {"hipdnnGetConvolution2dDescriptor", "", CONV_LIB_FUNC, API_DNN}}, @@ -149,10 +149,15 @@ const std::map CUDA_DNN_FUNCTION_MAP{ {"cudnnDivisiveNormalizationBackward", {"hipdnnDivisiveNormalizationBackward", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, // cuDNN Batch Normalization functions - {"cudnnDeriveBNTensorDescriptor", {"hipdnnDeriveBNTensorDescriptor", "", CONV_LIB_FUNC, API_DNN}}, - {"cudnnBatchNormalizationForwardTraining", {"hipdnnBatchNormalizationForwardTraining", "", CONV_LIB_FUNC, API_DNN}}, - {"cudnnBatchNormalizationForwardInference", {"hipdnnBatchNormalizationForwardInference", "", CONV_LIB_FUNC, API_DNN}}, - {"cudnnBatchNormalizationBackward", {"hipdnnBatchNormalizationBackward", "", CONV_LIB_FUNC, API_DNN}}, + {"cudnnDeriveBNTensorDescriptor", {"hipdnnDeriveBNTensorDescriptor", "", CONV_LIB_FUNC, API_DNN}}, + {"cudnnBatchNormalizationForwardTraining", {"hipdnnBatchNormalizationForwardTraining", "", CONV_LIB_FUNC, API_DNN}}, + {"cudnnBatchNormalizationForwardTrainingEx", {"hipdnnBatchNormalizationForwardTrainingEx", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, + {"cudnnBatchNormalizationForwardInference", {"hipdnnBatchNormalizationForwardInference", "", CONV_LIB_FUNC, API_DNN}}, + {"cudnnBatchNormalizationBackward", {"hipdnnBatchNormalizationBackward", "", CONV_LIB_FUNC, API_DNN}}, + {"cudnnBatchNormalizationBackwardEx", {"hipdnnBatchNormalizationBackwardEx", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, + {"cudnnGetBatchNormalizationForwardTrainingExWorkspaceSize", {"hipdnnGetBatchNormalizationForwardTrainingExWorkspaceSize", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, + {"cudnnGetBatchNormalizationBackwardExWorkspaceSize", {"hipdnnGetBatchNormalizationBackwardExWorkspaceSize", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, + {"cudnnGetBatchNormalizationTrainingExReserveSpaceSize", {"hipdnnGetBatchNormalizationTrainingExReserveSpaceSize", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, // cuDNN Spatial Transformer functions {"cudnnCreateSpatialTransformerDescriptor", {"hipdnnCreateSpatialTransformerDescriptor", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, @@ -188,8 +193,10 @@ const std::map CUDA_DNN_FUNCTION_MAP{ {"cudnnCreatePersistentRNNPlan", {"hipdnnCreatePersistentRNNPlan", "", CONV_LIB_FUNC, API_DNN}}, {"cudnnSetPersistentRNNPlan", {"hipdnnSetPersistentRNNPlan", "", CONV_LIB_FUNC, API_DNN}}, {"cudnnDestroyPersistentRNNPlan", {"hipdnnDestroyPersistentRNNPlan", "", CONV_LIB_FUNC, API_DNN}}, + // NOTE" hipdnnSetRNNDescriptor has additional argument hipdnnRNNBiasMode_t *biasMode without default value {"cudnnSetRNNDescriptor", {"hipdnnSetRNNDescriptor", "", CONV_LIB_FUNC, API_DNN}}, - {"cudnnGetRNNDescriptor", {"hipdnnGetRNNDescriptor", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, + // NOTE" hipdnnGetRNNDescriptor has additional argument hipdnnRNNBiasMode_t *biasMode without default value + {"cudnnGetRNNDescriptor", {"hipdnnGetRNNDescriptor", "", CONV_LIB_FUNC, API_DNN}}, {"cudnnSetRNNProjectionLayers", {"hipdnnSetRNNProjectionLayers", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, {"cudnnGetRNNProjectionLayers", {"hipdnnGetRNNProjectionLayers", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, {"cudnnSetRNNAlgorithmDescriptor", {"hipdnnSetRNNAlgorithmDescriptor", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, @@ -201,11 +208,21 @@ const std::map CUDA_DNN_FUNCTION_MAP{ {"cudnnGetRNNLinLayerMatrixParams", {"hipdnnGetRNNLinLayerMatrixParams", "", CONV_LIB_FUNC, API_DNN}}, {"cudnnGetRNNLinLayerBiasParams", {"hipdnnGetRNNLinLayerBiasParams", "", CONV_LIB_FUNC, API_DNN}}, {"cudnnRNNForwardInference", {"hipdnnRNNForwardInference", "", CONV_LIB_FUNC, API_DNN}}, + {"cudnnRNNForwardInferenceEx", {"hipdnnRNNForwardInferenceEx", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, {"cudnnRNNForwardTraining", {"hipdnnRNNForwardTraining", "", CONV_LIB_FUNC, API_DNN}}, + {"cudnnRNNForwardTrainingEx", {"hipdnnRNNForwardTrainingEx", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, {"cudnnRNNBackwardData", {"hipdnnRNNBackwardData", "", CONV_LIB_FUNC, API_DNN}}, + {"cudnnRNNBackwardDataEx", {"hipdnnRNNBackwardDataEx", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, {"cudnnRNNBackwardWeights", {"hipdnnRNNBackwardWeights", "", CONV_LIB_FUNC, API_DNN}}, + {"cudnnRNNBackwardWeightsEx", {"hipdnnRNNBackwardWeightsEx", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, {"cudnnSetRNNDescriptor_v5", {"hipdnnSetRNNDescriptor_v5", "", CONV_LIB_FUNC, API_DNN}}, {"cudnnSetRNNDescriptor_v6", {"hipdnnSetRNNDescriptor_v6", "", CONV_LIB_FUNC, API_DNN}}, + {"cudnnSetRNNPaddingMode", {"hipdnnSetRNNPaddingMode", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, + {"cudnnGetRNNPaddingMode", {"hipdnnGetRNNPaddingMode", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, + {"cudnnCreateRNNDataDescriptor", {"hipdnnCreateRNNDataDescriptor", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, + {"cudnnDestroyRNNDataDescriptor", {"hipdnnDestroyRNNDataDescriptor", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, + {"cudnnSetRNNDataDescriptor", {"hipdnnSetRNNDataDescriptor", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, + {"cudnnGetRNNDataDescriptor", {"hipdnnGetRNNDataDescriptor", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, // cuDNN Connectionist Temporal Classification loss functions {"cudnnCreateCTCLossDescriptor", {"hipdnnCreateCTCLossDescriptor", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, @@ -228,4 +245,9 @@ const std::map CUDA_DNN_FUNCTION_MAP{ {"cudnnGetAlgorithmSpaceSize", {"hipdnnGetAlgorithmSpaceSize", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, {"cudnnSaveAlgorithm", {"hipdnnSaveAlgorithm", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, {"cudnnRestoreAlgorithm", {"hipdnnRestoreAlgorithm", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, + + // cuDNN Clipping functions + {"cudnnRNNSetClip", {"hipdnnRNNSetClip", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, + {"cudnnRNNGetClip", {"hipdnnRNNGetClip", "", CONV_LIB_FUNC, API_DNN, HIP_UNSUPPORTED}}, + }; diff --git a/hipify-clang/src/CUDA2HIP_DNN_API_types.cpp b/hipify-clang/src/CUDA2HIP_DNN_API_types.cpp index f2e1dd6709..508726e20e 100644 --- a/hipify-clang/src/CUDA2HIP_DNN_API_types.cpp +++ b/hipify-clang/src/CUDA2HIP_DNN_API_types.cpp @@ -69,6 +69,7 @@ const std::map CUDA_DNN_TYPE_NAME_MAP{ {"CUDNN_DATA_INT8x4", {"HIPDNN_DATA_INT8x4", "", CONV_NUMERIC_LITERAL, API_DNN}}, // 5 {"CUDNN_DATA_UINT8", {"HIPDNN_DATA_UINT8", "", CONV_NUMERIC_LITERAL, API_DNN, HIP_UNSUPPORTED}}, // 6 {"CUDNN_DATA_UINT8x4", {"HIPDNN_DATA_UINT8x4", "", CONV_NUMERIC_LITERAL, API_DNN, HIP_UNSUPPORTED}}, // 7 + {"CUDNN_DATA_INT8x32", {"HIPDNN_DATA_INT8x32", "", CONV_NUMERIC_LITERAL, API_DNN, HIP_UNSUPPORTED}}, // 8 {"cudnnErrQueryMode_t", {"hipdnnErrQueryMode_t", "", CONV_TYPE, API_DNN, HIP_UNSUPPORTED}}, {"CUDNN_ERRQUERY_RAWCODE", {"HIPDNN_ERRQUERY_RAWCODE", "", CONV_NUMERIC_LITERAL, API_DNN, HIP_UNSUPPORTED}}, // 0 {"CUDNN_ERRQUERY_NONBLOCKING", {"HIPDNN_ERRQUERY_NONBLOCKING", "", CONV_NUMERIC_LITERAL, API_DNN, HIP_UNSUPPORTED}}, // 1 @@ -111,6 +112,7 @@ const std::map CUDA_DNN_TYPE_NAME_MAP{ {"cudnnMathType_t", {"hipdnnMathType_t", "", CONV_TYPE, API_DNN}}, {"CUDNN_DEFAULT_MATH", {"HIPDNN_DEFAULT_MATH", "", CONV_NUMERIC_LITERAL, API_DNN}}, // 0 {"CUDNN_TENSOR_OP_MATH", {"HIPDNN_TENSOR_OP_MATH", "", CONV_NUMERIC_LITERAL, API_DNN}}, // 1 + {"CUDNN_TENSOR_OP_MATH_ALLOW_CONVERSION", {"HIPDNN_TENSOR_OP_MATH_ALLOW_CONVERSION", "", CONV_NUMERIC_LITERAL, API_DNN, HIP_UNSUPPORTED}}, // 2 {"cudnnNanPropagation_t", {"hipdnnNanPropagation_t", "", CONV_TYPE, API_DNN}}, {"CUDNN_NOT_PROPAGATE_NAN", {"HIPDNN_NOT_PROPAGATE_NAN", "", CONV_NUMERIC_LITERAL, API_DNN}}, // 0 {"CUDNN_PROPAGATE_NAN", {"HIPDNN_PROPAGATE_NAN", "", CONV_NUMERIC_LITERAL, API_DNN}}, // 1 @@ -199,6 +201,20 @@ const std::map CUDA_DNN_TYPE_NAME_MAP{ {"CUDNN_BATCHNORM_SPATIAL_PERSISTENT", {"HIPDNN_BATCHNORM_SPATIAL_PERSISTENT", "", CONV_NUMERIC_LITERAL, API_DNN}}, // 2 {"cudnnSamplerType_t", {"hipdnnSamplerType_t", "", CONV_TYPE, API_DNN, HIP_UNSUPPORTED}}, {"CUDNN_SAMPLER_BILINEAR", {"HIPDNN_SAMPLER_BILINEAR", "", CONV_NUMERIC_LITERAL, API_DNN, HIP_UNSUPPORTED}}, // 0 + {"cudnnBatchNormOps_t", {"hipdnnBatchNormOps_t", "", CONV_TYPE, API_DNN, HIP_UNSUPPORTED}}, + {"CUDNN_BATCHNORM_OPS_BN", {"HIPDNN_BATCHNORM_OPS_BN", "", CONV_NUMERIC_LITERAL, API_DNN, HIP_UNSUPPORTED}}, // 0 + {"CUDNN_BATCHNORM_OPS_BN_ACTIVATION", {"HIPDNN_BATCHNORM_OPS_BN_ACTIVATION", "", CONV_NUMERIC_LITERAL, API_DNN, HIP_UNSUPPORTED}}, // 1 + {"CUDNN_BATCHNORM_OPS_BN_ADD_ACTIVATION", {"HIPDNN_BATCHNORM_OPS_BN_ADD_ACTIVATION", "", CONV_NUMERIC_LITERAL, API_DNN, HIP_UNSUPPORTED}}, // 2 + {"cudnnRNNClipMode_t", {"hipdnnRNNClipMode_t", "", CONV_TYPE, API_DNN, HIP_UNSUPPORTED}}, + {"CUDNN_RNN_CLIP_NONE", {"HIPDNN_RNN_CLIP_NONE", "", CONV_NUMERIC_LITERAL, API_DNN, HIP_UNSUPPORTED}}, // 0 + {"CUDNN_RNN_CLIP_MINMAX", {"HIPDNN_RNN_CLIP_MINMAX", "", CONV_NUMERIC_LITERAL, API_DNN, HIP_UNSUPPORTED}}, // 1 + {"cudnnRNNDataLayout_t", {"hipdnnRNNDataLayout_t", "", CONV_TYPE, API_DNN, HIP_UNSUPPORTED}}, + {"CUDNN_RNN_DATA_LAYOUT_SEQ_MAJOR_UNPACKED", {"HIPDNN_RNN_DATA_LAYOUT_SEQ_MAJOR_UNPACKED", "", CONV_NUMERIC_LITERAL, API_DNN, HIP_UNSUPPORTED}}, // 0 + {"CUDNN_RNN_DATA_LAYOUT_SEQ_MAJOR_PACKED", {"HIPDNN_RNN_DATA_LAYOUT_SEQ_MAJOR_PACKED", "", CONV_NUMERIC_LITERAL, API_DNN, HIP_UNSUPPORTED}}, // 1 + {"CUDNN_RNN_DATA_LAYOUT_BATCH_MAJOR_UNPACKED", {"HIPDNN_RNN_DATA_LAYOUT_BATCH_MAJOR_UNPACKED", "", CONV_NUMERIC_LITERAL, API_DNN, HIP_UNSUPPORTED}}, // 2 + {"cudnnRNNPaddingMode_t", {"hipdnnRNNPaddingMode_t", "", CONV_TYPE, API_DNN, HIP_UNSUPPORTED}}, + {"CUDNN_RNN_PADDED_IO_DISABLED", {"HIPDNN_RNN_PADDED_IO_DISABLED", "", CONV_NUMERIC_LITERAL, API_DNN, HIP_UNSUPPORTED}}, // 0 + {"CUDNN_RNN_PADDED_IO_ENABLED", {"HIPDNN_RNN_PADDED_IO_ENABLED", "", CONV_NUMERIC_LITERAL, API_DNN, HIP_UNSUPPORTED}}, // 1 // cuDNN types {"cudnnContext", {"hipdnnContext", "", CONV_TYPE, API_DNN, HIP_UNSUPPORTED}}, @@ -239,4 +255,6 @@ const std::map CUDA_DNN_TYPE_NAME_MAP{ {"cudnnAlgorithm_t", {"hipdnnAlgorithm_t", "", CONV_TYPE, API_DNN, HIP_UNSUPPORTED}}, {"cudnnDebug_t", {"hipdnnDebug_t", "", CONV_TYPE, API_DNN, HIP_UNSUPPORTED}}, {"cudnnCallback_t", {"hipdnnCallback_t", "", CONV_TYPE, API_DNN, HIP_UNSUPPORTED}}, + {"cudnnRNNDataStruct", {"hipdnnRNNDataStruct", "", CONV_TYPE, API_DNN, HIP_UNSUPPORTED}}, + {"cudnnRNNDataDescriptor_t", {"hipdnnRNNDataDescriptor_t", "", CONV_TYPE, API_DNN, HIP_UNSUPPORTED}}, }; diff --git a/tests/hipify-clang/unit_tests/libraries/cuDNN/cudnn_convolution_forward.cu b/tests/hipify-clang/unit_tests/libraries/cuDNN/cudnn_convolution_forward.cu index 6aae90e403..23880097ff 100644 --- a/tests/hipify-clang/unit_tests/libraries/cuDNN/cudnn_convolution_forward.cu +++ b/tests/hipify-clang/unit_tests/libraries/cuDNN/cudnn_convolution_forward.cu @@ -113,7 +113,7 @@ int main() { cudnnFilterDescriptor_t filt_desc; // CHECK: CUDNN_CALL(hipdnnCreateFilterDescriptor(&filt_desc)); CUDNN_CALL(cudnnCreateFilterDescriptor(&filt_desc)); - // CHECK: CUDNN_CALL(hipdnnSetFilter4dDescriptor( + // CHECK-NOT: CUDNN_CALL(hipdnnSetFilter4dDescriptor( CUDNN_CALL(cudnnSetFilter4dDescriptor( // CHECK: filt_desc, HIPDNN_DATA_FLOAT, HIPDNN_TENSOR_NCHW, filt_desc, CUDNN_DATA_FLOAT, CUDNN_TENSOR_NCHW,