diff --git a/.jenkins/multicompiler.groovy b/.jenkins/multicompiler.groovy index 6492a462e..b204265fe 100644 --- a/.jenkins/multicompiler.groovy +++ b/.jenkins/multicompiler.groovy @@ -98,6 +98,5 @@ ci: { String clangBuildCommand = './install.sh -c --compiler=clang++' setupCI(urlJobName, jobNameList, hostBuildCommand, runCI, 'g++') - setupCI(urlJobName, jobNameList, clangBuildCommand, runCI, 'clang++') setupCI(urlJobName, jobNameList, hipClangBuildCommand, runCI, 'hip-clang') } diff --git a/CMakeLists.txt b/CMakeLists.txt index 45f9201a1..595c35bcb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,10 @@ if( NOT DEFINED CMAKE_CONFIGURATION_TYPES AND NOT DEFINED CMAKE_BUILD_TYPE ) set( CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." ) endif() +if ( NOT DEFINED CMAKE_Fortran_COMPILER AND NOT DEFINED ENV{FC} ) + set( CMAKE_Fortran_COMPILER "gfortran" ) +endif() + project( hipblas LANGUAGES CXX Fortran ) # This finds the rocm-cmake project, and installs it if not found @@ -45,7 +49,7 @@ include( ROCMInstallTargets ) include( ROCMPackageConfigHelpers ) include( ROCMInstallSymlinks ) -set ( VERSION_STRING "0.36.0" ) +set ( VERSION_STRING "0.38.0" ) rocm_setup_version( VERSION ${VERSION_STRING} ) # Append our library helper cmake path and the cmake path for hip (for convenience) @@ -84,8 +88,8 @@ message("amdhip64: ${LIBAMDHIP64_LIBRARY}") # Quietly look for CUDA, but if not found it's not an error # The presense of hip is not sufficient to determine if we want a rocm or cuda backend -option(TRY_CUDA "Look for CUDA and use that as a backend if found" ON) -if(TRY_CUDA) +option(USE_CUDA "Look for CUDA and use that as a backend if found" ON) +if(USE_CUDA) find_package( CUDA QUIET ) endif() diff --git a/bump_develop_version.sh b/bump_develop_version.sh index 6db4c41cd..5f69afa8b 100755 --- a/bump_develop_version.sh +++ b/bump_develop_version.sh @@ -5,7 +5,7 @@ # - run this script in master branch # - after running this script merge master into develop -OLD_HIPBLAS_VERSION="0.36.0" -NEW_HIPBLAS_VERSION="0.37.0" +OLD_HIPBLAS_VERSION="0.38.0" +NEW_HIPBLAS_VERSION="0.39.0" sed -i "s/${OLD_HIPBLAS_VERSION}/${NEW_HIPBLAS_VERSION}/g" CMakeLists.txt diff --git a/bump_master_version.sh b/bump_master_version.sh index d0c7867f4..5ca2a8c70 100755 --- a/bump_master_version.sh +++ b/bump_master_version.sh @@ -6,7 +6,7 @@ # - after running this script and merging develop into master, run bump_develop_version.sh in master and # merge master into develop -OLD_HIPBLAS_VERSION="0.35.0" -NEW_HIPBLAS_VERSION="0.36.0" +OLD_HIPBLAS_VERSION="0.37.0" +NEW_HIPBLAS_VERSION="0.38.0" sed -i "s/${OLD_HIPBLAS_VERSION}/${NEW_HIPBLAS_VERSION}/g" CMakeLists.txt diff --git a/clients/gtest/CMakeLists.txt b/clients/gtest/CMakeLists.txt index e9d1902a0..c57b4bfd3 100644 --- a/clients/gtest/CMakeLists.txt +++ b/clients/gtest/CMakeLists.txt @@ -42,6 +42,7 @@ set(hipblas_test_source set_get_pointer_mode_gtest.cpp set_get_vector_gtest.cpp set_get_matrix_gtest.cpp + set_get_atomics_mode_gtest.cpp blas1_gtest.cpp gbmv_gtest.cpp gbmv_batched_gtest.cpp diff --git a/clients/gtest/blas1_gtest.cpp b/clients/gtest/blas1_gtest.cpp index 8d522462e..6e7d3dfdc 100644 --- a/clients/gtest/blas1_gtest.cpp +++ b/clients/gtest/blas1_gtest.cpp @@ -2356,11 +2356,11 @@ TEST_P(blas1_gtest, amin_strided_batched_float_complex) // so each elment in xxx_range is a avector, // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { N, {alpha, beta}, {incx, incy} } -INSTANTIATE_TEST_CASE_P(hipblasBlas1, - blas1_gtest, - Combine(ValuesIn(N_range), - ValuesIn(alpha_beta_range), - ValuesIn(incx_incy_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasBlas1, + blas1_gtest, + Combine(ValuesIn(N_range), + ValuesIn(alpha_beta_range), + ValuesIn(incx_incy_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/dgmm_gtest.cpp b/clients/gtest/dgmm_gtest.cpp index cfde463f8..a85b6f989 100644 --- a/clients/gtest/dgmm_gtest.cpp +++ b/clients/gtest/dgmm_gtest.cpp @@ -274,10 +274,10 @@ TEST_P(dgmm_gtest, dgmm_strided_batched_gtest_float_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M}, {incx,incy} {alpha, alphai, beta, betai}, {transA}, {stride_scale}, {batch_count} } -INSTANTIATE_TEST_CASE_P(hipblasDgmm, - dgmm_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(side_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasDgmm, + dgmm_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(side_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/gbmv_batched_gtest.cpp b/clients/gtest/gbmv_batched_gtest.cpp index 68de0ace5..2d6c8d793 100644 --- a/clients/gtest/gbmv_batched_gtest.cpp +++ b/clients/gtest/gbmv_batched_gtest.cpp @@ -191,11 +191,11 @@ TEST_P(gbmv_gtest_batched, gbmv_gtest_float_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha, beta}, {transA}, {batch_count} } -INSTANTIATE_TEST_CASE_P(hipblasGbmvBatched, - gbmv_gtest_batched, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGbmvBatched, + gbmv_gtest_batched, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/gbmv_gtest.cpp b/clients/gtest/gbmv_gtest.cpp index b6a8105a1..5dffebcb5 100644 --- a/clients/gtest/gbmv_gtest.cpp +++ b/clients/gtest/gbmv_gtest.cpp @@ -193,10 +193,10 @@ TEST_P(gbmv_gtest, gbmv_gtest_float_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha, beta}, {transA} } -INSTANTIATE_TEST_CASE_P(hipblasGbmv, - gbmv_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGbmv, + gbmv_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/gbmv_strided_batched_gtest.cpp b/clients/gtest/gbmv_strided_batched_gtest.cpp index 2447abb45..9e0e8906a 100644 --- a/clients/gtest/gbmv_strided_batched_gtest.cpp +++ b/clients/gtest/gbmv_strided_batched_gtest.cpp @@ -205,12 +205,12 @@ TEST_P(gbmv_gtest_strided_batched, gbmv_gtest_float_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {stride_scale}, {alpha, beta}, {transA}, {batch_count} } -INSTANTIATE_TEST_CASE_P(hipblasGbmvStridedBatched, - gbmv_gtest_strided_batched, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(stride_scale_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGbmvStridedBatched, + gbmv_gtest_strided_batched, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(stride_scale_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/geam_gtest.cpp b/clients/gtest/geam_gtest.cpp index c681be14b..994224b07 100644 --- a/clients/gtest/geam_gtest.cpp +++ b/clients/gtest/geam_gtest.cpp @@ -301,11 +301,11 @@ TEST_P(geam_gtest, geam_strided_batched_gtest_double_complex) // This function mainly test the scope of alpha_beta, transA_transB,.the scope of matrix_size_range // is small -INSTANTIATE_TEST_CASE_P(hipblasGeam_scalar_transpose, - geam_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGeam_scalar_transpose, + geam_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/gemm_batched_gtest.cpp b/clients/gtest/gemm_batched_gtest.cpp index d4f4f73fd..d4addc004 100644 --- a/clients/gtest/gemm_batched_gtest.cpp +++ b/clients/gtest/gemm_batched_gtest.cpp @@ -305,10 +305,10 @@ TEST_P(gemm_batched_gtest, hipblasDoubleComplex) // The combinations are { {M, N, K, lda, ldb, ldc}, {alpha, beta}, {transA, transB}, {batch_count} // } -INSTANTIATE_TEST_CASE_P(hipblasGemmBatched, - gemm_batched_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGemmBatched, + gemm_batched_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/gemm_ex_gtest.cpp b/clients/gtest/gemm_ex_gtest.cpp index 1a89a9abe..64f3ab5c2 100644 --- a/clients/gtest/gemm_ex_gtest.cpp +++ b/clients/gtest/gemm_ex_gtest.cpp @@ -530,166 +530,166 @@ class parameterized_half_gemm_ex : public ::TestWithParam // TEST(pre_checkin_blas_ex_bad_arg, float) { testing_gemm_ex_bad_arg(); } //----small -INSTANTIATE_TEST_CASE_P(quick_blas_ex_small_hpa_half, - parameterized_gemm_ex, - Combine(ValuesIn(small_matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(precision_hpa_half), - ValuesIn(batch_count_range_small), - ValuesIn(is_fortran))); - -INSTANTIATE_TEST_CASE_P(quick_blas_ex_small_half, - parameterized_gemm_ex, - Combine(ValuesIn(small_matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(precision_half), - ValuesIn(batch_count_range_small), - ValuesIn(is_fortran))); - -INSTANTIATE_TEST_CASE_P(quick_blas_ex_small_single, - parameterized_gemm_ex, - Combine(ValuesIn(small_matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(precision_single), - ValuesIn(batch_count_range_small), - ValuesIn(is_fortran))); - -INSTANTIATE_TEST_CASE_P(quick_blas_ex_small_double, - parameterized_gemm_ex, - Combine(ValuesIn(small_matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(precision_double), - ValuesIn(batch_count_range_small), - ValuesIn(is_fortran))); - -INSTANTIATE_TEST_CASE_P(quick_blas_ex_small_single_complex, - parameterized_gemm_ex, - Combine(ValuesIn(small_matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(precision_single_complex), - ValuesIn(batch_count_range_small), - ValuesIn(is_fortran))); - -INSTANTIATE_TEST_CASE_P(quick_blas_ex_small_double_complex, - parameterized_gemm_ex, - Combine(ValuesIn(small_matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(precision_double_complex), - ValuesIn(batch_count_range_small), - ValuesIn(is_fortran))); - -INSTANTIATE_TEST_CASE_P(quick_blas_ex_small_int8, - parameterized_gemm_ex, - Combine(ValuesIn(int8_matrix_size_range), - ValuesIn(alpha_beta_range_int8), - ValuesIn(transA_transB_range), - ValuesIn(precision_int8), - ValuesIn(batch_count_range_small), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(quick_blas_ex_small_hpa_half, + parameterized_gemm_ex, + Combine(ValuesIn(small_matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(precision_hpa_half), + ValuesIn(batch_count_range_small), + ValuesIn(is_fortran))); + +INSTANTIATE_TEST_SUITE_P(quick_blas_ex_small_half, + parameterized_gemm_ex, + Combine(ValuesIn(small_matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(precision_half), + ValuesIn(batch_count_range_small), + ValuesIn(is_fortran))); + +INSTANTIATE_TEST_SUITE_P(quick_blas_ex_small_single, + parameterized_gemm_ex, + Combine(ValuesIn(small_matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(precision_single), + ValuesIn(batch_count_range_small), + ValuesIn(is_fortran))); + +INSTANTIATE_TEST_SUITE_P(quick_blas_ex_small_double, + parameterized_gemm_ex, + Combine(ValuesIn(small_matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(precision_double), + ValuesIn(batch_count_range_small), + ValuesIn(is_fortran))); + +INSTANTIATE_TEST_SUITE_P(quick_blas_ex_small_single_complex, + parameterized_gemm_ex, + Combine(ValuesIn(small_matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(precision_single_complex), + ValuesIn(batch_count_range_small), + ValuesIn(is_fortran))); + +INSTANTIATE_TEST_SUITE_P(quick_blas_ex_small_double_complex, + parameterized_gemm_ex, + Combine(ValuesIn(small_matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(precision_double_complex), + ValuesIn(batch_count_range_small), + ValuesIn(is_fortran))); + +INSTANTIATE_TEST_SUITE_P(quick_blas_ex_small_int8, + parameterized_gemm_ex, + Combine(ValuesIn(int8_matrix_size_range), + ValuesIn(alpha_beta_range_int8), + ValuesIn(transA_transB_range), + ValuesIn(precision_int8), + ValuesIn(batch_count_range_small), + ValuesIn(is_fortran))); //----medium -INSTANTIATE_TEST_CASE_P(pre_checkin_blas_ex_medium_hpa_half, - parameterized_gemm_ex, - Combine(ValuesIn(medium_matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(precision_hpa_half), - ValuesIn(batch_count_range_small), - ValuesIn(is_fortran_false))); - -INSTANTIATE_TEST_CASE_P(pre_checkin_blas_ex_medium_half, - parameterized_gemm_ex, - Combine(ValuesIn(medium_matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(precision_half), - ValuesIn(batch_count_range_small), - ValuesIn(is_fortran_false))); - -INSTANTIATE_TEST_CASE_P(pre_checkin_blas_ex_medium_float, - parameterized_gemm_ex, - Combine(ValuesIn(medium_matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(precision_single), - ValuesIn(batch_count_range_small), - ValuesIn(is_fortran_false))); - -INSTANTIATE_TEST_CASE_P(pre_checkin_blas_ex_medium_double, - parameterized_gemm_ex, - Combine(ValuesIn(medium_matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(precision_double), - ValuesIn(batch_count_range_small), - ValuesIn(is_fortran_false))); +INSTANTIATE_TEST_SUITE_P(pre_checkin_blas_ex_medium_hpa_half, + parameterized_gemm_ex, + Combine(ValuesIn(medium_matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(precision_hpa_half), + ValuesIn(batch_count_range_small), + ValuesIn(is_fortran_false))); + +INSTANTIATE_TEST_SUITE_P(pre_checkin_blas_ex_medium_half, + parameterized_gemm_ex, + Combine(ValuesIn(medium_matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(precision_half), + ValuesIn(batch_count_range_small), + ValuesIn(is_fortran_false))); + +INSTANTIATE_TEST_SUITE_P(pre_checkin_blas_ex_medium_float, + parameterized_gemm_ex, + Combine(ValuesIn(medium_matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(precision_single), + ValuesIn(batch_count_range_small), + ValuesIn(is_fortran_false))); + +INSTANTIATE_TEST_SUITE_P(pre_checkin_blas_ex_medium_double, + parameterized_gemm_ex, + Combine(ValuesIn(medium_matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(precision_double), + ValuesIn(batch_count_range_small), + ValuesIn(is_fortran_false))); //----small-batched -INSTANTIATE_TEST_CASE_P(quick_blas_batched_ex_small_hpa_half, - parameterized_gemm_batched_ex, - Combine(ValuesIn(small_matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(precision_hpa_half), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); - -INSTANTIATE_TEST_CASE_P(quick_blas_batched_ex_small_half, - parameterized_gemm_batched_ex, - Combine(ValuesIn(small_matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(precision_half), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); - -INSTANTIATE_TEST_CASE_P(quick_blas_batched_ex_small_single, - parameterized_gemm_batched_ex, - Combine(ValuesIn(small_matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(precision_single), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); - -INSTANTIATE_TEST_CASE_P(quick_blas_batched_ex_small_double, - parameterized_gemm_batched_ex, - Combine(ValuesIn(small_matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(precision_double), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); - -INSTANTIATE_TEST_CASE_P(quick_blas_batched_ex_small_single_complex, - parameterized_gemm_batched_ex, - Combine(ValuesIn(small_matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(precision_single_complex), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); - -INSTANTIATE_TEST_CASE_P(quick_blas_batched_ex_small_double_complex, - parameterized_gemm_batched_ex, - Combine(ValuesIn(small_matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(precision_double_complex), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); - -INSTANTIATE_TEST_CASE_P(quick_blas_batched_ex_small_int8, - parameterized_gemm_batched_ex, - Combine(ValuesIn(int8_matrix_size_range), - ValuesIn(alpha_beta_range_int8), - ValuesIn(transA_transB_range), - ValuesIn(precision_int8), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(quick_blas_batched_ex_small_hpa_half, + parameterized_gemm_batched_ex, + Combine(ValuesIn(small_matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(precision_hpa_half), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); + +INSTANTIATE_TEST_SUITE_P(quick_blas_batched_ex_small_half, + parameterized_gemm_batched_ex, + Combine(ValuesIn(small_matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(precision_half), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); + +INSTANTIATE_TEST_SUITE_P(quick_blas_batched_ex_small_single, + parameterized_gemm_batched_ex, + Combine(ValuesIn(small_matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(precision_single), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); + +INSTANTIATE_TEST_SUITE_P(quick_blas_batched_ex_small_double, + parameterized_gemm_batched_ex, + Combine(ValuesIn(small_matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(precision_double), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); + +INSTANTIATE_TEST_SUITE_P(quick_blas_batched_ex_small_single_complex, + parameterized_gemm_batched_ex, + Combine(ValuesIn(small_matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(precision_single_complex), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); + +INSTANTIATE_TEST_SUITE_P(quick_blas_batched_ex_small_double_complex, + parameterized_gemm_batched_ex, + Combine(ValuesIn(small_matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(precision_double_complex), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); + +INSTANTIATE_TEST_SUITE_P(quick_blas_batched_ex_small_int8, + parameterized_gemm_batched_ex, + Combine(ValuesIn(int8_matrix_size_range), + ValuesIn(alpha_beta_range_int8), + ValuesIn(transA_transB_range), + ValuesIn(precision_int8), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/gemm_gtest.cpp b/clients/gtest/gemm_gtest.cpp index f8b1ffe46..0a08a3da3 100644 --- a/clients/gtest/gemm_gtest.cpp +++ b/clients/gtest/gemm_gtest.cpp @@ -268,9 +268,9 @@ TEST_P(gemm_gtest, gemm_gtest_double_complex) // THis function mainly test the scope of alpha_beta, transA_transB,.the scope of matrix_size_range // is small -INSTANTIATE_TEST_CASE_P(hipblasGemm_scalar_transpose, - gemm_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGemm_scalar_transpose, + gemm_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/gemm_strided_batched_gtest.cpp b/clients/gtest/gemm_strided_batched_gtest.cpp index 229027dd3..448654e29 100644 --- a/clients/gtest/gemm_strided_batched_gtest.cpp +++ b/clients/gtest/gemm_strided_batched_gtest.cpp @@ -298,10 +298,10 @@ TEST_P(gemm_strided_batched_gtest, hipblasDoubleComplex) // The combinations are { {M, N, K, lda, ldb, ldc}, {alpha, beta}, {transA, transB}, {batch_count} // } -INSTANTIATE_TEST_CASE_P(hipblasGemmStridedBatched, - gemm_strided_batched_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_transB_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGemmStridedBatched, + gemm_strided_batched_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_transB_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/gemv_batched_gtest.cpp b/clients/gtest/gemv_batched_gtest.cpp index 86fd89fe6..fe643ca8b 100644 --- a/clients/gtest/gemv_batched_gtest.cpp +++ b/clients/gtest/gemv_batched_gtest.cpp @@ -216,11 +216,11 @@ TEST_P(gemv_gtest_batched, gemv_gtest_float_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha, beta}, {transA}, {batch_count} } -INSTANTIATE_TEST_CASE_P(hipblasGemvBatched, - gemv_gtest_batched, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGemvBatched, + gemv_gtest_batched, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/gemv_gtest.cpp b/clients/gtest/gemv_gtest.cpp index 8a0e52c4f..bcb137490 100644 --- a/clients/gtest/gemv_gtest.cpp +++ b/clients/gtest/gemv_gtest.cpp @@ -215,10 +215,10 @@ TEST_P(gemv_gtest, gemv_gtest_float_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha, beta}, {transA} } -INSTANTIATE_TEST_CASE_P(hipblasGemv, - gemv_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGemv, + gemv_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/gemv_strided_batched_gtest.cpp b/clients/gtest/gemv_strided_batched_gtest.cpp index b59476793..e6f25ce7d 100644 --- a/clients/gtest/gemv_strided_batched_gtest.cpp +++ b/clients/gtest/gemv_strided_batched_gtest.cpp @@ -229,12 +229,12 @@ TEST_P(gemv_gtest_strided_batched, gemv_gtest_float_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {stride_scale}, {alpha, beta}, {transA}, {batch_count} } -INSTANTIATE_TEST_CASE_P(hipblasGemvStridedBatched, - gemv_gtest_strided_batched, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(stride_scale_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGemvStridedBatched, + gemv_gtest_strided_batched, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(stride_scale_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/geqrf_batched_gtest.cpp b/clients/gtest/geqrf_batched_gtest.cpp index cd2bca749..1ad6f81a4 100644 --- a/clients/gtest/geqrf_batched_gtest.cpp +++ b/clients/gtest/geqrf_batched_gtest.cpp @@ -151,9 +151,9 @@ TEST_P(geqrf_batched_gtest, geqrf_batched_gtest_double_complex) // ValuesIn takes each element (a vector), combines them, and feeds them to test_p // The combinations are { {M, N, lda, ldb}, stride_scale, batch_count } -INSTANTIATE_TEST_CASE_P(hipblasGeqrfBatched, - geqrf_batched_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGeqrfBatched, + geqrf_batched_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/geqrf_gtest.cpp b/clients/gtest/geqrf_gtest.cpp index bbcc9d741..4e2f1f386 100644 --- a/clients/gtest/geqrf_gtest.cpp +++ b/clients/gtest/geqrf_gtest.cpp @@ -151,9 +151,9 @@ TEST_P(geqrf_gtest, geqrf_gtest_double_complex) // ValuesIn takes each element (a vector), combines them, and feeds them to test_p // The combinations are { {M, N, lda, ldb}, stride_scale, batch_count } -INSTANTIATE_TEST_CASE_P(hipblasGeqrf, - geqrf_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGeqrf, + geqrf_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/geqrf_strided_batched_gtest.cpp b/clients/gtest/geqrf_strided_batched_gtest.cpp index 6a8fc0e44..2909fa57a 100644 --- a/clients/gtest/geqrf_strided_batched_gtest.cpp +++ b/clients/gtest/geqrf_strided_batched_gtest.cpp @@ -151,9 +151,9 @@ TEST_P(geqrf_strided_batched_gtest, geqrf_strided_batched_gtest_double_complex) // ValuesIn takes each element (a vector), combines them, and feeds them to test_p // The combinations are { {M, N, lda, ldb}, stride_scale, batch_count } -INSTANTIATE_TEST_CASE_P(hipblasGeqrfStridedBatched, - geqrf_strided_batched_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGeqrfStridedBatched, + geqrf_strided_batched_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/ger_gtest.cpp b/clients/gtest/ger_gtest.cpp index 78ef25c3e..73c233a1d 100644 --- a/clients/gtest/ger_gtest.cpp +++ b/clients/gtest/ger_gtest.cpp @@ -366,11 +366,11 @@ TEST_P(blas2_ger_gtest, gerc_strided_batched_gtest_float_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha} } -INSTANTIATE_TEST_CASE_P(hipblasGer, - blas2_ger_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGer, + blas2_ger_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/getrf_batched_gtest.cpp b/clients/gtest/getrf_batched_gtest.cpp index 284a4ca50..7ba72826d 100644 --- a/clients/gtest/getrf_batched_gtest.cpp +++ b/clients/gtest/getrf_batched_gtest.cpp @@ -154,9 +154,9 @@ TEST_P(getrf_batched_gtest, getrf_batched_gtest_double_complex) // ValuesIn takes each element (a vector), combines them, and feeds them to test_p // The combinations are { {M, N, lda, ldb}, stride_scale, batch_count } -INSTANTIATE_TEST_CASE_P(hipblasGetrfBatched, - getrf_batched_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGetrfBatched, + getrf_batched_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/getrf_gtest.cpp b/clients/gtest/getrf_gtest.cpp index fe99ca5e6..859f7597f 100644 --- a/clients/gtest/getrf_gtest.cpp +++ b/clients/gtest/getrf_gtest.cpp @@ -154,9 +154,9 @@ TEST_P(getrf_gtest, getrf_gtest_double_complex) // ValuesIn takes each element (a vector), combines them, and feeds them to test_p // The combinations are { {M, N, lda, ldb}, stride_scale, batch_count } -INSTANTIATE_TEST_CASE_P(hipblasGetrf, - getrf_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGetrf, + getrf_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/getrf_strided_batched_gtest.cpp b/clients/gtest/getrf_strided_batched_gtest.cpp index 30105f277..4fa71c8ac 100644 --- a/clients/gtest/getrf_strided_batched_gtest.cpp +++ b/clients/gtest/getrf_strided_batched_gtest.cpp @@ -154,9 +154,9 @@ TEST_P(getrf_strided_batched_gtest, getrf_strided_batched_gtest_double_complex) // ValuesIn takes each element (a vector), combines them, and feeds them to test_p // The combinations are { {M, N, lda, ldb}, stride_scale, batch_count } -INSTANTIATE_TEST_CASE_P(hipblasGetrfStridedBatched, - getrf_strided_batched_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGetrfStridedBatched, + getrf_strided_batched_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/getri_batched_gtest.cpp b/clients/gtest/getri_batched_gtest.cpp index 257546f08..d955debb1 100644 --- a/clients/gtest/getri_batched_gtest.cpp +++ b/clients/gtest/getri_batched_gtest.cpp @@ -149,9 +149,9 @@ TEST_P(getri_batched_gtest, getri_batched_gtest_double_complex) // ValuesIn takes each element (a vector), combines them, and feeds them to test_p // The combinations are { {M, N, lda, ldb}, stride_scale, batch_count } -INSTANTIATE_TEST_CASE_P(hipblasGetriBatched, - getri_batched_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGetriBatched, + getri_batched_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/getrs_batched_gtest.cpp b/clients/gtest/getrs_batched_gtest.cpp index e2910ec34..0ea0f5053 100644 --- a/clients/gtest/getrs_batched_gtest.cpp +++ b/clients/gtest/getrs_batched_gtest.cpp @@ -150,9 +150,9 @@ TEST_P(getrs_batched_gtest, getrs_batched_gtest_double_complex) // ValuesIn takes each element (a vector), combines them, and feeds them to test_p // The combinations are { {N, lda, ldb}, stride_scale, batch_count } -INSTANTIATE_TEST_CASE_P(hipblasGetrsBatched, - getrs_batched_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGetrsBatched, + getrs_batched_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/getrs_gtest.cpp b/clients/gtest/getrs_gtest.cpp index 5bc30725a..3e8d01b05 100644 --- a/clients/gtest/getrs_gtest.cpp +++ b/clients/gtest/getrs_gtest.cpp @@ -150,9 +150,9 @@ TEST_P(getrs_gtest, getrs_gtest_double_complex) // ValuesIn takes each element (a vector), combines them, and feeds them to test_p // The combinations are { {N, lda, ldb}, stride_scale, batch_count } -INSTANTIATE_TEST_CASE_P(hipblasGetrs, - getrs_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGetrs, + getrs_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/getrs_strided_batched_gtest.cpp b/clients/gtest/getrs_strided_batched_gtest.cpp index d1b13c535..aa972988c 100644 --- a/clients/gtest/getrs_strided_batched_gtest.cpp +++ b/clients/gtest/getrs_strided_batched_gtest.cpp @@ -150,9 +150,9 @@ TEST_P(getrs_strided_batched_gtest, getrs_strided_batched_gtest_double_complex) // ValuesIn takes each element (a vector), combines them, and feeds them to test_p // The combinations are { {N, lda, ldb}, stride_scale, batch_count } -INSTANTIATE_TEST_CASE_P(hipblasGetrsStridedBatched, - getrs_strided_batched_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasGetrsStridedBatched, + getrs_strided_batched_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/hbmv_gtest.cpp b/clients/gtest/hbmv_gtest.cpp index e586fa4f9..8c8fbd87b 100644 --- a/clients/gtest/hbmv_gtest.cpp +++ b/clients/gtest/hbmv_gtest.cpp @@ -213,12 +213,12 @@ TEST_P(hbmv_gtest, hbmv_gtest_strided_batched_float_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha, beta}, {transA} } -INSTANTIATE_TEST_CASE_P(hipblasHbmv, - hbmv_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasHbmv, + hbmv_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/hemm_gtest.cpp b/clients/gtest/hemm_gtest.cpp index 9714e0c51..a1f94b2bf 100644 --- a/clients/gtest/hemm_gtest.cpp +++ b/clients/gtest/hemm_gtest.cpp @@ -228,20 +228,20 @@ TEST_P(hemm_gtest, hemm_strided_batched_gtest_double_complex) // small // Testing order: side_uplo_xx first, alpha_beta_range second, full_matrix_size last // i.e fix the matrix size and alpha, test all the side_uplo_xx first. -INSTANTIATE_TEST_CASE_P(hipblashemm_matrix_size, - hemm_gtest, - Combine(ValuesIn(full_matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(side_uplo_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range))); +INSTANTIATE_TEST_SUITE_P(hipblashemm_matrix_size, + hemm_gtest, + Combine(ValuesIn(full_matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(side_uplo_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range))); // THis function mainly test the scope of full_side_uplo_range,.the scope of // matrix_size_range is small -INSTANTIATE_TEST_CASE_P(hipblashemm_scalar_transpose, - hemm_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(full_side_uplo_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range))); +INSTANTIATE_TEST_SUITE_P(hipblashemm_scalar_transpose, + hemm_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(full_side_uplo_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range))); diff --git a/clients/gtest/hemv_batched_gtest.cpp b/clients/gtest/hemv_batched_gtest.cpp index 3c9cf083f..efc80c068 100644 --- a/clients/gtest/hemv_batched_gtest.cpp +++ b/clients/gtest/hemv_batched_gtest.cpp @@ -167,11 +167,11 @@ TEST_P(hemv_gtest_batched, hemv_gtest_float_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha, beta}, {transA}, {batch_count} } -INSTANTIATE_TEST_CASE_P(hipblasHemvBatched, - hemv_gtest_batched, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasHemvBatched, + hemv_gtest_batched, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/hemv_gtest.cpp b/clients/gtest/hemv_gtest.cpp index 3084f5880..f721012fd 100644 --- a/clients/gtest/hemv_gtest.cpp +++ b/clients/gtest/hemv_gtest.cpp @@ -163,10 +163,10 @@ TEST_P(hemv_gtest, hemv_gtest_float_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha, beta}, {transA} } -INSTANTIATE_TEST_CASE_P(hipblasHemv, - hemv_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasHemv, + hemv_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/hemv_strided_batched_gtest.cpp b/clients/gtest/hemv_strided_batched_gtest.cpp index 8a4d3a95a..ee37b382f 100644 --- a/clients/gtest/hemv_strided_batched_gtest.cpp +++ b/clients/gtest/hemv_strided_batched_gtest.cpp @@ -179,12 +179,12 @@ TEST_P(hemv_gtest_strided_batched, hemv_gtest_float_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {stride_scale}, {alpha, beta}, {transA}, {batch_count} } -INSTANTIATE_TEST_CASE_P(hipblasHemvStridedBatched, - hemv_gtest_strided_batched, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(stride_scale_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasHemvStridedBatched, + hemv_gtest_strided_batched, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(stride_scale_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/her2_gtest.cpp b/clients/gtest/her2_gtest.cpp index 11695f2a0..000f13e73 100644 --- a/clients/gtest/her2_gtest.cpp +++ b/clients/gtest/her2_gtest.cpp @@ -281,12 +281,12 @@ TEST_P(blas2_her2_gtest, her2_strided_batched_gtest_double) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha} } -INSTANTIATE_TEST_CASE_P(hipblasHer2, - blas2_her2_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_range), - ValuesIn(uplo_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasHer2, + blas2_her2_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_range), + ValuesIn(uplo_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/her2k_gtest.cpp b/clients/gtest/her2k_gtest.cpp index 740a645d6..5bfb23f1e 100644 --- a/clients/gtest/her2k_gtest.cpp +++ b/clients/gtest/her2k_gtest.cpp @@ -302,12 +302,12 @@ TEST_P(blas2_her2k_gtest, her2k_strided_batched_gtest_double) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha} } -INSTANTIATE_TEST_CASE_P(hipblasHer2k, - blas2_her2k_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(uplo_range), - ValuesIn(transA_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasHer2k, + blas2_her2k_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(uplo_range), + ValuesIn(transA_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/her_gtest.cpp b/clients/gtest/her_gtest.cpp index eff46af1c..cc1a2ab65 100644 --- a/clients/gtest/her_gtest.cpp +++ b/clients/gtest/her_gtest.cpp @@ -279,12 +279,12 @@ TEST_P(blas2_her_gtest, her_strided_batched_gtest_double) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha} } -INSTANTIATE_TEST_CASE_P(hipblasHer, - blas2_her_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_range), - ValuesIn(uplo_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasHer, + blas2_her_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_range), + ValuesIn(uplo_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/herk_gtest.cpp b/clients/gtest/herk_gtest.cpp index 2fc24569d..d12f81a17 100644 --- a/clients/gtest/herk_gtest.cpp +++ b/clients/gtest/herk_gtest.cpp @@ -294,12 +294,12 @@ TEST_P(blas2_herk_gtest, herk_strided_batched_gtest_double) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha} } -INSTANTIATE_TEST_CASE_P(hipblasHerk, - blas2_herk_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(uplo_range), - ValuesIn(transA_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasHerk, + blas2_herk_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(uplo_range), + ValuesIn(transA_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/herkx_gtest.cpp b/clients/gtest/herkx_gtest.cpp index 71f871ca3..c4cc083fe 100644 --- a/clients/gtest/herkx_gtest.cpp +++ b/clients/gtest/herkx_gtest.cpp @@ -304,12 +304,12 @@ TEST_P(blas2_herkx_gtest, herkx_strided_batched_gtest_double) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha} } -INSTANTIATE_TEST_CASE_P(hipblasHerkx, - blas2_herkx_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(uplo_range), - ValuesIn(transA_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasHerkx, + blas2_herkx_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(uplo_range), + ValuesIn(transA_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/hpmv_gtest.cpp b/clients/gtest/hpmv_gtest.cpp index 5798977de..38b617c78 100644 --- a/clients/gtest/hpmv_gtest.cpp +++ b/clients/gtest/hpmv_gtest.cpp @@ -220,12 +220,12 @@ TEST_P(hpmv_gtest, hpmv_strided_batched_gtest_float_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M}, {incx,incy} {alpha, alphai, beta, betai}, {transA}, {stride_scale}, {batch_count} } -INSTANTIATE_TEST_CASE_P(hipblasHpmv, - hpmv_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_beta_range), - ValuesIn(transA_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasHpmv, + hpmv_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_beta_range), + ValuesIn(transA_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/hpr2_gtest.cpp b/clients/gtest/hpr2_gtest.cpp index 6c4798901..fbf601461 100644 --- a/clients/gtest/hpr2_gtest.cpp +++ b/clients/gtest/hpr2_gtest.cpp @@ -280,12 +280,12 @@ TEST_P(blas2_hpr2_gtest, hpr2_strided_batched_gtest_double) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha} } -INSTANTIATE_TEST_CASE_P(hipblasHpr2, - blas2_hpr2_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_range), - ValuesIn(uplo_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasHpr2, + blas2_hpr2_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_range), + ValuesIn(uplo_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/hpr_gtest.cpp b/clients/gtest/hpr_gtest.cpp index 22a9ef297..bdadae77e 100644 --- a/clients/gtest/hpr_gtest.cpp +++ b/clients/gtest/hpr_gtest.cpp @@ -261,12 +261,12 @@ TEST_P(blas2_hpr_gtest, hpr_strided_batched_gtest_double) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha} } -INSTANTIATE_TEST_CASE_P(hipblasHpr, - blas2_hpr_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_range), - ValuesIn(uplo_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasHpr, + blas2_hpr_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_range), + ValuesIn(uplo_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/sbmv_gtest.cpp b/clients/gtest/sbmv_gtest.cpp index 1d9d3deb3..d2908c30e 100644 --- a/clients/gtest/sbmv_gtest.cpp +++ b/clients/gtest/sbmv_gtest.cpp @@ -224,11 +224,11 @@ TEST_P(blas2_sbmv_gtest, sbmv_strided_batched_float) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} } -INSTANTIATE_TEST_CASE_P(hipblassbmv, - blas2_sbmv_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_beta_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblassbmv, + blas2_sbmv_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_beta_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/set_get_atomics_mode_gtest.cpp b/clients/gtest/set_get_atomics_mode_gtest.cpp new file mode 100644 index 000000000..442ced0e8 --- /dev/null +++ b/clients/gtest/set_get_atomics_mode_gtest.cpp @@ -0,0 +1,59 @@ +/* ************************************************************************ + * Copyright 2016-2020 Advanced Micro Devices, Inc. + * + * ************************************************************************ */ + +#include "testing_set_get_atomics_mode.hpp" +#include "utility.h" +#include +#include +#include +#include + +using ::testing::Combine; +using ::testing::TestWithParam; +using ::testing::Values; +using ::testing::ValuesIn; +using namespace std; + +// only GCC/VS 2010 comes with std::tr1::tuple, but it is unnecessary, std::tuple is good enough; + +typedef std::tuple set_get_atomics_mode_tuple; + +const bool is_fortran[] = {false, true}; + +/* ===============Google Unit Test==================================================== */ + +/* ===================================================================== + BLAS set_get_atomics_mode: +=================================================================== */ + +/* ============================Setup Arguments======================================= */ + +Arguments setup_set_get_atomics_mode_arguments(set_get_atomics_mode_tuple tup) +{ + Arguments arg; + arg.fortran = std::get<0>(tup); + return arg; +} + +class set_get_atomics_mode_gtest : public ::TestWithParam +{ +protected: + set_get_atomics_mode_gtest() {} + virtual ~set_get_atomics_mode_gtest() {} + virtual void SetUp() {} + virtual void TearDown() {} +}; + +TEST_P(set_get_atomics_mode_gtest, default) +{ + Arguments arg = setup_set_get_atomics_mode_arguments(GetParam()); + hipblasStatus_t status = testing_set_get_atomics_mode(arg); + + EXPECT_EQ(HIPBLAS_STATUS_SUCCESS, status); +} + +INSTANTIATE_TEST_SUITE_P(rocblas_auxiliary_small, + set_get_atomics_mode_gtest, + Combine(ValuesIn(is_fortran))); diff --git a/clients/gtest/set_get_matrix_gtest.cpp b/clients/gtest/set_get_matrix_gtest.cpp index f120fe78b..78eecdaf6 100644 --- a/clients/gtest/set_get_matrix_gtest.cpp +++ b/clients/gtest/set_get_matrix_gtest.cpp @@ -168,8 +168,8 @@ TEST_P(set_matrix_get_matrix_gtest, async_float) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha} } -INSTANTIATE_TEST_CASE_P(hipblasAuxiliary_small, - set_matrix_get_matrix_gtest, - Combine(ValuesIn(rows_cols_range), - ValuesIn(lda_ldb_ldc_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasAuxiliary_small, + set_matrix_get_matrix_gtest, + Combine(ValuesIn(rows_cols_range), + ValuesIn(lda_ldb_ldc_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/set_get_vector_gtest.cpp b/clients/gtest/set_get_vector_gtest.cpp index 2fdda1ccf..1b287c573 100644 --- a/clients/gtest/set_get_vector_gtest.cpp +++ b/clients/gtest/set_get_vector_gtest.cpp @@ -158,8 +158,8 @@ TEST_P(set_vector_get_vector_gtest, async_float) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha} } -INSTANTIATE_TEST_CASE_P(rocblas_auxiliary_small, - set_vector_get_vector_gtest, - Combine(ValuesIn(M_range), - ValuesIn(incx_incy_incd_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(rocblas_auxiliary_small, + set_vector_get_vector_gtest, + Combine(ValuesIn(M_range), + ValuesIn(incx_incy_incd_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/spmv_gtest.cpp b/clients/gtest/spmv_gtest.cpp index 24cd3ca35..f58cf3ac6 100644 --- a/clients/gtest/spmv_gtest.cpp +++ b/clients/gtest/spmv_gtest.cpp @@ -222,11 +222,11 @@ TEST_P(blas2_spmv_gtest, spmv_strided_batched_float) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M}, {incx,incy} } -INSTANTIATE_TEST_CASE_P(hipblasspmv, - blas2_spmv_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_beta_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasspmv, + blas2_spmv_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_beta_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/spr2_gtest.cpp b/clients/gtest/spr2_gtest.cpp index 91f98a742..b7ecb9e43 100644 --- a/clients/gtest/spr2_gtest.cpp +++ b/clients/gtest/spr2_gtest.cpp @@ -197,11 +197,11 @@ TEST_P(blas2_spr2_gtest, spr2_strided_batched_gtest_float) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha} } -INSTANTIATE_TEST_CASE_P(hipblasSpr2, - blas2_spr2_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasSpr2, + blas2_spr2_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/spr_gtest.cpp b/clients/gtest/spr_gtest.cpp index 0e580d8a4..6b1d75254 100644 --- a/clients/gtest/spr_gtest.cpp +++ b/clients/gtest/spr_gtest.cpp @@ -260,11 +260,11 @@ TEST_P(blas2_spr_gtest, spr_strided_batched_gtest_float_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {N}, {incx} {alpha} } -INSTANTIATE_TEST_CASE_P(hipblasSpr, - blas2_spr_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_range), - ValuesIn(alpha_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasSpr, + blas2_spr_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_range), + ValuesIn(alpha_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/symm_gtest.cpp b/clients/gtest/symm_gtest.cpp index 96eff9192..0c2044ac9 100644 --- a/clients/gtest/symm_gtest.cpp +++ b/clients/gtest/symm_gtest.cpp @@ -315,22 +315,22 @@ TEST_P(symm_gtest, symm_strided_batched_gtest_double_complex) // small // Testing order: side_uplo_xx first, alpha_beta_range second, full_matrix_size last // i.e fix the matrix size and alpha, test all the side_uplo_xx first. -INSTANTIATE_TEST_CASE_P(hipblassymm_matrix_size, - symm_gtest, - Combine(ValuesIn(full_matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(side_uplo_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblassymm_matrix_size, + symm_gtest, + Combine(ValuesIn(full_matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(side_uplo_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); // THis function mainly test the scope of full_side_uplo_range,.the scope of // matrix_size_range is small -INSTANTIATE_TEST_CASE_P(hipblassymm_scalar_transpose, - symm_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(full_side_uplo_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran_false))); +INSTANTIATE_TEST_SUITE_P(hipblassymm_scalar_transpose, + symm_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(full_side_uplo_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran_false))); diff --git a/clients/gtest/symv_gtest.cpp b/clients/gtest/symv_gtest.cpp index 38bc0d58f..0e26defc9 100644 --- a/clients/gtest/symv_gtest.cpp +++ b/clients/gtest/symv_gtest.cpp @@ -223,11 +223,11 @@ TEST_P(blas2_symv_gtest, symv_strided_batched_float) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} } -INSTANTIATE_TEST_CASE_P(hipblassymv, - blas2_symv_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_beta_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblassymv, + blas2_symv_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_beta_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/syr2_gtest.cpp b/clients/gtest/syr2_gtest.cpp index e0bb9b2d1..efea70685 100644 --- a/clients/gtest/syr2_gtest.cpp +++ b/clients/gtest/syr2_gtest.cpp @@ -273,11 +273,11 @@ TEST_P(blas2_syr2_gtest, syr2_strided_batched_gtest_float_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha} } -INSTANTIATE_TEST_CASE_P(hipblasSyr2, - blas2_syr2_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasSyr2, + blas2_syr2_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/syr2k_gtest.cpp b/clients/gtest/syr2k_gtest.cpp index b287d82de..3da0f738a 100644 --- a/clients/gtest/syr2k_gtest.cpp +++ b/clients/gtest/syr2k_gtest.cpp @@ -302,12 +302,12 @@ TEST_P(blas2_syrkx_gtest, syrkx_strided_batched_gtest_double_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha} } -INSTANTIATE_TEST_CASE_P(hipblasSyrkx, - blas2_syrkx_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(uplo_range), - ValuesIn(transA_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasSyrkx, + blas2_syrkx_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(uplo_range), + ValuesIn(transA_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/syr_gtest.cpp b/clients/gtest/syr_gtest.cpp index 17684b518..259c23b89 100644 --- a/clients/gtest/syr_gtest.cpp +++ b/clients/gtest/syr_gtest.cpp @@ -285,11 +285,11 @@ TEST_P(blas2_syr_gtest, syr_strided_batched_gtest_float_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha} } -INSTANTIATE_TEST_CASE_P(hipblasSyr, - blas2_syr_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(alpha_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasSyr, + blas2_syr_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(alpha_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/syrk_gtest.cpp b/clients/gtest/syrk_gtest.cpp index 133c772e8..34b1203b3 100644 --- a/clients/gtest/syrk_gtest.cpp +++ b/clients/gtest/syrk_gtest.cpp @@ -300,12 +300,12 @@ TEST_P(blas2_syrk_gtest, syrk_strided_batched_gtest_double_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha} } -INSTANTIATE_TEST_CASE_P(hipblasSyrk, - blas2_syrk_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(uplo_range), - ValuesIn(transA_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasSyrk, + blas2_syrk_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(uplo_range), + ValuesIn(transA_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/syrkx_gtest.cpp b/clients/gtest/syrkx_gtest.cpp index 50ddf7ef2..f171f94b0 100644 --- a/clients/gtest/syrkx_gtest.cpp +++ b/clients/gtest/syrkx_gtest.cpp @@ -302,12 +302,12 @@ TEST_P(blas2_syr2k_gtest, syr2k_strided_batched_gtest_double_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} {alpha} } -INSTANTIATE_TEST_CASE_P(hipblasSyr2k, - blas2_syr2k_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(alpha_beta_range), - ValuesIn(uplo_range), - ValuesIn(transA_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasSyr2k, + blas2_syr2k_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(alpha_beta_range), + ValuesIn(uplo_range), + ValuesIn(transA_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/tbmv_gtest.cpp b/clients/gtest/tbmv_gtest.cpp index c65dac657..f1a68aa4f 100644 --- a/clients/gtest/tbmv_gtest.cpp +++ b/clients/gtest/tbmv_gtest.cpp @@ -213,10 +213,10 @@ TEST_P(blas2_tbmv_gtest, tbmv_strided_batched_float) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} } -INSTANTIATE_TEST_CASE_P(hipblastbmv, - blas2_tbmv_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblastbmv, + blas2_tbmv_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/tbsv_gtest.cpp b/clients/gtest/tbsv_gtest.cpp index dc7738a0b..3b8969464 100644 --- a/clients/gtest/tbsv_gtest.cpp +++ b/clients/gtest/tbsv_gtest.cpp @@ -213,10 +213,10 @@ TEST_P(blas2_tbsv_gtest, tbsv_strided_batched_float) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} } -INSTANTIATE_TEST_CASE_P(hipblastbsv, - blas2_tbsv_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblastbsv, + blas2_tbsv_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/tpmv_gtest.cpp b/clients/gtest/tpmv_gtest.cpp index 75d674bd1..fe8aa9625 100644 --- a/clients/gtest/tpmv_gtest.cpp +++ b/clients/gtest/tpmv_gtest.cpp @@ -211,10 +211,10 @@ TEST_P(blas2_tpmv_gtest, tpmv_strided_batched_float) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M}, {incx,incy} } -INSTANTIATE_TEST_CASE_P(hipblastpmv, - blas2_tpmv_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblastpmv, + blas2_tpmv_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/tpsv_gtest.cpp b/clients/gtest/tpsv_gtest.cpp index 152fd7ffa..f5f4bb63d 100644 --- a/clients/gtest/tpsv_gtest.cpp +++ b/clients/gtest/tpsv_gtest.cpp @@ -239,11 +239,11 @@ TEST_P(blas2_tpsv_gtest, tpsv_strided_batched_double_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M}, {incx} {alpha} } -INSTANTIATE_TEST_CASE_P(hipblastpsv, - blas2_tpsv_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_range), - ValuesIn(alpha_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblastpsv, + blas2_tpsv_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_range), + ValuesIn(alpha_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/trmm_gtest.cpp b/clients/gtest/trmm_gtest.cpp index 286c12258..51e28222a 100644 --- a/clients/gtest/trmm_gtest.cpp +++ b/clients/gtest/trmm_gtest.cpp @@ -330,22 +330,22 @@ TEST_P(trmm_gtest, trmm_strided_batched_gtest_double_complex) // small // Testing order: side_uplo_transA_xx first, alpha_range second, full_matrix_size last // i.e fix the matrix size and alpha, test all the side_uplo_transA_xx first. -INSTANTIATE_TEST_CASE_P(hipblastrmm_matrix_size, - trmm_gtest, - Combine(ValuesIn(full_matrix_size_range), - ValuesIn(alpha_range), - ValuesIn(side_uplo_transA_diag_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblastrmm_matrix_size, + trmm_gtest, + Combine(ValuesIn(full_matrix_size_range), + ValuesIn(alpha_range), + ValuesIn(side_uplo_transA_diag_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); // THis function mainly test the scope of full_side_uplo_transA_diag_range,.the scope of // matrix_size_range is small -INSTANTIATE_TEST_CASE_P(hipblastrmm_scalar_transpose, - trmm_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(alpha_range), - ValuesIn(full_side_uplo_transA_diag_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran_false))); +INSTANTIATE_TEST_SUITE_P(hipblastrmm_scalar_transpose, + trmm_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(alpha_range), + ValuesIn(full_side_uplo_transA_diag_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran_false))); diff --git a/clients/gtest/trmv_gtest.cpp b/clients/gtest/trmv_gtest.cpp index cda7c594b..acfd6dca3 100644 --- a/clients/gtest/trmv_gtest.cpp +++ b/clients/gtest/trmv_gtest.cpp @@ -212,10 +212,10 @@ TEST_P(blas2_trmv_gtest, trmv_strided_batched_float) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} } -INSTANTIATE_TEST_CASE_P(hipblastrmv, - blas2_trmv_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblastrmv, + blas2_trmv_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/trsm_ex_gtest.cpp b/clients/gtest/trsm_ex_gtest.cpp index 2b27c2615..ddc505394 100644 --- a/clients/gtest/trsm_ex_gtest.cpp +++ b/clients/gtest/trsm_ex_gtest.cpp @@ -315,11 +315,11 @@ TEST_P(trsm_ex_gtest, trsm_strided_batched_ex_gtest_double_complex) // small // Testing order: side_uplo_transA_xx first, alpha_range second, full_matrix_size last // i.e fix the matrix size and alpha, test all the side_uplo_transA_xx first. -INSTANTIATE_TEST_CASE_P(hipblasTrsm_matrix_size, - trsm_ex_gtest, - Combine(ValuesIn(full_matrix_size_range), - ValuesIn(alpha_range), - ValuesIn(side_uplo_transA_diag_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasTrsm_matrix_size, + trsm_ex_gtest, + Combine(ValuesIn(full_matrix_size_range), + ValuesIn(alpha_range), + ValuesIn(side_uplo_transA_diag_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/trsm_gtest.cpp b/clients/gtest/trsm_gtest.cpp index 03accdf71..5d7423afb 100644 --- a/clients/gtest/trsm_gtest.cpp +++ b/clients/gtest/trsm_gtest.cpp @@ -335,22 +335,22 @@ TEST_P(trsm_gtest, trsm_strided_batched_gtest_double_complex) // small // Testing order: side_uplo_transA_xx first, alpha_range second, full_matrix_size last // i.e fix the matrix size and alpha, test all the side_uplo_transA_xx first. -INSTANTIATE_TEST_CASE_P(hipblasTrsm_matrix_size, - trsm_gtest, - Combine(ValuesIn(full_matrix_size_range), - ValuesIn(alpha_range), - ValuesIn(side_uplo_transA_diag_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasTrsm_matrix_size, + trsm_gtest, + Combine(ValuesIn(full_matrix_size_range), + ValuesIn(alpha_range), + ValuesIn(side_uplo_transA_diag_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); // THis function mainly test the scope of full_side_uplo_transA_diag_range,.the scope of // matrix_size_range is small -INSTANTIATE_TEST_CASE_P(hipblasTrsm_scalar_transpose, - trsm_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(alpha_range), - ValuesIn(full_side_uplo_transA_diag_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran_false))); +INSTANTIATE_TEST_SUITE_P(hipblasTrsm_scalar_transpose, + trsm_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(alpha_range), + ValuesIn(full_side_uplo_transA_diag_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran_false))); diff --git a/clients/gtest/trsv_gtest.cpp b/clients/gtest/trsv_gtest.cpp index daf1108ea..128cce76d 100644 --- a/clients/gtest/trsv_gtest.cpp +++ b/clients/gtest/trsv_gtest.cpp @@ -240,10 +240,10 @@ TEST_P(blas2_trsv_gtest, trsv_strided_batched_double_complex) // ValuesIn take each element (a vector) and combine them and feed them to test_p // The combinations are { {M, N, lda}, {incx,incy} } -INSTANTIATE_TEST_CASE_P(hipblastrsv, - blas2_trsv_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(incx_incy_range), - ValuesIn(stride_scale_range), - ValuesIn(batch_count_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblastrsv, + blas2_trsv_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(incx_incy_range), + ValuesIn(stride_scale_range), + ValuesIn(batch_count_range), + ValuesIn(is_fortran))); diff --git a/clients/gtest/trtri_gtest.cpp b/clients/gtest/trtri_gtest.cpp index 3f4655069..8b0f1466f 100644 --- a/clients/gtest/trtri_gtest.cpp +++ b/clients/gtest/trtri_gtest.cpp @@ -183,10 +183,10 @@ TEST_P(trtri_gtest, trtri_strided_batched_float) // The combinations are { {N, lda}, uplo, diag } // THis function mainly test the scope of matrix_size. -INSTANTIATE_TEST_CASE_P(hipblasTrtri, - trtri_gtest, - Combine(ValuesIn(matrix_size_range), - ValuesIn(uplo_range), - ValuesIn(diag_range), - ValuesIn(batch_range), - ValuesIn(is_fortran))); +INSTANTIATE_TEST_SUITE_P(hipblasTrtri, + trtri_gtest, + Combine(ValuesIn(matrix_size_range), + ValuesIn(uplo_range), + ValuesIn(diag_range), + ValuesIn(batch_range), + ValuesIn(is_fortran))); diff --git a/clients/include/hipblas_fortran.f90 b/clients/include/hipblas_fortran.f90 index 722167d16..8fabf078a 100644 --- a/clients/include/hipblas_fortran.f90 +++ b/clients/include/hipblas_fortran.f90 @@ -135,6 +135,30 @@ function hipblasGetMatrixAsyncFortran(rows, cols, elemSize, A, lda, B, ldb, stre res = hipblasGetMatrixAsync(rows, cols, elemSize, A, lda, B, ldb, stream) end function hipblasGetMatrixAsyncFortran + function hipblasSetAtomicsModeFortran(handle, atomics_mode) & + result(res) & + bind(c, name = 'hipblasSetAtomicsModeFortran') + use iso_c_binding + use hipblas_enums + implicit none + type(c_ptr), value :: handle + integer(kind(HIPBLAS_ATOMICS_ALLOWED)), value :: atomics_mode + integer(c_int) :: res + res = hipblasSetAtomicsMode(handle, atomics_mode) + end function hipblasSetAtomicsModeFortran + + function hipblasGetAtomicsModeFortran(handle, atomics_mode) & + result(res) & + bind(c, name = 'hipblasGetAtomicsModeFortran') + use iso_c_binding + use hipblas_enums + implicit none + type(c_ptr), value :: handle + type(c_ptr), value :: atomics_mode + integer(c_int) :: res + res = hipblasGetAtomicsMode(handle, atomics_mode) + end function hipblasGetAtomicsModeFortran + !--------! ! blas 1 ! !--------! diff --git a/clients/include/hipblas_fortran.hpp b/clients/include/hipblas_fortran.hpp index e7980cc74..f9a026c6c 100644 --- a/clients/include/hipblas_fortran.hpp +++ b/clients/include/hipblas_fortran.hpp @@ -39,6 +39,12 @@ hipblasStatus_t hipblasSetMatrixAsyncFortran( hipblasStatus_t hipblasGetMatrixAsyncFortran( int rows, int cols, int elemSize, const void* A, int lda, void* B, int ldb, hipStream_t stream); +hipblasStatus_t hipblasSetAtomicsModeFortran(hipblasHandle_t handle, + hipblasAtomicsMode_t atomics_mode); + +hipblasStatus_t hipblasGetAtomicsModeFortran(hipblasHandle_t handle, + hipblasAtomicsMode_t* atomics_mode); + /* ========== * L1 * ========== */ diff --git a/clients/include/testing_set_get_atomics_mode.hpp b/clients/include/testing_set_get_atomics_mode.hpp new file mode 100644 index 000000000..3a01db2f8 --- /dev/null +++ b/clients/include/testing_set_get_atomics_mode.hpp @@ -0,0 +1,70 @@ +/* ************************************************************************ + * Copyright 2016-2020 Advanced Micro Devices, Inc. + * + * ************************************************************************ */ + +#include +#include +#include +#include + +#include "cblas_interface.h" +#include "hipblas.hpp" +#include "hipblas_fortran.hpp" +#include "norm.h" +#include "unit.h" +#include "utility.h" + +using namespace std; + +/* ============================================================================================ */ + +hipblasStatus_t testing_set_get_atomics_mode(Arguments argus) +{ + bool FORTRAN = argus.fortran; + auto hipblasSetAtomicsModeFn = FORTRAN ? hipblasSetAtomicsModeFortran : hipblasSetAtomicsMode; + auto hipblasGetAtomicsModeFn = FORTRAN ? hipblasGetAtomicsModeFortran : hipblasGetAtomicsMode; + + hipblasStatus_t status = HIPBLAS_STATUS_SUCCESS; + hipblasStatus_t status_set = HIPBLAS_STATUS_SUCCESS; + hipblasStatus_t status_get = HIPBLAS_STATUS_SUCCESS; + + hipblasAtomicsMode_t mode; + hipblasHandle_t handle; + hipblasCreate(&handle); + + // Not checking default as rocBLAS defaults to allowed + // and cuBLAS defaults to not allowed. + // status = hipblasGetAtomicsModeFn(handle, &mode); + // if(status != HIPBLAS_STATUS_SUCCESS) + // { + // hipblasDestroy(handle); + // return status; + // } + + // EXPECT_EQ(HIPBLAS_ATOMICS_ALLOWED, mode); + + // Make sure set()/get() functions work + status_set = hipblasSetAtomicsModeFn(handle, HIPBLAS_ATOMICS_NOT_ALLOWED); + status_get = hipblasGetAtomicsModeFn(handle, &mode); + if(status_set != HIPBLAS_STATUS_SUCCESS || status_get != HIPBLAS_STATUS_SUCCESS) + { + hipblasDestroy(handle); + return status_set != HIPBLAS_STATUS_SUCCESS ? status_set : status_get; + } + + EXPECT_EQ(HIPBLAS_ATOMICS_NOT_ALLOWED, mode); + + status_set = hipblasSetAtomicsModeFn(handle, HIPBLAS_ATOMICS_ALLOWED); + status_get = hipblasGetAtomicsModeFn(handle, &mode); + if(status_set != HIPBLAS_STATUS_SUCCESS || status_get != HIPBLAS_STATUS_SUCCESS) + { + hipblasDestroy(handle); + return status_set != HIPBLAS_STATUS_SUCCESS ? status_set : status_get; + } + + EXPECT_EQ(HIPBLAS_ATOMICS_ALLOWED, mode); + + hipblasDestroy(handle); + return HIPBLAS_STATUS_SUCCESS; +} diff --git a/deps/external-gtest.cmake b/deps/external-gtest.cmake index 0962b8983..ffd2d1103 100644 --- a/deps/external-gtest.cmake +++ b/deps/external-gtest.cmake @@ -11,7 +11,7 @@ set( gtest_cmake_args -DCMAKE_INSTALL_PREFIX=${PREFIX_GTEST} ) append_cmake_cli_arguments( gtest_cmake_args gtest_cmake_args ) set( gtest_git_repository "https://github.com/google/googletest.git" CACHE STRING "URL to download gtest from" ) -set( gtest_git_tag "release-1.8.0" CACHE STRING "URL to download gtest from" ) +set( gtest_git_tag "release-1.10.0" CACHE STRING "URL to download gtest from" ) if( MSVC ) list( APPEND gtest_cmake_args -Dgtest_force_shared_crt=ON -DCMAKE_DEBUG_POSTFIX=d ) diff --git a/install.sh b/install.sh index a6e3a7628..3fa6f1eb6 100755 --- a/install.sh +++ b/install.sh @@ -17,7 +17,7 @@ function display_help() echo " [-n|--no-solver] build library without rocSOLVER dependency" echo " [-g|--debug] -DCMAKE_BUILD_TYPE=Debug (default is =Release)" echo " [-r]--relocatable] create a package to support relocatable ROCm" - echo " [--cuda] build library for cuda backend" + echo " [--cuda|--use-cuda] build library for cuda backend" echo " [--[no-]hip-clang] Whether to build library with hip-clang" echo " [--compiler] specify host compiler" echo " [-p|--cmakepp] addition to CMAKE_PREFIX_PATH" @@ -293,7 +293,7 @@ build_static=false # check if we have a modern version of getopt that can handle whitespace and long parameters getopt -T if [[ $? -eq 4 ]]; then - GETOPT_PARSE=$(getopt --name "${0}" --longoptions help,install,clients,no-solver,dependencies,debug,hip-clang,no-hip-clang,compiler:,cuda,static,cmakepp,relocatable:,rocm-dev:,rocblas:,rocblas-path:,custom-target: --options rhicndgp:v:b: -- "$@") + GETOPT_PARSE=$(getopt --name "${0}" --longoptions help,install,clients,no-solver,dependencies,debug,hip-clang,no-hip-clang,compiler:,cuda,use-cuda,static,cmakepp,relocatable:,rocm-dev:,rocblas:,rocblas-path:,custom-target: --options rhicndgp:v:b: -- "$@") else echo "Need a new version of getopt" exit 1 @@ -339,7 +339,7 @@ while true; do --compiler) compiler=${2} shift 2 ;; - --cuda) + --cuda|--use-cuda) build_cuda=true shift ;; --static) @@ -449,6 +449,11 @@ pushd . cmake_common_options="${cmake_common_options} -DCMAKE_BUILD_TYPE=Debug" fi + # cuda + if [[ "${build_cuda}" == false ]]; then + cmake_common_options="${cmake_common_options} -DUSE_CUDA=OFF" + fi + # clients if [[ "${build_clients}" == true ]]; then cmake_client_options="${cmake_client_options} -DBUILD_CLIENTS_SAMPLES=ON -DBUILD_CLIENTS_TESTS=ON" diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 371a9893a..e3eea37f8 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -83,7 +83,7 @@ set( HIPBLAS_CONFIG_DIR "\${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBD rocm_create_package( NAME ${package_name} DESCRIPTION "Radeon Open Compute BLAS marshalling library" - MAINTAINER "rocblas-maintainer@amd.com" + MAINTAINER "hipBLAS Maintainer " LDCONFIG LDCONFIG_DIR ${HIPBLAS_CONFIG_DIR} ) diff --git a/library/include/hipblas.h b/library/include/hipblas.h index 7782d5698..8fcce2ffe 100644 --- a/library/include/hipblas.h +++ b/library/include/hipblas.h @@ -226,6 +226,12 @@ typedef enum HIPBLAS_GEMM_DEFAULT = 160, } hipblasGemmAlgo_t; +typedef enum +{ + HIPBLAS_ATOMICS_NOT_ALLOWED = 0, + HIPBLAS_ATOMICS_ALLOWED = 1, +} hipblasAtomicsMode_t; + #ifdef __cplusplus extern "C" { #endif @@ -280,6 +286,12 @@ HIPBLAS_EXPORT hipblasStatus_t hipblasGetMatrixAsync(int rows, int ldb, hipStream_t stream); +HIPBLAS_EXPORT hipblasStatus_t hipblasSetAtomicsMode(hipblasHandle_t handle, + hipblasAtomicsMode_t atomics_mode); + +HIPBLAS_EXPORT hipblasStatus_t hipblasGetAtomicsMode(hipblasHandle_t handle, + hipblasAtomicsMode_t* atomics_mode); + // amax HIPBLAS_EXPORT hipblasStatus_t hipblasIsamax(hipblasHandle_t handle, int n, const float* x, int incx, int* result); diff --git a/library/src/hcc_detail/hipblas.cpp b/library/src/hcc_detail/hipblas.cpp index f00c5563b..8dd633d96 100644 --- a/library/src/hcc_detail/hipblas.cpp +++ b/library/src/hcc_detail/hipblas.cpp @@ -268,6 +268,30 @@ hipblasGemmAlgo_t RocblasGemmAlgoToHIPGemmAlgo(rocblas_gemm_algo algo) throw "Non existent GemmAlgo"; } +rocblas_atomics_mode HIPAtomicsModeToRocblasAtomicsMode(hipblasAtomicsMode_t mode) +{ + switch(mode) + { + case HIPBLAS_ATOMICS_NOT_ALLOWED: + return rocblas_atomics_not_allowed; + case HIPBLAS_ATOMICS_ALLOWED: + return rocblas_atomics_allowed; + } + throw "Non existent AtomicsMode"; +} + +hipblasAtomicsMode_t RocblasAtomicsModeToHIPAtomicsMode(rocblas_atomics_mode mode) +{ + switch(mode) + { + case rocblas_atomics_not_allowed: + return HIPBLAS_ATOMICS_NOT_ALLOWED; + case rocblas_atomics_allowed: + return HIPBLAS_ATOMICS_ALLOWED; + } + throw "Non existent AtomicsMode"; +} + hipblasStatus_t rocBLASStatusToHIPStatus(rocblas_status_ error) { switch(error) @@ -388,6 +412,19 @@ hipblasStatus_t hipblasGetMatrixAsync( rocblas_get_matrix_async(rows, cols, elemSize, A, lda, B, ldb, stream)); } +// atomics mode +hipblasStatus_t hipblasSetAtomicsMode(hipblasHandle_t handle, hipblasAtomicsMode_t atomics_mode) +{ + return rocBLASStatusToHIPStatus(rocblas_set_atomics_mode( + (rocblas_handle)handle, HIPAtomicsModeToRocblasAtomicsMode(atomics_mode))); +} + +hipblasStatus_t hipblasGetAtomicsMode(hipblasHandle_t handle, hipblasAtomicsMode_t* atomics_mode) +{ + return rocBLASStatusToHIPStatus( + rocblas_get_atomics_mode((rocblas_handle)handle, (rocblas_atomics_mode*)atomics_mode)); +} + // amax hipblasStatus_t hipblasIsamax(hipblasHandle_t handle, int n, const float* x, int incx, int* result) { diff --git a/library/src/hipblas_module.f90 b/library/src/hipblas_module.f90 index 8487d7799..f37c1fcb2 100644 --- a/library/src/hipblas_module.f90 +++ b/library/src/hipblas_module.f90 @@ -72,6 +72,11 @@ module hipblas_enums enumerator :: HIPBLAS_GEMM_DEFAULT = 100 end enum + enum, bind(c) + enumerator :: HIPBLAS_ATOMICS_NOT_ALLOWED = 0 + enumerator :: HIPBLAS_ATOMICS_ALLOWED = 1 + end enum + end module hipblas_enums module hipblas @@ -272,6 +277,31 @@ function hipblasGetMatrixAsync(rows, cols, elemSize, A, lda, B, ldb, stream) & end function hipblasGetMatrixAsync end interface + ! atomics mode + interface + function hipblasSetAtomicsMode(handle, atomics_mode) & + result(c_int) & + bind(c, name = 'hipblasSetAtomicsMode') + use iso_c_binding + use hipblas_enums + implicit none + type(c_ptr), value :: handle + integer(kind(HIPBLAS_ATOMICS_ALLOWED)), value :: atomics_mode + end function hipblasSetAtomicsMode + end interface + + interface + function hipblasGetAtomicsMode(handle, atomics_mode) & + result(c_int) & + bind(c, name = 'hipblasGetAtomicsMode') + use iso_c_binding + use hipblas_enums + implicit none + type(c_ptr), value :: handle + type(c_ptr), value :: atomics_mode + end function hipblasGetAtomicsMode + end interface + !--------! ! blas 1 ! !--------! diff --git a/library/src/nvcc_detail/hipblas.cpp b/library/src/nvcc_detail/hipblas.cpp index 4832358ab..57e951c57 100644 --- a/library/src/nvcc_detail/hipblas.cpp +++ b/library/src/nvcc_detail/hipblas.cpp @@ -202,6 +202,30 @@ cublasGemmAlgo_t HIPGemmAlgoToCudaGemmAlgo(hipblasGemmAlgo_t algo) } } +cublasAtomicsMode_t HIPAtomicsModeToCudaAtomicsMode(hipblasAtomicsMode_t mode) +{ + switch(mode) + { + case HIPBLAS_ATOMICS_NOT_ALLOWED: + return CUBLAS_ATOMICS_NOT_ALLOWED; + case HIPBLAS_ATOMICS_ALLOWED: + return CUBLAS_ATOMICS_ALLOWED; + } + throw "Non existent AtomicsMode"; +} + +hipblasAtomicsMode_t CudaAtomicsModeToHIPAtomicsMode(cublasAtomicsMode_t mode) +{ + switch(mode) + { + case CUBLAS_ATOMICS_NOT_ALLOWED: + return HIPBLAS_ATOMICS_NOT_ALLOWED; + case CUBLAS_ATOMICS_ALLOWED: + return HIPBLAS_ATOMICS_ALLOWED; + } + throw "Non existent AtomicsMode"; +} + hipblasStatus_t hipCUBLASStatusToHIPStatus(cublasStatus_t cuStatus) { switch(cuStatus) @@ -318,6 +342,19 @@ hipblasStatus_t hipblasGetMatrixAsync( cublasGetMatrixAsync(rows, cols, elemSize, A, lda, B, ldb, stream)); } +// atomics mode +hipblasStatus_t hipblasSetAtomicsMode(hipblasHandle_t handle, hipblasAtomicsMode_t atomics_mode) +{ + return hipCUBLASStatusToHIPStatus(cublasSetAtomicsMode( + (cublasHandle_t)handle, HIPAtomicsModeToCudaAtomicsMode(atomics_mode))); +} + +hipblasStatus_t hipblasGetAtomicsMode(hipblasHandle_t handle, hipblasAtomicsMode_t* atomics_mode) +{ + return hipCUBLASStatusToHIPStatus( + cublasGetAtomicsMode((cublasHandle_t)handle, (cublasAtomicsMode_t*)atomics_mode)); +} + // amax hipblasStatus_t hipblasIsamax(hipblasHandle_t handle, int n, const float* x, int incx, int* result) {