diff --git a/bin/hipify-perl b/bin/hipify-perl index 0540fb03..f1fcfdf4 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -2885,7 +2885,6 @@ sub rocSubstitutions { subst("CUBLAS_STATUS_NOT_INITIALIZED", "rocblas_status_invalid_handle", "numeric_literal"); subst("CUBLAS_STATUS_NOT_SUPPORTED", "rocblas_status_perf_degraded", "numeric_literal"); subst("CUBLAS_STATUS_SUCCESS", "rocblas_status_success", "numeric_literal"); - subst("CUBLAS_TF32_TENSOR_OP_MATH", "rocblas_xf32_xdl_math_op", "numeric_literal"); subst("CUDA_C_16BF", "rocblas_datatype_bf16_c", "numeric_literal"); subst("CUDA_C_16F", "rocblas_datatype_f16_c", "numeric_literal"); subst("CUDA_C_32F", "rocblas_datatype_f32_c", "numeric_literal"); @@ -3883,6 +3882,7 @@ sub simpleSubstitutions { subst("cublasGemmEx", "hipblasGemmEx_v2", "library"); subst("cublasGemmStridedBatchedEx", "hipblasGemmStridedBatchedEx_v2", "library"); subst("cublasGetAtomicsMode", "hipblasGetAtomicsMode", "library"); + subst("cublasGetMathMode", "hipblasGetMathMode", "library"); subst("cublasGetMatrix", "hipblasGetMatrix", "library"); subst("cublasGetMatrixAsync", "hipblasGetMatrixAsync", "library"); subst("cublasGetPointerMode", "hipblasGetPointerMode", "library"); @@ -3927,6 +3927,7 @@ sub simpleSubstitutions { subst("cublasSdot", "hipblasSdot", "library"); subst("cublasSdot_v2", "hipblasSdot", "library"); subst("cublasSetAtomicsMode", "hipblasSetAtomicsMode", "library"); + subst("cublasSetMathMode", "hipblasSetMathMode", "library"); subst("cublasSetMatrix", "hipblasSetMatrix", "library"); subst("cublasSetMatrixAsync", "hipblasSetMatrixAsync", "library"); subst("cublasSetPointerMode", "hipblasSetPointerMode", "library"); @@ -5156,6 +5157,7 @@ sub simpleSubstitutions { subst("cublasFillMode_t", "hipblasFillMode_t", "type"); subst("cublasGemmAlgo_t", "hipblasGemmAlgo_t", "type"); subst("cublasHandle_t", "hipblasHandle_t", "type"); + subst("cublasMath_t", "hipblasMath_t", "type"); subst("cublasOperation_t", "hipblasOperation_t", "type"); subst("cublasPointerMode_t", "hipblasPointerMode_t", "type"); subst("cublasSideMode_t", "hipblasSideMode_t", "type"); @@ -5415,6 +5417,7 @@ sub simpleSubstitutions { subst("CUBLAS_COMPUTE_32I_PEDANTIC", "HIPBLAS_COMPUTE_32I_PEDANTIC", "numeric_literal"); subst("CUBLAS_COMPUTE_64F", "HIPBLAS_COMPUTE_64F", "numeric_literal"); subst("CUBLAS_COMPUTE_64F_PEDANTIC", "HIPBLAS_COMPUTE_64F_PEDANTIC", "numeric_literal"); + subst("CUBLAS_DEFAULT_MATH", "HIPBLAS_DEFAULT_MATH", "numeric_literal"); subst("CUBLAS_DIAG_NON_UNIT", "HIPBLAS_DIAG_NON_UNIT", "numeric_literal"); subst("CUBLAS_DIAG_UNIT", "HIPBLAS_DIAG_UNIT", "numeric_literal"); subst("CUBLAS_FILL_MODE_FULL", "HIPBLAS_FILL_MODE_FULL", "numeric_literal"); @@ -5422,10 +5425,12 @@ sub simpleSubstitutions { subst("CUBLAS_FILL_MODE_UPPER", "HIPBLAS_FILL_MODE_UPPER", "numeric_literal"); subst("CUBLAS_GEMM_DEFAULT", "HIPBLAS_GEMM_DEFAULT", "numeric_literal"); subst("CUBLAS_GEMM_DFALT", "HIPBLAS_GEMM_DEFAULT", "numeric_literal"); + subst("CUBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION", "HIPBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION", "numeric_literal"); subst("CUBLAS_OP_C", "HIPBLAS_OP_C", "numeric_literal"); subst("CUBLAS_OP_HERMITAN", "HIPBLAS_OP_C", "numeric_literal"); subst("CUBLAS_OP_N", "HIPBLAS_OP_N", "numeric_literal"); subst("CUBLAS_OP_T", "HIPBLAS_OP_T", "numeric_literal"); + subst("CUBLAS_PEDANTIC_MATH", "HIPBLAS_PEDANTIC_MATH", "numeric_literal"); subst("CUBLAS_POINTER_MODE_DEVICE", "HIPBLAS_POINTER_MODE_DEVICE", "numeric_literal"); subst("CUBLAS_POINTER_MODE_HOST", "HIPBLAS_POINTER_MODE_HOST", "numeric_literal"); subst("CUBLAS_SIDE_LEFT", "HIPBLAS_SIDE_LEFT", "numeric_literal"); @@ -5440,6 +5445,8 @@ sub simpleSubstitutions { subst("CUBLAS_STATUS_NOT_INITIALIZED", "HIPBLAS_STATUS_NOT_INITIALIZED", "numeric_literal"); subst("CUBLAS_STATUS_NOT_SUPPORTED", "HIPBLAS_STATUS_NOT_SUPPORTED", "numeric_literal"); subst("CUBLAS_STATUS_SUCCESS", "HIPBLAS_STATUS_SUCCESS", "numeric_literal"); + subst("CUBLAS_TENSOR_OP_MATH", "HIPBLAS_TENSOR_OP_MATH", "numeric_literal"); + subst("CUBLAS_TF32_TENSOR_OP_MATH", "HIPBLAS_TF32_TENSOR_OP_MATH", "numeric_literal"); subst("CUDA_C_16BF", "HIP_C_16BF", "numeric_literal"); subst("CUDA_C_16F", "HIP_C_16F", "numeric_literal"); subst("CUDA_C_32F", "HIP_C_32F", "numeric_literal"); @@ -10819,7 +10826,6 @@ sub warnHipOnlyUnsupportedFunctions { "cublasSetSmCountTarget", "cublasSetMatrix_64", "cublasSetMatrixAsync_64", - "cublasSetMathMode", "cublasSetLoggerCallback", "cublasSetKernelStream", "cublasSdot_v2_64", @@ -10843,7 +10849,6 @@ sub warnHipOnlyUnsupportedFunctions { "cublasRotEx_64", "cublasNrm2Ex_64", "cublasMigrateComputeType", - "cublasMath_t", "cublasLoggerConfigure", "cublasLogCallback", "cublasIzamin_v2_64", @@ -10888,7 +10893,6 @@ sub warnHipOnlyUnsupportedFunctions { "cublasGetProperty", "cublasGetMatrix_64", "cublasGetMatrixAsync_64", - "cublasGetMathMode", "cublasGetLoggerCallback", "cublasGetError", "cublasGetCudartVersion", @@ -11104,11 +11108,7 @@ sub warnHipOnlyUnsupportedFunctions { "CUDA_C_4I", "CUDA_C_16U", "CUDA_C_16I", - "CUBLAS_TF32_TENSOR_OP_MATH", - "CUBLAS_TENSOR_OP_MATH", - "CUBLAS_PEDANTIC_MATH", "CUBLAS_OP_CONJG", - "CUBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION", "CUBLAS_GEMM_DFALT_TENSOR_OP", "CUBLAS_GEMM_DEFAULT_TENSOR_OP", "CUBLAS_GEMM_ALGO9_TENSOR_OP", @@ -11150,8 +11150,7 @@ sub warnHipOnlyUnsupportedFunctions { "CUBLAS_GEMM_ALGO10", "CUBLAS_GEMM_ALGO1", "CUBLAS_GEMM_ALGO0_TENSOR_OP", - "CUBLAS_GEMM_ALGO0", - "CUBLAS_DEFAULT_MATH" + "CUBLAS_GEMM_ALGO0" ) { my $mt = m/($func)/g; @@ -11634,6 +11633,7 @@ sub warnRocOnlyUnsupportedFunctions { "CUDA_C_4I", "CUDA_C_16U", "CUDA_C_16I", + "CUBLAS_TF32_TENSOR_OP_MATH", "CUBLAS_TENSOR_OP_MATH", "CUBLAS_STATUS_LICENSE_ERROR", "CUBLAS_PEDANTIC_MATH", diff --git a/docs/tables/CUBLAS_API_supported_by_HIP.md b/docs/tables/CUBLAS_API_supported_by_HIP.md index f52f2ef1..671ba07d 100644 --- a/docs/tables/CUBLAS_API_supported_by_HIP.md +++ b/docs/tables/CUBLAS_API_supported_by_HIP.md @@ -17,7 +17,7 @@ |`CUBLAS_COMPUTE_32I_PEDANTIC`|11.0| | | |`HIPBLAS_COMPUTE_32I_PEDANTIC`|6.0.0| | | | | |`CUBLAS_COMPUTE_64F`|11.0| | | |`HIPBLAS_COMPUTE_64F`|6.0.0| | | | | |`CUBLAS_COMPUTE_64F_PEDANTIC`|11.0| | | |`HIPBLAS_COMPUTE_64F_PEDANTIC`|6.0.0| | | | | -|`CUBLAS_DEFAULT_MATH`|9.0| | | | | | | | | | +|`CUBLAS_DEFAULT_MATH`|9.0| | | |`HIPBLAS_DEFAULT_MATH`|6.1.0| | | | | |`CUBLAS_DIAG_NON_UNIT`| | | | |`HIPBLAS_DIAG_NON_UNIT`|1.8.2| | | | | |`CUBLAS_DIAG_UNIT`| | | | |`HIPBLAS_DIAG_UNIT`|1.8.2| | | | | |`CUBLAS_FILL_MODE_FULL`|10.1| | | |`HIPBLAS_FILL_MODE_FULL`|1.8.2| | | | | @@ -67,13 +67,13 @@ |`CUBLAS_GEMM_DEFAULT_TENSOR_OP`|9.0| | | | | | | | | | |`CUBLAS_GEMM_DFALT`|8.0| | | |`HIPBLAS_GEMM_DEFAULT`|1.8.2| | | | | |`CUBLAS_GEMM_DFALT_TENSOR_OP`|9.0| | | | | | | | | | -|`CUBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION`|11.0| | | | | | | | | | +|`CUBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION`|11.0| | | |`HIPBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION`|6.1.0| | | | | |`CUBLAS_OP_C`| | | | |`HIPBLAS_OP_C`|1.8.2| | | | | |`CUBLAS_OP_CONJG`|10.1| | | | | | | | | | |`CUBLAS_OP_HERMITAN`|10.1| | | |`HIPBLAS_OP_C`|1.8.2| | | | | |`CUBLAS_OP_N`| | | | |`HIPBLAS_OP_N`|1.8.2| | | | | |`CUBLAS_OP_T`| | | | |`HIPBLAS_OP_T`|1.8.2| | | | | -|`CUBLAS_PEDANTIC_MATH`|11.0| | | | | | | | | | +|`CUBLAS_PEDANTIC_MATH`|11.0| | | |`HIPBLAS_PEDANTIC_MATH`|6.1.0| | | | | |`CUBLAS_POINTER_MODE_DEVICE`| | | | |`HIPBLAS_POINTER_MODE_DEVICE`|1.8.2| | | | | |`CUBLAS_POINTER_MODE_HOST`| | | | |`HIPBLAS_POINTER_MODE_HOST`|1.8.2| | | | | |`CUBLAS_SIDE_LEFT`| | | | |`HIPBLAS_SIDE_LEFT`|1.8.2| | | | | @@ -88,8 +88,8 @@ |`CUBLAS_STATUS_NOT_INITIALIZED`| | | | |`HIPBLAS_STATUS_NOT_INITIALIZED`|1.8.2| | | | | |`CUBLAS_STATUS_NOT_SUPPORTED`| | | | |`HIPBLAS_STATUS_NOT_SUPPORTED`|1.8.2| | | | | |`CUBLAS_STATUS_SUCCESS`| | | | |`HIPBLAS_STATUS_SUCCESS`|1.8.2| | | | | -|`CUBLAS_TENSOR_OP_MATH`|9.0|11.0| | | | | | | | | -|`CUBLAS_TF32_TENSOR_OP_MATH`|11.0| | | | | | | | | | +|`CUBLAS_TENSOR_OP_MATH`|9.0|11.0| | |`HIPBLAS_TENSOR_OP_MATH`|6.1.0| | | | | +|`CUBLAS_TF32_TENSOR_OP_MATH`|11.0| | | |`HIPBLAS_TF32_TENSOR_OP_MATH`|6.1.0| | | | | |`cublasAtomicsMode_t`| | | | |`hipblasAtomicsMode_t`|3.10.0| | | | | |`cublasComputeType_t`|11.0| | | |`hipblasComputeType_t`|6.0.0| | | | | |`cublasContext`| | | | | | | | | | | @@ -97,7 +97,7 @@ |`cublasFillMode_t`| | | | |`hipblasFillMode_t`|1.8.2| | | | | |`cublasGemmAlgo_t`|8.0| | | |`hipblasGemmAlgo_t`|1.8.2| | | | | |`cublasHandle_t`| | | | |`hipblasHandle_t`|3.0.0| | | | | -|`cublasMath_t`|9.0| | | | | | | | | | +|`cublasMath_t`|9.0| | | |`hipblasMath_t`|6.1.0| | | | | |`cublasOperation_t`| | | | |`hipblasOperation_t`|1.8.2| | | | | |`cublasPointerMode_t`| | | | |`hipblasPointerMode_t`|1.8.2| | | | | |`cublasSideMode_t`| | | | |`hipblasSideMode_t`|1.8.2| | | | | @@ -156,7 +156,7 @@ |`cublasGetCudartVersion`|10.1| | | | | | | | | | |`cublasGetError`| | | | | | | | | | | |`cublasGetLoggerCallback`|9.2| | | | | | | | | | -|`cublasGetMathMode`|9.0| | | | | | | | | | +|`cublasGetMathMode`|9.0| | | |`hipblasGetMathMode`|6.1.0| | | | | |`cublasGetMatrix`| | | | |`hipblasGetMatrix`|1.8.2| | | | | |`cublasGetMatrixAsync`| | | | |`hipblasGetMatrixAsync`|3.7.0| | | | | |`cublasGetMatrixAsync_64`|12.0| | | | | | | | | | @@ -182,7 +182,7 @@ |`cublasSetAtomicsMode`| | | | |`hipblasSetAtomicsMode`|3.10.0| | | | | |`cublasSetKernelStream`| | | | | | | | | | | |`cublasSetLoggerCallback`|9.2| | | | | | | | | | -|`cublasSetMathMode`|9.0| | | | | | | | | | +|`cublasSetMathMode`|9.0| | | |`hipblasSetMathMode`|6.1.0| | | | | |`cublasSetMatrix`| | | | |`hipblasSetMatrix`|1.8.2| | | | | |`cublasSetMatrixAsync`| | | | |`hipblasSetMatrixAsync`|3.7.0| | | | | |`cublasSetMatrixAsync_64`|12.0| | | | | | | | | | diff --git a/docs/tables/CUBLAS_API_supported_by_HIP_and_ROC.md b/docs/tables/CUBLAS_API_supported_by_HIP_and_ROC.md index 84829149..9deb4c30 100644 --- a/docs/tables/CUBLAS_API_supported_by_HIP_and_ROC.md +++ b/docs/tables/CUBLAS_API_supported_by_HIP_and_ROC.md @@ -17,7 +17,7 @@ |`CUBLAS_COMPUTE_32I_PEDANTIC`|11.0| | | |`HIPBLAS_COMPUTE_32I_PEDANTIC`|6.0.0| | | | | | | | | | | |`CUBLAS_COMPUTE_64F`|11.0| | | |`HIPBLAS_COMPUTE_64F`|6.0.0| | | | | | | | | | | |`CUBLAS_COMPUTE_64F_PEDANTIC`|11.0| | | |`HIPBLAS_COMPUTE_64F_PEDANTIC`|6.0.0| | | | | | | | | | | -|`CUBLAS_DEFAULT_MATH`|9.0| | | | | | | | | |`rocblas_default_math`|5.7.0| | | | | +|`CUBLAS_DEFAULT_MATH`|9.0| | | |`HIPBLAS_DEFAULT_MATH`|6.1.0| | | | |`rocblas_default_math`|5.7.0| | | | | |`CUBLAS_DIAG_NON_UNIT`| | | | |`HIPBLAS_DIAG_NON_UNIT`|1.8.2| | | | |`rocblas_diagonal_non_unit`|1.5.0| | | | | |`CUBLAS_DIAG_UNIT`| | | | |`HIPBLAS_DIAG_UNIT`|1.8.2| | | | |`rocblas_diagonal_unit`|1.5.0| | | | | |`CUBLAS_FILL_MODE_FULL`|10.1| | | |`HIPBLAS_FILL_MODE_FULL`|1.8.2| | | | |`rocblas_fill_full`|1.5.0| | | | | @@ -67,13 +67,13 @@ |`CUBLAS_GEMM_DEFAULT_TENSOR_OP`|9.0| | | | | | | | | | | | | | | | |`CUBLAS_GEMM_DFALT`|8.0| | | |`HIPBLAS_GEMM_DEFAULT`|1.8.2| | | | |`rocblas_gemm_algo_standard`|1.8.2| | | | | |`CUBLAS_GEMM_DFALT_TENSOR_OP`|9.0| | | | | | | | | | | | | | | | -|`CUBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION`|11.0| | | | | | | | | | | | | | | | +|`CUBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION`|11.0| | | |`HIPBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION`|6.1.0| | | | | | | | | | | |`CUBLAS_OP_C`| | | | |`HIPBLAS_OP_C`|1.8.2| | | | |`rocblas_operation_conjugate_transpose`|1.5.0| | | | | |`CUBLAS_OP_CONJG`|10.1| | | | | | | | | | | | | | | | |`CUBLAS_OP_HERMITAN`|10.1| | | |`HIPBLAS_OP_C`|1.8.2| | | | |`rocblas_operation_conjugate_transpose`|1.5.0| | | | | |`CUBLAS_OP_N`| | | | |`HIPBLAS_OP_N`|1.8.2| | | | |`rocblas_operation_none`|1.5.0| | | | | |`CUBLAS_OP_T`| | | | |`HIPBLAS_OP_T`|1.8.2| | | | |`rocblas_operation_transpose`|1.5.0| | | | | -|`CUBLAS_PEDANTIC_MATH`|11.0| | | | | | | | | | | | | | | | +|`CUBLAS_PEDANTIC_MATH`|11.0| | | |`HIPBLAS_PEDANTIC_MATH`|6.1.0| | | | | | | | | | | |`CUBLAS_POINTER_MODE_DEVICE`| | | | |`HIPBLAS_POINTER_MODE_DEVICE`|1.8.2| | | | |`rocblas_pointer_mode_device`|1.6.0| | | | | |`CUBLAS_POINTER_MODE_HOST`| | | | |`HIPBLAS_POINTER_MODE_HOST`|1.8.2| | | | |`rocblas_pointer_mode_host`|1.6.0| | | | | |`CUBLAS_SIDE_LEFT`| | | | |`HIPBLAS_SIDE_LEFT`|1.8.2| | | | |`rocblas_side_left`|1.5.0| | | | | @@ -88,8 +88,8 @@ |`CUBLAS_STATUS_NOT_INITIALIZED`| | | | |`HIPBLAS_STATUS_NOT_INITIALIZED`|1.8.2| | | | |`rocblas_status_invalid_handle`|1.5.0| | | | | |`CUBLAS_STATUS_NOT_SUPPORTED`| | | | |`HIPBLAS_STATUS_NOT_SUPPORTED`|1.8.2| | | | |`rocblas_status_perf_degraded`|3.5.0| | | | | |`CUBLAS_STATUS_SUCCESS`| | | | |`HIPBLAS_STATUS_SUCCESS`|1.8.2| | | | |`rocblas_status_success`|1.5.0| | | | | -|`CUBLAS_TENSOR_OP_MATH`|9.0|11.0| | | | | | | | | | | | | | | -|`CUBLAS_TF32_TENSOR_OP_MATH`|11.0| | | | | | | | | |`rocblas_xf32_xdl_math_op`|5.7.0| | | | | +|`CUBLAS_TENSOR_OP_MATH`|9.0|11.0| | |`HIPBLAS_TENSOR_OP_MATH`|6.1.0| | | | | | | | | | | +|`CUBLAS_TF32_TENSOR_OP_MATH`|11.0| | | |`HIPBLAS_TF32_TENSOR_OP_MATH`|6.1.0| | | | | | | | | | | |`cublasAtomicsMode_t`| | | | |`hipblasAtomicsMode_t`|3.10.0| | | | |`rocblas_atomics_mode`|3.8.0| | | | | |`cublasComputeType_t`|11.0| | | |`hipblasComputeType_t`|6.0.0| | | | |`rocblas_computetype`|5.7.0| | | | | |`cublasContext`| | | | | | | | | | |`_rocblas_handle`|1.5.0| | | | | @@ -97,7 +97,7 @@ |`cublasFillMode_t`| | | | |`hipblasFillMode_t`|1.8.2| | | | |`rocblas_fill`|1.5.0| | | | | |`cublasGemmAlgo_t`|8.0| | | |`hipblasGemmAlgo_t`|1.8.2| | | | |`rocblas_gemm_algo`|1.8.2| | | | | |`cublasHandle_t`| | | | |`hipblasHandle_t`|3.0.0| | | | |`rocblas_handle`|1.5.0| | | | | -|`cublasMath_t`|9.0| | | | | | | | | |`rocblas_math_mode`|5.7.0| | | | | +|`cublasMath_t`|9.0| | | |`hipblasMath_t`|6.1.0| | | | |`rocblas_math_mode`|5.7.0| | | | | |`cublasOperation_t`| | | | |`hipblasOperation_t`|1.8.2| | | | |`rocblas_operation`|1.5.0| | | | | |`cublasPointerMode_t`| | | | |`hipblasPointerMode_t`|1.8.2| | | | |`rocblas_pointer_mode`|1.6.0| | | | | |`cublasSideMode_t`| | | | |`hipblasSideMode_t`|1.8.2| | | | |`rocblas_side`|1.5.0| | | | | @@ -156,7 +156,7 @@ |`cublasGetCudartVersion`|10.1| | | | | | | | | | | | | | | | |`cublasGetError`| | | | | | | | | | | | | | | | | |`cublasGetLoggerCallback`|9.2| | | | | | | | | | | | | | | | -|`cublasGetMathMode`|9.0| | | | | | | | | |`rocblas_get_math_mode`|5.7.0| | | | | +|`cublasGetMathMode`|9.0| | | |`hipblasGetMathMode`|6.1.0| | | | |`rocblas_get_math_mode`|5.7.0| | | | | |`cublasGetMatrix`| | | | |`hipblasGetMatrix`|1.8.2| | | | |`rocblas_get_matrix`|1.6.0| | | | | |`cublasGetMatrixAsync`| | | | |`hipblasGetMatrixAsync`|3.7.0| | | | |`rocblas_get_matrix_async`|3.5.0| | | | | |`cublasGetMatrixAsync_64`|12.0| | | | | | | | | | | | | | | | @@ -182,7 +182,7 @@ |`cublasSetAtomicsMode`| | | | |`hipblasSetAtomicsMode`|3.10.0| | | | |`rocblas_set_atomics_mode`|3.8.0| | | | | |`cublasSetKernelStream`| | | | | | | | | | | | | | | | | |`cublasSetLoggerCallback`|9.2| | | | | | | | | | | | | | | | -|`cublasSetMathMode`|9.0| | | | | | | | | |`rocblas_set_math_mode`|5.7.0| | | | | +|`cublasSetMathMode`|9.0| | | |`hipblasSetMathMode`|6.1.0| | | | |`rocblas_set_math_mode`|5.7.0| | | | | |`cublasSetMatrix`| | | | |`hipblasSetMatrix`|1.8.2| | | | |`rocblas_set_matrix`|1.6.0| | | | | |`cublasSetMatrixAsync`| | | | |`hipblasSetMatrixAsync`|3.7.0| | | | |`rocblas_set_matrix_async`|3.5.0| | | | | |`cublasSetMatrixAsync_64`|12.0| | | | | | | | | | | | | | | | diff --git a/docs/tables/CUBLAS_API_supported_by_ROC.md b/docs/tables/CUBLAS_API_supported_by_ROC.md index 4fdb8c00..962b49f9 100644 --- a/docs/tables/CUBLAS_API_supported_by_ROC.md +++ b/docs/tables/CUBLAS_API_supported_by_ROC.md @@ -89,7 +89,7 @@ |`CUBLAS_STATUS_NOT_SUPPORTED`| | | | |`rocblas_status_perf_degraded`|3.5.0| | | | | |`CUBLAS_STATUS_SUCCESS`| | | | |`rocblas_status_success`|1.5.0| | | | | |`CUBLAS_TENSOR_OP_MATH`|9.0|11.0| | | | | | | | | -|`CUBLAS_TF32_TENSOR_OP_MATH`|11.0| | | |`rocblas_xf32_xdl_math_op`|5.7.0| | | | | +|`CUBLAS_TF32_TENSOR_OP_MATH`|11.0| | | | | | | | | | |`cublasAtomicsMode_t`| | | | |`rocblas_atomics_mode`|3.8.0| | | | | |`cublasComputeType_t`|11.0| | | |`rocblas_computetype`|5.7.0| | | | | |`cublasContext`| | | | |`_rocblas_handle`|1.5.0| | | | | diff --git a/src/CUDA2HIP_BLAS_API_functions.cpp b/src/CUDA2HIP_BLAS_API_functions.cpp index ae4bc7e4..30c4a7c9 100644 --- a/src/CUDA2HIP_BLAS_API_functions.cpp +++ b/src/CUDA2HIP_BLAS_API_functions.cpp @@ -35,8 +35,8 @@ const std::map CUDA_BLAS_FUNCTION_MAP { {"cublasSetKernelStream", {"hipblasSetKernelStream", "", CONV_LIB_FUNC, API_BLAS, 4, UNSUPPORTED}}, {"cublasGetAtomicsMode", {"hipblasGetAtomicsMode", "rocblas_get_atomics_mode", CONV_LIB_FUNC, API_BLAS, 4}}, {"cublasSetAtomicsMode", {"hipblasSetAtomicsMode", "rocblas_set_atomics_mode", CONV_LIB_FUNC, API_BLAS, 4}}, - {"cublasGetMathMode", {"hipblasGetMathMode", "rocblas_get_math_mode", CONV_LIB_FUNC, API_BLAS, 4, HIP_UNSUPPORTED}}, - {"cublasSetMathMode", {"hipblasSetMathMode", "rocblas_set_math_mode", CONV_LIB_FUNC, API_BLAS, 4, HIP_UNSUPPORTED}}, + {"cublasGetMathMode", {"hipblasGetMathMode", "rocblas_get_math_mode", CONV_LIB_FUNC, API_BLAS, 4}}, + {"cublasSetMathMode", {"hipblasSetMathMode", "rocblas_set_math_mode", CONV_LIB_FUNC, API_BLAS, 4}}, {"cublasMigrateComputeType", {"hipblasMigrateComputeType", "", CONV_LIB_FUNC, API_BLAS, 4, UNSUPPORTED}}, {"cublasGetSmCountTarget", {"hipblasGetSmCountTarget", "", CONV_LIB_FUNC, API_BLAS, 4, UNSUPPORTED}}, {"cublasSetSmCountTarget", {"hipblasSetSmCountTarget", "", CONV_LIB_FUNC, API_BLAS, 4, UNSUPPORTED}}, @@ -1869,6 +1869,9 @@ const std::map HIP_BLAS_FUNCTION_VER_MAP { {"hipblasNrm2Ex_v2", {HIP_6000, HIP_0, HIP_0, }}, {"hipblasRotEx_v2", {HIP_6000, HIP_0, HIP_0, }}, {"hipblasScalEx_v2", {HIP_6000, HIP_0, HIP_0, }}, + {"hipblasSetMathMode", {HIP_6010, HIP_0, HIP_0, }}, + {"hipblasGetMathMode", {HIP_6010, HIP_0, HIP_0, }}, + {"rocblas_status_to_string", {HIP_3050, HIP_0, HIP_0 }}, {"rocblas_sscal", {HIP_1050, HIP_0, HIP_0 }}, {"rocblas_dscal", {HIP_1050, HIP_0, HIP_0 }}, diff --git a/src/CUDA2HIP_BLAS_API_types.cpp b/src/CUDA2HIP_BLAS_API_types.cpp index 8f3aae86..5a5f1f40 100644 --- a/src/CUDA2HIP_BLAS_API_types.cpp +++ b/src/CUDA2HIP_BLAS_API_types.cpp @@ -73,12 +73,12 @@ const std::map CUDA_BLAS_TYPE_NAME_MAP { {"CUBLAS_ATOMICS_ALLOWED", {"HIPBLAS_ATOMICS_ALLOWED", "rocblas_atomics_allowed", CONV_NUMERIC_LITERAL, API_BLAS, 2}}, // Blas Math mode/tensor operation - {"cublasMath_t", {"hipblasMath_t", "rocblas_math_mode", CONV_TYPE, API_BLAS, 2, HIP_UNSUPPORTED}}, - {"CUBLAS_DEFAULT_MATH", {"HIPBLAS_DEFAULT_MATH", "rocblas_default_math", CONV_NUMERIC_LITERAL, API_BLAS, 2, HIP_UNSUPPORTED}}, // 0 - {"CUBLAS_TENSOR_OP_MATH", {"HIPBLAS_TENSOR_OP_MATH", "", CONV_NUMERIC_LITERAL, API_BLAS, 2, UNSUPPORTED | CUDA_DEPRECATED}}, // 1 - {"CUBLAS_PEDANTIC_MATH", {"HIPBLAS_PEDANTIC_MATH", "", CONV_NUMERIC_LITERAL, API_BLAS, 2, UNSUPPORTED}}, // 2 - {"CUBLAS_TF32_TENSOR_OP_MATH", {"HIPBLAS_TF32_TENSOR_OP_MATH", "rocblas_xf32_xdl_math_op", CONV_NUMERIC_LITERAL, API_BLAS, 2, HIP_UNSUPPORTED}}, // 3 - {"CUBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION", {"HIPBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION", "", CONV_NUMERIC_LITERAL, API_BLAS, 2, UNSUPPORTED}}, // 16 + {"cublasMath_t", {"hipblasMath_t", "rocblas_math_mode", CONV_TYPE, API_BLAS, 2}}, + {"CUBLAS_DEFAULT_MATH", {"HIPBLAS_DEFAULT_MATH", "rocblas_default_math", CONV_NUMERIC_LITERAL, API_BLAS, 2}}, // 0 + {"CUBLAS_TENSOR_OP_MATH", {"HIPBLAS_TENSOR_OP_MATH", "", CONV_NUMERIC_LITERAL, API_BLAS, 2, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, // 1 + {"CUBLAS_PEDANTIC_MATH", {"HIPBLAS_PEDANTIC_MATH", "", CONV_NUMERIC_LITERAL, API_BLAS, 2, ROC_UNSUPPORTED}}, // 2 + {"CUBLAS_TF32_TENSOR_OP_MATH", {"HIPBLAS_TF32_TENSOR_OP_MATH", "", CONV_NUMERIC_LITERAL, API_BLAS, 2, ROC_UNSUPPORTED}}, // 3 + {"CUBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION", {"HIPBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION", "", CONV_NUMERIC_LITERAL, API_BLAS, 2, ROC_UNSUPPORTED}}, // 16 // Blass different GEMM algorithms {"cublasGemmAlgo_t", {"hipblasGemmAlgo_t", "rocblas_gemm_algo", CONV_TYPE, API_BLAS, 2}}, @@ -363,6 +363,13 @@ const std::map HIP_BLAS_TYPE_NAME_VER_MAP { {"HIPBLAS_COMPUTE_64F_PEDANTIC", {HIP_6000, HIP_0, HIP_0, }}, {"HIPBLAS_COMPUTE_32I", {HIP_6000, HIP_0, HIP_0, }}, {"HIPBLAS_COMPUTE_32I_PEDANTIC", {HIP_6000, HIP_0, HIP_0, }}, + {"hipblasMath_t", {HIP_6010, HIP_0, HIP_0, }}, + {"HIPBLAS_DEFAULT_MATH", {HIP_6010, HIP_0, HIP_0, }}, + {"HIPBLAS_TENSOR_OP_MATH", {HIP_6010, HIP_0, HIP_0, }}, + {"HIPBLAS_PEDANTIC_MATH", {HIP_6010, HIP_0, HIP_0, }}, + {"HIPBLAS_TF32_TENSOR_OP_MATH", {HIP_6010, HIP_0, HIP_0, }}, + {"HIPBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION",{HIP_6010, HIP_0, HIP_0, }}, + {"rocblas_handle", {HIP_1050, HIP_0, HIP_0 }}, {"_rocblas_handle", {HIP_1050, HIP_0, HIP_0 }}, {"rocblas_operation", {HIP_1050, HIP_0, HIP_0 }}, diff --git a/tests/unit_tests/synthetic/libraries/cublas2hipblas.cu b/tests/unit_tests/synthetic/libraries/cublas2hipblas.cu index 6fc849f0..25845dc1 100644 --- a/tests/unit_tests/synthetic/libraries/cublas2hipblas.cu +++ b/tests/unit_tests/synthetic/libraries/cublas2hipblas.cu @@ -1616,6 +1616,23 @@ int main() { // HIP: HIPBLAS_EXPORT hipblasStatus_t hipblasHgemmBatched(hipblasHandle_t handle, hipblasOperation_t transA, hipblasOperation_t transB, int m, int n, int k, const hipblasHalf* alpha, const hipblasHalf* const AP[], int lda, const hipblasHalf* const BP[], int ldb, const hipblasHalf* beta, hipblasHalf* const CP[], int ldc, int batchCount); // CHECK: blasStatus = hipblasHgemmBatched(blasHandle, transa, transb, m, n, k, ha, hAarray_const, lda, hBarray_const, ldb, hb, hCarray, ldc, batchCount); blasStatus = cublasHgemmBatched(blasHandle, transa, transb, m, n, k, ha, hAarray_const, lda, hBarray_const, ldb, hb, hCarray, ldc, batchCount); + + // CHECK: hipblasMath_t blasMath; + // CHECK-NEXT: hipblasMath_t BLAS_DEFAULT_MATH = HIPBLAS_DEFAULT_MATH; + // CHECK-NEXT: hipblasMath_t BLAS_TENSOR_OP_MATH = HIPBLAS_TENSOR_OP_MATH; + cublasMath_t blasMath; + cublasMath_t BLAS_DEFAULT_MATH = CUBLAS_DEFAULT_MATH; + cublasMath_t BLAS_TENSOR_OP_MATH = CUBLAS_TENSOR_OP_MATH; + + // CUDA: CUBLASAPI cublasStatus_t CUBLASWINAPI cublasGetMathMode(cublasHandle_t handle, cublasMath_t* mode); + // HIP: HIPBLAS_EXPORT hipblasStatus_t hipblasGetMathMode(hipblasHandle_t handle, hipblasMath_t* mode); + // CHECK: blasStatus = hipblasGetMathMode(blasHandle, &blasMath); + blasStatus = cublasGetMathMode(blasHandle, &blasMath); + + // CUDA: CUBLASAPI cublasStatus_t CUBLASWINAPI cublasSetMathMode(cublasHandle_t handle, cublasMath_t mode); + // HIP: HIPBLAS_EXPORT hipblasStatus_t hipblasSetMathMode(hipblasHandle_t handle, hipblasMath_t mode); + // CHECK: blasStatus = hipblasSetMathMode(blasHandle, blasMath); + blasStatus = cublasSetMathMode(blasHandle, blasMath); #endif #if CUDA_VERSION >= 9010 && CUDA_VERSION < 11000 @@ -1649,6 +1666,13 @@ int main() { cublasDataType_t R_16BF = CUDA_R_16BF; cublasDataType_t C_16BF = CUDA_C_16BF; + // CHECK: hipblasMath_t BLAS_PEDANTIC_MATH = HIPBLAS_PEDANTIC_MATH; + // CHECK-NEXT: hipblasMath_t BLAS_TF32_TENSOR_OP_MATH = HIPBLAS_TF32_TENSOR_OP_MATH; + // CHECK-NEXT: hipblasMath_t BLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION = HIPBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION; + cublasMath_t BLAS_PEDANTIC_MATH = CUBLAS_PEDANTIC_MATH; + cublasMath_t BLAS_TF32_TENSOR_OP_MATH = CUBLAS_TF32_TENSOR_OP_MATH; + cublasMath_t BLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION = CUBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION; + // CHECK: hip_bfloat16** bf16Aarray = 0; __nv_bfloat16** bf16Aarray = 0; // CHECK: const hip_bfloat16** const bf16Aarray_const = const_cast(bf16Aarray); diff --git a/tests/unit_tests/synthetic/libraries/cublas2rocblas.cu b/tests/unit_tests/synthetic/libraries/cublas2rocblas.cu index 26765adf..54abe2ed 100644 --- a/tests/unit_tests/synthetic/libraries/cublas2rocblas.cu +++ b/tests/unit_tests/synthetic/libraries/cublas2rocblas.cu @@ -1800,9 +1800,6 @@ int main() { // CHECK-NEXT: rocblas_computetype BLAS_COMPUTE_32F = rocblas_compute_type_f32; cublasComputeType_t blasComputeType; cublasComputeType_t BLAS_COMPUTE_32F = CUBLAS_COMPUTE_32F; - - // CHECK: rocblas_math_mode BLAS_TF32_TENSOR_OP_MATH = rocblas_xf32_xdl_math_op; - cublasMath_t BLAS_TF32_TENSOR_OP_MATH = CUBLAS_TF32_TENSOR_OP_MATH; #endif #if CUDA_VERSION >= 11040 && CUBLAS_VERSION >= 11600