diff --git a/bin/hipify-perl b/bin/hipify-perl index 47ca9645..27754b9d 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -1080,6 +1080,7 @@ my %experimental_funcs = ( "cusolverEigType_t" => "6.1.0", "cusolverEigRange_t" => "6.1.0", "cusolverEigMode_t" => "6.1.0", + "cusolverDnZpotrsBatched" => "6.1.0", "cusolverDnZpotrs" => "6.1.0", "cusolverDnZpotrf_bufferSize" => "6.1.0", "cusolverDnZpotrfBatched" => "6.1.0", @@ -1088,6 +1089,7 @@ my %experimental_funcs = ( "cusolverDnZZgesv" => "6.1.0", "cusolverDnZZgels_bufferSize" => "6.1.0", "cusolverDnZZgels" => "6.1.0", + "cusolverDnSpotrsBatched" => "6.1.0", "cusolverDnSpotrs" => "6.1.0", "cusolverDnSpotrf_bufferSize" => "6.1.0", "cusolverDnSpotrfBatched" => "6.1.0", @@ -1102,6 +1104,7 @@ my %experimental_funcs = ( "cusolverDnSSgels" => "6.1.0", "cusolverDnHandle_t" => "6.1.0", "cusolverDnGetStream" => "6.1.0", + "cusolverDnDpotrsBatched" => "6.1.0", "cusolverDnDpotrs" => "6.1.0", "cusolverDnDpotrf_bufferSize" => "6.1.0", "cusolverDnDpotrfBatched" => "6.1.0", @@ -1115,6 +1118,7 @@ my %experimental_funcs = ( "cusolverDnDDgels_bufferSize" => "6.1.0", "cusolverDnDDgels" => "6.1.0", "cusolverDnCreate" => "6.1.0", + "cusolverDnCpotrsBatched" => "6.1.0", "cusolverDnCpotrs" => "6.1.0", "cusolverDnCpotrf_bufferSize" => "6.1.0", "cusolverDnCpotrfBatched" => "6.1.0", @@ -1286,6 +1290,7 @@ sub experimentalSubstitutions { subst("cusolverDnCpotrfBatched", "hipsolverDnCpotrfBatched", "library"); subst("cusolverDnCpotrf_bufferSize", "hipsolverDnCpotrf_bufferSize", "library"); subst("cusolverDnCpotrs", "hipsolverDnCpotrs", "library"); + subst("cusolverDnCpotrsBatched", "hipsolverDnCpotrsBatched", "library"); subst("cusolverDnCreate", "hipsolverDnCreate", "library"); subst("cusolverDnDDgels", "hipsolverDnDDgels", "library"); subst("cusolverDnDDgels_bufferSize", "hipsolverDnDDgels_bufferSize", "library"); @@ -1299,6 +1304,7 @@ sub experimentalSubstitutions { subst("cusolverDnDpotrfBatched", "hipsolverDnDpotrfBatched", "library"); subst("cusolverDnDpotrf_bufferSize", "hipsolverDnDpotrf_bufferSize", "library"); subst("cusolverDnDpotrs", "hipsolverDnDpotrs", "library"); + subst("cusolverDnDpotrsBatched", "hipsolverDnDpotrsBatched", "library"); subst("cusolverDnGetStream", "hipsolverGetStream", "library"); subst("cusolverDnSSgels", "hipsolverDnSSgels", "library"); subst("cusolverDnSSgels_bufferSize", "hipsolverDnSSgels_bufferSize", "library"); @@ -1312,6 +1318,7 @@ sub experimentalSubstitutions { subst("cusolverDnSpotrfBatched", "hipsolverDnSpotrfBatched", "library"); subst("cusolverDnSpotrf_bufferSize", "hipsolverDnSpotrf_bufferSize", "library"); subst("cusolverDnSpotrs", "hipsolverDnSpotrs", "library"); + subst("cusolverDnSpotrsBatched", "hipsolverDnSpotrsBatched", "library"); subst("cusolverDnZZgels", "hipsolverDnZZgels", "library"); subst("cusolverDnZZgels_bufferSize", "hipsolverDnZZgels_bufferSize", "library"); subst("cusolverDnZZgesv", "hipsolverDnZZgesv", "library"); @@ -1320,6 +1327,7 @@ sub experimentalSubstitutions { subst("cusolverDnZpotrfBatched", "hipsolverDnZpotrfBatched", "library"); subst("cusolverDnZpotrf_bufferSize", "hipsolverDnZpotrf_bufferSize", "library"); subst("cusolverDnZpotrs", "hipsolverDnZpotrs", "library"); + subst("cusolverDnZpotrsBatched", "hipsolverDnZpotrsBatched", "library"); subst("cusolverDnHandle_t", "hipsolverHandle_t", "type"); subst("cusolverEigMode_t", "hipsolverEigMode_t", "type"); subst("cusolverEigRange_t", "hipsolverEigRange_t", "type"); diff --git a/docs/tables/CUSOLVER_API_supported_by_HIP.md b/docs/tables/CUSOLVER_API_supported_by_HIP.md index bd2088bb..6ccfad3e 100644 --- a/docs/tables/CUSOLVER_API_supported_by_HIP.md +++ b/docs/tables/CUSOLVER_API_supported_by_HIP.md @@ -128,6 +128,7 @@ |`cusolverDnCpotrfBatched`|9.1| | | |`hipsolverDnCpotrfBatched`|5.1.0| | | |6.1.0| |`cusolverDnCpotrf_bufferSize`| | | | |`hipsolverDnCpotrf_bufferSize`|5.1.0| | | |6.1.0| |`cusolverDnCpotrs`| | | | |`hipsolverDnCpotrs`|5.1.0| | | |6.1.0| +|`cusolverDnCpotrsBatched`|9.1| | | |`hipsolverDnCpotrsBatched`|5.1.0| | | |6.1.0| |`cusolverDnCreate`| | | | |`hipsolverDnCreate`|5.1.0| | | |6.1.0| |`cusolverDnCreateParams`|11.0| | | | | | | | | | |`cusolverDnDBgels`|11.0| | | | | | | | | | @@ -158,6 +159,7 @@ |`cusolverDnDpotrfBatched`|9.1| | | |`hipsolverDnDpotrfBatched`|5.1.0| | | |6.1.0| |`cusolverDnDpotrf_bufferSize`| | | | |`hipsolverDnDpotrf_bufferSize`|5.1.0| | | |6.1.0| |`cusolverDnDpotrs`| | | | |`hipsolverDnDpotrs`|5.1.0| | | |6.1.0| +|`cusolverDnDpotrsBatched`|9.1| | | |`hipsolverDnDpotrsBatched`|5.1.0| | | |6.1.0| |`cusolverDnGetDeterministicMode`|12.2| | | | | | | | | | |`cusolverDnGetStream`| | | | |`hipsolverGetStream`|4.5.0| | | |6.1.0| |`cusolverDnIRSInfosCreate`|10.2| | | | | | | | | | @@ -210,6 +212,7 @@ |`cusolverDnSpotrfBatched`|9.1| | | |`hipsolverDnSpotrfBatched`|5.1.0| | | |6.1.0| |`cusolverDnSpotrf_bufferSize`| | | | |`hipsolverDnSpotrf_bufferSize`|5.1.0| | | |6.1.0| |`cusolverDnSpotrs`| | | | |`hipsolverDnSpotrs`|5.1.0| | | |6.1.0| +|`cusolverDnSpotrsBatched`|9.1| | | |`hipsolverDnSpotrsBatched`|5.1.0| | | |6.1.0| |`cusolverDnXgetrf`|11.1| | | | | | | | | | |`cusolverDnXgetrf_bufferSize`|11.1| | | | | | | | | | |`cusolverDnXgetrs`|11.1| | | | | | | | | | @@ -237,6 +240,7 @@ |`cusolverDnZpotrfBatched`|9.1| | | |`hipsolverDnZpotrfBatched`|5.1.0| | | |6.1.0| |`cusolverDnZpotrf_bufferSize`| | | | |`hipsolverDnZpotrf_bufferSize`|5.1.0| | | |6.1.0| |`cusolverDnZpotrs`| | | | |`hipsolverDnZpotrs`|5.1.0| | | |6.1.0| +|`cusolverDnZpotrsBatched`|9.1| | | |`hipsolverDnZpotrsBatched`|5.1.0| | | |6.1.0| \*A - Added; D - Deprecated; C - Changed; R - Removed; E - Experimental \ No newline at end of file diff --git a/docs/tables/CUSOLVER_API_supported_by_HIP_and_ROC.md b/docs/tables/CUSOLVER_API_supported_by_HIP_and_ROC.md index dca995ee..c6d94906 100644 --- a/docs/tables/CUSOLVER_API_supported_by_HIP_and_ROC.md +++ b/docs/tables/CUSOLVER_API_supported_by_HIP_and_ROC.md @@ -128,6 +128,7 @@ |`cusolverDnCpotrfBatched`|9.1| | | |`hipsolverDnCpotrfBatched`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnCpotrf_bufferSize`| | | | |`hipsolverDnCpotrf_bufferSize`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnCpotrs`| | | | |`hipsolverDnCpotrs`|5.1.0| | | |6.1.0| | | | | | | +|`cusolverDnCpotrsBatched`|9.1| | | |`hipsolverDnCpotrsBatched`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnCreate`| | | | |`hipsolverDnCreate`|5.1.0| | | |6.1.0|`rocblas_create_handle`| | | | | | |`cusolverDnCreateParams`|11.0| | | | | | | | | | | | | | | | |`cusolverDnDBgels`|11.0| | | | | | | | | | | | | | | | @@ -158,6 +159,7 @@ |`cusolverDnDpotrfBatched`|9.1| | | |`hipsolverDnDpotrfBatched`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnDpotrf_bufferSize`| | | | |`hipsolverDnDpotrf_bufferSize`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnDpotrs`| | | | |`hipsolverDnDpotrs`|5.1.0| | | |6.1.0| | | | | | | +|`cusolverDnDpotrsBatched`|9.1| | | |`hipsolverDnDpotrsBatched`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnGetDeterministicMode`|12.2| | | | | | | | | | | | | | | | |`cusolverDnGetStream`| | | | |`hipsolverGetStream`|4.5.0| | | |6.1.0|`rocblas_get_stream`| | | | | | |`cusolverDnIRSInfosCreate`|10.2| | | | | | | | | | | | | | | | @@ -210,6 +212,7 @@ |`cusolverDnSpotrfBatched`|9.1| | | |`hipsolverDnSpotrfBatched`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnSpotrf_bufferSize`| | | | |`hipsolverDnSpotrf_bufferSize`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnSpotrs`| | | | |`hipsolverDnSpotrs`|5.1.0| | | |6.1.0| | | | | | | +|`cusolverDnSpotrsBatched`|9.1| | | |`hipsolverDnSpotrsBatched`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnXgetrf`|11.1| | | | | | | | | | | | | | | | |`cusolverDnXgetrf_bufferSize`|11.1| | | | | | | | | | | | | | | | |`cusolverDnXgetrs`|11.1| | | | | | | | | | | | | | | | @@ -237,6 +240,7 @@ |`cusolverDnZpotrfBatched`|9.1| | | |`hipsolverDnZpotrfBatched`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnZpotrf_bufferSize`| | | | |`hipsolverDnZpotrf_bufferSize`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnZpotrs`| | | | |`hipsolverDnZpotrs`|5.1.0| | | |6.1.0| | | | | | | +|`cusolverDnZpotrsBatched`|9.1| | | |`hipsolverDnZpotrsBatched`|5.1.0| | | |6.1.0| | | | | | | \*A - Added; D - Deprecated; C - Changed; R - Removed; E - Experimental \ No newline at end of file diff --git a/docs/tables/CUSOLVER_API_supported_by_ROC.md b/docs/tables/CUSOLVER_API_supported_by_ROC.md index c2271e58..99bea75d 100644 --- a/docs/tables/CUSOLVER_API_supported_by_ROC.md +++ b/docs/tables/CUSOLVER_API_supported_by_ROC.md @@ -128,6 +128,7 @@ |`cusolverDnCpotrfBatched`|9.1| | | | | | | | | | |`cusolverDnCpotrf_bufferSize`| | | | | | | | | | | |`cusolverDnCpotrs`| | | | | | | | | | | +|`cusolverDnCpotrsBatched`|9.1| | | | | | | | | | |`cusolverDnCreate`| | | | |`rocblas_create_handle`| | | | | | |`cusolverDnCreateParams`|11.0| | | | | | | | | | |`cusolverDnDBgels`|11.0| | | | | | | | | | @@ -158,6 +159,7 @@ |`cusolverDnDpotrfBatched`|9.1| | | | | | | | | | |`cusolverDnDpotrf_bufferSize`| | | | | | | | | | | |`cusolverDnDpotrs`| | | | | | | | | | | +|`cusolverDnDpotrsBatched`|9.1| | | | | | | | | | |`cusolverDnGetDeterministicMode`|12.2| | | | | | | | | | |`cusolverDnGetStream`| | | | |`rocblas_get_stream`| | | | | | |`cusolverDnIRSInfosCreate`|10.2| | | | | | | | | | @@ -210,6 +212,7 @@ |`cusolverDnSpotrfBatched`|9.1| | | | | | | | | | |`cusolverDnSpotrf_bufferSize`| | | | | | | | | | | |`cusolverDnSpotrs`| | | | | | | | | | | +|`cusolverDnSpotrsBatched`|9.1| | | | | | | | | | |`cusolverDnXgetrf`|11.1| | | | | | | | | | |`cusolverDnXgetrf_bufferSize`|11.1| | | | | | | | | | |`cusolverDnXgetrs`|11.1| | | | | | | | | | @@ -237,6 +240,7 @@ |`cusolverDnZpotrfBatched`|9.1| | | | | | | | | | |`cusolverDnZpotrf_bufferSize`| | | | | | | | | | | |`cusolverDnZpotrs`| | | | | | | | | | | +|`cusolverDnZpotrsBatched`|9.1| | | | | | | | | | \*A - Added; D - Deprecated; C - Changed; R - Removed; E - Experimental \ No newline at end of file diff --git a/src/CUDA2HIP_SOLVER_API_functions.cpp b/src/CUDA2HIP_SOLVER_API_functions.cpp index 698e0322..dc405571 100644 --- a/src/CUDA2HIP_SOLVER_API_functions.cpp +++ b/src/CUDA2HIP_SOLVER_API_functions.cpp @@ -182,6 +182,11 @@ const std::map CUDA_SOLVER_FUNCTION_MAP { {"cusolverDnDpotrfBatched", {"hipsolverDnDpotrfBatched", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, {"cusolverDnCpotrfBatched", {"hipsolverDnCpotrfBatched", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, {"cusolverDnZpotrfBatched", {"hipsolverDnZpotrfBatched", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + // NOTE: rocsolver_(s|d|c|z)potrs_batched has a harness of rocblas_set_workspace, hipsolver(S|D|C|Z)potrsBatched_bufferSize, and hipsolverManageWorkspace + {"cusolverDnSpotrsBatched", {"hipsolverDnSpotrsBatched", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + {"cusolverDnDpotrsBatched", {"hipsolverDnDpotrsBatched", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + {"cusolverDnCpotrsBatched", {"hipsolverDnCpotrsBatched", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + {"cusolverDnZpotrsBatched", {"hipsolverDnZpotrsBatched", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, }; const std::map CUDA_SOLVER_FUNCTION_VER_MAP { @@ -292,6 +297,10 @@ const std::map CUDA_SOLVER_FUNCTION_VER_MAP { {"cusolverDnDpotrfBatched", {CUDA_91, CUDA_0, CUDA_0}}, {"cusolverDnCpotrfBatched", {CUDA_91, CUDA_0, CUDA_0}}, {"cusolverDnZpotrfBatched", {CUDA_91, CUDA_0, CUDA_0}}, + {"cusolverDnSpotrsBatched", {CUDA_91, CUDA_0, CUDA_0}}, + {"cusolverDnDpotrsBatched", {CUDA_91, CUDA_0, CUDA_0}}, + {"cusolverDnCpotrsBatched", {CUDA_91, CUDA_0, CUDA_0}}, + {"cusolverDnZpotrsBatched", {CUDA_91, CUDA_0, CUDA_0}}, }; const std::map HIP_SOLVER_FUNCTION_VER_MAP { @@ -337,6 +346,10 @@ const std::map HIP_SOLVER_FUNCTION_VER_MAP { {"hipsolverDnDpotrfBatched", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}}, {"hipsolverDnCpotrfBatched", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}}, {"hipsolverDnZpotrfBatched", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverDnSpotrsBatched", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverDnDpotrsBatched", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverDnCpotrsBatched", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverDnZpotrsBatched", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}}, {"rocsolver_spotrf", {HIP_3020, HIP_0, HIP_0, HIP_LATEST}}, {"rocsolver_dpotrf", {HIP_3020, HIP_0, HIP_0, HIP_LATEST}}, diff --git a/tests/unit_tests/synthetic/libraries/cusolver2hipsolver.cu b/tests/unit_tests/synthetic/libraries/cusolver2hipsolver.cu index 56e921fc..9802a6c9 100644 --- a/tests/unit_tests/synthetic/libraries/cusolver2hipsolver.cu +++ b/tests/unit_tests/synthetic/libraries/cusolver2hipsolver.cu @@ -31,7 +31,9 @@ int main() { size_t lwork_bytes = 0; float** fAarray = 0; + float** fBarray = 0; double** dAarray = 0; + double** dBarray = 0; // CHECK: hipDoubleComplex dComplexA, dComplexB, dComplexX, dComplexWorkspace; cuDoubleComplex dComplexA, dComplexB, dComplexX, dComplexWorkspace; @@ -40,10 +42,14 @@ int main() { cuComplex complexA, complexB, complexX, complexWorkspace; // CHECK: hipDoubleComplex** dcomplexAarray = 0; + // CHECK-NEXT: hipDoubleComplex** dcomplexBarray = 0; cuDoubleComplex** dcomplexAarray = 0; + cuDoubleComplex** dcomplexBarray = 0; // CHECK: hipComplex** complexAarray = 0; + // CHECK-NEXT: hipComplex** complexBarray = 0; cuComplex** complexAarray = 0; + cuComplex** complexBarray = 0; // CHECK: hipsolverHandle_t handle; cusolverDnHandle_t handle; @@ -236,6 +242,26 @@ int main() { // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverDnZpotrfBatched(hipsolverHandle_t handle, hipblasFillMode_t uplo, int n, hipDoubleComplex* A[], int lda, int* devInfo, int batch_count); // CHECK: status = hipsolverDnZpotrfBatched(handle, fillMode, n, dcomplexAarray, lda, &infoArray, batchSize); status = cusolverDnZpotrfBatched(handle, fillMode, n, dcomplexAarray, lda, &infoArray, batchSize); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverDnSpotrsBatched(cusolverDnHandle_t handle, cublasFillMode_t uplo, int n, int nrhs, float * A[], int lda, float * B[], int ldb, int * d_info, int batchSize); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverDnSpotrsBatched(hipsolverHandle_t handle, hipblasFillMode_t uplo, int n, int nrhs, float* A[], int lda, float* B[], int ldb, int* devInfo, int batch_count); + // CHECK: status = hipsolverDnSpotrsBatched(handle, fillMode, n, nrhs, fAarray, lda, fBarray, ldb, &infoArray, batchSize); + status = cusolverDnSpotrsBatched(handle, fillMode, n, nrhs, fAarray, lda, fBarray, ldb, &infoArray, batchSize); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverDnDpotrsBatched(cusolverDnHandle_t handle, cublasFillMode_t uplo, int n, int nrhs, double * A[], int lda, double * B[], int ldb, int * d_info, int batchSize); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverDnDpotrsBatched(hipsolverHandle_t handle, hipblasFillMode_t uplo, int n, int nrhs, double* A[], int lda, double* B[], int ldb, int* devInfo, int batch_count); + // CHECK: status = hipsolverDnDpotrsBatched(handle, fillMode, n, nrhs, dAarray, lda, dBarray, ldb, &infoArray, batchSize); + status = cusolverDnDpotrsBatched(handle, fillMode, n, nrhs, dAarray, lda, dBarray, ldb, &infoArray, batchSize); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverDnCpotrsBatched(cusolverDnHandle_t handle, cublasFillMode_t uplo, int n, int nrhs, cuComplex * A[], int lda, cuComplex * B[], int ldb, int * d_info, int batchSize); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverDnCpotrsBatched(hipsolverHandle_t handle, hipblasFillMode_t uplo, int n, int nrhs, hipFloatComplex* A[], int lda, hipFloatComplex* B[], int ldb, int* devInfo, int batch_count); + // CHECK: status = hipsolverDnCpotrsBatched(handle, fillMode, n, nrhs, complexAarray, lda, complexBarray, ldb, &infoArray, batchSize); + status = cusolverDnCpotrsBatched(handle, fillMode, n, nrhs, complexAarray, lda, complexBarray, ldb, &infoArray, batchSize); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverDnZpotrsBatched(cusolverDnHandle_t handle, cublasFillMode_t uplo, int n, int nrhs, cuDoubleComplex * A[], int lda, cuDoubleComplex * B[], int ldb, int * d_info, int batchSize); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverDnZpotrsBatched(hipsolverHandle_t handle, hipblasFillMode_t uplo, int n, int nrhs, hipDoubleComplex* A[], int lda, hipDoubleComplex* B[], int ldb, int* devInfo, int batch_count); + // CHECK: status = hipsolverDnZpotrsBatched(handle, fillMode, n, nrhs, dcomplexAarray, lda, dcomplexBarray, ldb, &infoArray, batchSize); + status = cusolverDnZpotrsBatched(handle, fillMode, n, nrhs, dcomplexAarray, lda, dcomplexBarray, ldb, &infoArray, batchSize); #endif #if CUDA_VERSION >= 10010