/* ************************************************************************** * Copyright (C) 2021-2026 Advanced Micro Devices, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * *************************************************************************/ #pragma once #include "rocblas/rocblas.h" #include "rocsolver_arguments.hpp" #include #include // auxiliary #include "common/auxiliary/testing_bdsqr.hpp" #include "common/auxiliary/testing_bdsvdx.hpp" #include "common/auxiliary/testing_gecon.hpp" #include "common/auxiliary/testing_labrd.hpp" #include "common/auxiliary/testing_lacgv.hpp" #include "common/auxiliary/testing_lange.hpp" #include "common/auxiliary/testing_larf.hpp" #include "common/auxiliary/testing_larfb.hpp" #include "common/auxiliary/testing_larfg.hpp" #include "common/auxiliary/testing_larft.hpp" #include "common/auxiliary/testing_lasr.hpp" #include "common/auxiliary/testing_laswp.hpp" #include "common/auxiliary/testing_lasyf.hpp" #include "common/auxiliary/testing_latrd.hpp" #include "common/auxiliary/testing_latrd_forsytrd.hpp" #include "common/auxiliary/testing_lauum.hpp" #include "common/auxiliary/testing_orgbr_ungbr.hpp" #include "common/auxiliary/testing_orglx_unglx.hpp" #include "common/auxiliary/testing_orgtr_ungtr.hpp" #include "common/auxiliary/testing_orgxl_ungxl.hpp" #include "common/auxiliary/testing_orgxr_ungxr.hpp" #include "common/auxiliary/testing_ormbr_unmbr.hpp" #include "common/auxiliary/testing_ormlx_unmlx.hpp" #include "common/auxiliary/testing_ormtr_unmtr.hpp" #include "common/auxiliary/testing_ormxl_unmxl.hpp" #include "common/auxiliary/testing_ormxr_unmxr.hpp" #include "common/auxiliary/testing_stebz.hpp" #include "common/auxiliary/testing_stedc.hpp" #include "common/auxiliary/testing_stedcj.hpp" #include "common/auxiliary/testing_stedcx.hpp" #include "common/auxiliary/testing_stein.hpp" #include "common/auxiliary/testing_steqr.hpp" #include "common/auxiliary/testing_sterf.hpp" // lapack #include "common/lapack/testing_gebd2_gebrd.hpp" #include "common/lapack/testing_geblttrf_npvt.hpp" #include "common/lapack/testing_geblttrs_npvt.hpp" #include "common/lapack/testing_gelq2_gelqf.hpp" #include "common/lapack/testing_gels.hpp" #include "common/lapack/testing_geql2_geqlf.hpp" #include "common/lapack/testing_geqr2_geqrf.hpp" #include "common/lapack/testing_gerq2_gerqf.hpp" #include "common/lapack/testing_gesdd.hpp" #include "common/lapack/testing_gesv.hpp" #include "common/lapack/testing_gesvd.hpp" #include "common/lapack/testing_gesvdj.hpp" #include "common/lapack/testing_gesvdx.hpp" #include "common/lapack/testing_getf2_getrf.hpp" #include "common/lapack/testing_getf2_getrf_npvt.hpp" #include "common/lapack/testing_getri.hpp" #include "common/lapack/testing_getri_npvt.hpp" #include "common/lapack/testing_getri_npvt_outofplace.hpp" #include "common/lapack/testing_getri_outofplace.hpp" #include "common/lapack/testing_getrs.hpp" #include "common/lapack/testing_getrs_npvt.hpp" #include "common/lapack/testing_posv.hpp" #include "common/lapack/testing_potf2_potrf.hpp" #include "common/lapack/testing_potri.hpp" #include "common/lapack/testing_potrs.hpp" #include "common/lapack/testing_syev_heev.hpp" #include "common/lapack/testing_syevd_heevd.hpp" #include "common/lapack/testing_syevdj_heevdj.hpp" #include "common/lapack/testing_syevdx_heevdx.hpp" #include "common/lapack/testing_syevj_heevj.hpp" #include "common/lapack/testing_syevx_heevx.hpp" #include "common/lapack/testing_sygsx_hegsx.hpp" #include "common/lapack/testing_sygv_hegv.hpp" #include "common/lapack/testing_sygvd_hegvd.hpp" #include "common/lapack/testing_sygvdj_hegvdj.hpp" #include "common/lapack/testing_sygvdx_hegvdx.hpp" #include "common/lapack/testing_sygvj_hegvj.hpp" #include "common/lapack/testing_sygvx_hegvx.hpp" #include "common/lapack/testing_sytf2_sytrf.hpp" #include "common/lapack/testing_sytrs.hpp" #include "common/lapack/testing_sytrs2.hpp" #include "common/lapack/testing_sytxx_hetxx.hpp" #include "common/lapack/testing_trtri.hpp" // refactorization #include "common/refact/testing_csrrf_analysis.hpp" #include "common/refact/testing_csrrf_refactchol.hpp" #include "common/refact/testing_csrrf_refactlu.hpp" #include "common/refact/testing_csrrf_solve.hpp" #include "common/refact/testing_csrrf_splitlu.hpp" #include "common/refact/testing_csrrf_sumlu.hpp" // unit #include "common/unit/testing_gemm.hpp" struct str_less { bool operator()(const char* a, const char* b) const { return strcmp(a, b) < 0; } }; // Map from const char* to function taking const Arguments& using comparison above using func_map = std::map; // Function dispatcher for rocSOLVER tests class rocsolver_dispatcher { template static rocblas_status run_function(const char* name, Arguments& argus) { // Map for functions that support all precisions static const func_map map = { // auxiliaries {"laswp", testing_laswp}, {"lange", testing_lange}, {"lange_64", testing_lange}, {"gecon", testing_gecon}, {"gecon_64", testing_gecon}, {"larfg", testing_larfg}, {"larfg_64", testing_larfg}, {"larf", testing_larf}, {"larf_64", testing_larf}, {"larft", testing_larft}, {"larfb", testing_larfb}, {"lasr", testing_lasr}, {"latrd", testing_latrd}, {"latrd_forsytrd", testing_latrd_forsytrd}, {"labrd", testing_labrd}, {"bdsqr", testing_bdsqr}, {"steqr", testing_steqr}, {"stedc", testing_stedc}, {"stedcj", testing_stedcj}, {"stedcx", testing_stedcx}, {"stein", testing_stein}, {"lasyf", testing_lasyf}, {"lauum", testing_lauum}, // potrf {"potf2", testing_potf2_potrf}, {"potf2_batched", testing_potf2_potrf}, {"potf2_strided_batched", testing_potf2_potrf}, {"potf2_64", testing_potf2_potrf}, {"potf2_batched_64", testing_potf2_potrf}, {"potf2_strided_batched_64", testing_potf2_potrf}, {"potrf", testing_potf2_potrf}, {"potrf_batched", testing_potf2_potrf}, {"potrf_strided_batched", testing_potf2_potrf}, {"potrf_64", testing_potf2_potrf}, {"potrf_batched_64", testing_potf2_potrf}, {"potrf_strided_batched_64", testing_potf2_potrf}, // potrs {"potrs", testing_potrs}, {"potrs_batched", testing_potrs}, {"potrs_strided_batched", testing_potrs}, {"potrs_64", testing_potrs}, {"potrs_batched_64", testing_potrs}, {"potrs_strided_batched_64", testing_potrs}, // posv {"posv", testing_posv}, {"posv_batched", testing_posv}, {"posv_strided_batched", testing_posv}, // potri {"potri", testing_potri}, {"potri_batched", testing_potri}, {"potri_strided_batched", testing_potri}, // getrf_npvt {"getf2_npvt", testing_getf2_getrf_npvt}, {"getf2_npvt_batched", testing_getf2_getrf_npvt}, {"getf2_npvt_strided_batched", testing_getf2_getrf_npvt}, {"getrf_npvt", testing_getf2_getrf_npvt}, {"getrf_npvt_batched", testing_getf2_getrf_npvt}, {"getrf_npvt_strided_batched", testing_getf2_getrf_npvt}, {"getf2_npvt_64", testing_getf2_getrf_npvt}, {"getf2_npvt_batched_64", testing_getf2_getrf_npvt}, {"getf2_npvt_strided_batched_64", testing_getf2_getrf_npvt}, // getrf {"getf2", testing_getf2_getrf}, {"getf2_batched", testing_getf2_getrf}, {"getf2_strided_batched", testing_getf2_getrf}, {"getrf", testing_getf2_getrf}, {"getrf_batched", testing_getf2_getrf}, {"getrf_strided_batched", testing_getf2_getrf}, {"getf2_64", testing_getf2_getrf}, {"getf2_batched_64", testing_getf2_getrf}, {"getf2_strided_batched_64", testing_getf2_getrf}, // geqrf {"geqr2", testing_geqr2_geqrf}, {"geqr2_batched", testing_geqr2_geqrf}, {"geqr2_strided_batched", testing_geqr2_geqrf}, {"geqr2_64", testing_geqr2_geqrf}, {"geqr2_batched_64", testing_geqr2_geqrf}, {"geqr2_strided_batched_64", testing_geqr2_geqrf}, {"geqrf", testing_geqr2_geqrf}, {"geqrf_batched", testing_geqr2_geqrf}, {"geqrf_strided_batched", testing_geqr2_geqrf}, {"geqrf_ptr_batched", testing_geqr2_geqrf}, {"geqrf_64", testing_geqr2_geqrf}, {"geqrf_batched_64", testing_geqr2_geqrf}, {"geqrf_strided_batched_64", testing_geqr2_geqrf}, {"geqrf_ptr_batched_64", testing_geqr2_geqrf}, // gerqf {"gerq2", testing_gerq2_gerqf}, {"gerq2_batched", testing_gerq2_gerqf}, {"gerq2_strided_batched", testing_gerq2_gerqf}, {"gerqf", testing_gerq2_gerqf}, {"gerqf_batched", testing_gerq2_gerqf}, {"gerqf_strided_batched", testing_gerq2_gerqf}, // geqlf {"geql2", testing_geql2_geqlf}, {"geql2_batched", testing_geql2_geqlf}, {"geql2_strided_batched", testing_geql2_geqlf}, {"geqlf", testing_geql2_geqlf}, {"geqlf_batched", testing_geql2_geqlf}, {"geqlf_strided_batched", testing_geql2_geqlf}, // gelqf {"gelq2", testing_gelq2_gelqf}, {"gelq2_batched", testing_gelq2_gelqf}, {"gelq2_strided_batched", testing_gelq2_gelqf}, {"gelqf", testing_gelq2_gelqf}, {"gelqf_batched", testing_gelq2_gelqf}, {"gelqf_strided_batched", testing_gelq2_gelqf}, // getrs {"getrs", testing_getrs}, {"getrs_batched", testing_getrs}, {"getrs_strided_batched", testing_getrs}, {"getrs_64", testing_getrs}, {"getrs_batched_64", testing_getrs}, {"getrs_strided_batched_64", testing_getrs}, // sytrs {"sytrs", testing_sytrs}, {"sytrs_batched", testing_sytrs}, {"sytrs_strided_batched", testing_sytrs}, {"sytrs_64", testing_sytrs}, {"sytrs_batched_64", testing_sytrs}, {"sytrs_strided_batched_64", testing_sytrs}, // sytrs2 {"sytrs2", testing_sytrs2}, {"sytrs2_batched", testing_sytrs2}, {"sytrs2_strided_batched", testing_sytrs2}, {"sytrs2_64", testing_sytrs2}, {"sytrs2_batched_64", testing_sytrs2}, {"sytrs2_strided_batched_64", testing_sytrs2}, // getrs_npvt {"getrs_npvt", testing_getrs_npvt}, {"getrs_npvt_batched", testing_getrs_npvt}, {"getrs_npvt_strided_batched", testing_getrs_npvt}, {"getrs_npvt_64", testing_getrs_npvt}, {"getrs_npvt_batched_64", testing_getrs_npvt}, {"getrs_npvt_strided_batched_64", testing_getrs_npvt}, // gesv {"gesv", testing_gesv}, {"gesv_batched", testing_gesv}, {"gesv_strided_batched", testing_gesv}, // gesvd {"gesvd", testing_gesvd}, {"gesvd_batched", testing_gesvd}, {"gesvd_strided_batched", testing_gesvd}, // gesdd {"gesdd", testing_gesdd}, {"gesdd_batched", testing_gesdd}, {"gesdd_strided_batched", testing_gesdd}, // gesvdj {"gesvdj", testing_gesvdj}, {"gesvdj_batched", testing_gesvdj}, {"gesvdj_strided_batched", testing_gesvdj}, // gesvdx {"gesvdx", testing_gesvdx}, {"gesvdx_batched", testing_gesvdx}, {"gesvdx_strided_batched", testing_gesvdx}, // trtri {"trtri", testing_trtri}, {"trtri_batched", testing_trtri}, {"trtri_strided_batched", testing_trtri}, // getri {"getri", testing_getri}, {"getri_batched", testing_getri}, {"getri_strided_batched", testing_getri}, // getri_npvt {"getri_npvt", testing_getri_npvt}, {"getri_npvt_batched", testing_getri_npvt}, {"getri_npvt_strided_batched", testing_getri_npvt}, // getri_outofplace {"getri_outofplace", testing_getri_outofplace}, {"getri_outofplace_batched", testing_getri_outofplace}, {"getri_outofplace_strided_batched", testing_getri_outofplace}, // getri_npvt_outofplace {"getri_npvt_outofplace", testing_getri_npvt_outofplace}, {"getri_npvt_outofplace_batched", testing_getri_npvt_outofplace}, {"getri_npvt_outofplace_strided_batched", testing_getri_npvt_outofplace}, // gels {"gels", testing_gels}, {"gels_batched", testing_gels}, {"gels_strided_batched", testing_gels}, // gebrd {"gebd2", testing_gebd2_gebrd}, {"gebd2_batched", testing_gebd2_gebrd}, {"gebd2_strided_batched", testing_gebd2_gebrd}, {"gebrd", testing_gebd2_gebrd}, {"gebrd_batched", testing_gebd2_gebrd}, {"gebrd_strided_batched", testing_gebd2_gebrd}, // sytrf {"sytf2", testing_sytf2_sytrf}, {"sytf2_batched", testing_sytf2_sytrf}, {"sytf2_strided_batched", testing_sytf2_sytrf}, {"sytrf", testing_sytf2_sytrf}, {"sytrf_batched", testing_sytf2_sytrf}, {"sytrf_strided_batched", testing_sytf2_sytrf}, // geblttrf_npvt {"geblttrf_npvt", testing_geblttrf_npvt}, {"geblttrf_npvt_batched", testing_geblttrf_npvt}, {"geblttrf_npvt_strided_batched", testing_geblttrf_npvt}, // geblttrs_npvt {"geblttrs_npvt", testing_geblttrs_npvt}, {"geblttrs_npvt_batched", testing_geblttrs_npvt}, {"geblttrs_npvt_strided_batched", testing_geblttrs_npvt}, // unit {"gemm", testing_gemm}, {"gemm_batched", testing_gemm}, {"gemm_strided_batched", testing_gemm}, {"gemm_64", testing_gemm}, {"gemm_batched_64", testing_gemm}, {"gemm_strided_batched_64", testing_gemm}, }; // Grab function from the map and execute auto match = map.find(name); if(match != map.end()) { match->second(argus); return rocblas_status_success; } else return rocblas_status_invalid_value; } template , int> = 0> static rocblas_status run_function_limited_precision(const char* name, Arguments& argus) { // Map for functions that support only single and double precisions static const func_map map_real = { // auxiliaries {"sterf", testing_sterf}, {"stebz", testing_stebz}, {"bdsvdx", testing_bdsvdx}, // orgxx {"org2r", testing_orgxr_ungxr}, {"orgqr", testing_orgxr_ungxr}, {"org2l", testing_orgxl_ungxl}, {"orgql", testing_orgxl_ungxl}, {"orgl2", testing_orglx_unglx}, {"orglq", testing_orglx_unglx}, {"orgbr", testing_orgbr_ungbr}, {"orgtr", testing_orgtr_ungtr}, // ormxx {"orm2r", testing_ormxr_unmxr}, {"ormqr", testing_ormxr_unmxr}, {"orm2l", testing_ormxl_unmxl}, {"ormql", testing_ormxl_unmxl}, {"orml2", testing_ormlx_unmlx}, {"ormlq", testing_ormlx_unmlx}, {"ormbr", testing_ormbr_unmbr}, {"ormtr", testing_ormtr_unmtr}, // sytrd {"sytd2", testing_sytxx_hetxx}, {"sytd2_batched", testing_sytxx_hetxx}, {"sytd2_strided_batched", testing_sytxx_hetxx}, {"sytrd", testing_sytxx_hetxx}, {"sytrd_batched", testing_sytxx_hetxx}, {"sytrd_strided_batched", testing_sytxx_hetxx}, // sygst {"sygs2", testing_sygsx_hegsx}, {"sygs2_batched", testing_sygsx_hegsx}, {"sygs2_strided_batched", testing_sygsx_hegsx}, {"sygst", testing_sygsx_hegsx}, {"sygst_batched", testing_sygsx_hegsx}, {"sygst_strided_batched", testing_sygsx_hegsx}, // syev {"syev", testing_syev_heev}, {"syev_batched", testing_syev_heev}, {"syev_strided_batched", testing_syev_heev}, {"syev_64", testing_syev_heev}, {"syev_batched_64", testing_syev_heev}, {"syev_strided_batched_64", testing_syev_heev}, // syevd {"syevd", testing_syevd_heevd}, {"syevd_batched", testing_syevd_heevd}, {"syevd_strided_batched", testing_syevd_heevd}, {"syevd_64", testing_syevd_heevd}, {"syevd_batched_64", testing_syevd_heevd}, {"syevd_strided_batched_64", testing_syevd_heevd}, // syevdj {"syevdj", testing_syevdj_heevdj}, {"syevdj_batched", testing_syevdj_heevdj}, {"syevdj_strided_batched", testing_syevdj_heevdj}, // syevj {"syevj", testing_syevj_heevj}, {"syevj_batched", testing_syevj_heevj}, {"syevj_strided_batched", testing_syevj_heevj}, // syevx {"syevx", testing_syevx_heevx}, {"syevx_batched", testing_syevx_heevx}, {"syevx_strided_batched", testing_syevx_heevx}, // syevdx {"syevdx", testing_syevdx_heevdx}, {"syevdx_batched", testing_syevdx_heevdx}, {"syevdx_strided_batched", testing_syevdx_heevdx}, // sygv {"sygv", testing_sygv_hegv}, {"sygv_batched", testing_sygv_hegv}, {"sygv_strided_batched", testing_sygv_hegv}, // sygvd {"sygvd", testing_sygvd_hegvd}, {"sygvd_batched", testing_sygvd_hegvd}, {"sygvd_strided_batched", testing_sygvd_hegvd}, // sygvdj {"sygvdj", testing_sygvdj_hegvdj}, {"sygvdj_batched", testing_sygvdj_hegvdj}, {"sygvdj_strided_batched", testing_sygvdj_hegvdj}, // sygvj {"sygvj", testing_sygvj_hegvj}, {"sygvj_batched", testing_sygvj_hegvj}, {"sygvj_strided_batched", testing_sygvj_hegvj}, // sygvx {"sygvx", testing_sygvx_hegvx}, {"sygvx_batched", testing_sygvx_hegvx}, {"sygvx_strided_batched", testing_sygvx_hegvx}, // sygvdx {"sygvdx", testing_sygvdx_hegvdx}, {"sygvdx_batched", testing_sygvdx_hegvdx}, {"sygvdx_strided_batched", testing_sygvdx_hegvdx}, // refactorization {"csrrf_analysis", testing_csrrf_analysis}, {"csrrf_sumlu", testing_csrrf_sumlu}, {"csrrf_splitlu", testing_csrrf_splitlu}, {"csrrf_refactlu", testing_csrrf_refactlu}, {"csrrf_refactchol", testing_csrrf_refactchol}, {"csrrf_solve", testing_csrrf_solve}, }; // Grab function from the map and execute auto match = map_real.find(name); if(match != map_real.end()) { match->second(argus); return rocblas_status_success; } else return rocblas_status_invalid_value; } template , int> = 0> static rocblas_status run_function_limited_precision(const char* name, Arguments& argus) { // Map for functions that support only single-complex and double-complex precisions static const func_map map_complex = { // auxiliaries {"lacgv", testing_lacgv}, {"lacgv_64", testing_lacgv}, // ungxx {"ung2r", testing_orgxr_ungxr}, {"ungqr", testing_orgxr_ungxr}, {"ung2l", testing_orgxl_ungxl}, {"ungql", testing_orgxl_ungxl}, {"ungl2", testing_orglx_unglx}, {"unglq", testing_orglx_unglx}, {"ungbr", testing_orgbr_ungbr}, {"ungtr", testing_orgtr_ungtr}, // unmxx {"unm2r", testing_ormxr_unmxr}, {"unmqr", testing_ormxr_unmxr}, {"unm2l", testing_ormxl_unmxl}, {"unmql", testing_ormxl_unmxl}, {"unml2", testing_ormlx_unmlx}, {"unmlq", testing_ormlx_unmlx}, {"unmbr", testing_ormbr_unmbr}, {"unmtr", testing_ormtr_unmtr}, // hetrd {"hetd2", testing_sytxx_hetxx}, {"hetd2_batched", testing_sytxx_hetxx}, {"hetd2_strided_batched", testing_sytxx_hetxx}, {"hetrd", testing_sytxx_hetxx}, {"hetrd_batched", testing_sytxx_hetxx}, {"hetrd_strided_batched", testing_sytxx_hetxx}, // hegst {"hegs2", testing_sygsx_hegsx}, {"hegs2_batched", testing_sygsx_hegsx}, {"hegs2_strided_batched", testing_sygsx_hegsx}, {"hegst", testing_sygsx_hegsx}, {"hegst_batched", testing_sygsx_hegsx}, {"hegst_strided_batched", testing_sygsx_hegsx}, // heev {"heev", testing_syev_heev}, {"heev_batched", testing_syev_heev}, {"heev_strided_batched", testing_syev_heev}, {"heev_64", testing_syev_heev}, {"heev_batched_64", testing_syev_heev}, {"heev_strided_batched_64", testing_syev_heev}, // heevd {"heevd", testing_syevd_heevd}, {"heevd_batched", testing_syevd_heevd}, {"heevd_strided_batched", testing_syevd_heevd}, {"heevd_64", testing_syevd_heevd}, {"heevd_batched_64", testing_syevd_heevd}, {"heevd_strided_batched_64", testing_syevd_heevd}, // heevdj {"heevdj", testing_syevdj_heevdj}, {"heevdj_batched", testing_syevdj_heevdj}, {"heevdj_strided_batched", testing_syevdj_heevdj}, // heevj {"heevj", testing_syevj_heevj}, {"heevj_batched", testing_syevj_heevj}, {"heevj_strided_batched", testing_syevj_heevj}, // heevx {"heevx", testing_syevx_heevx}, {"heevx_batched", testing_syevx_heevx}, {"heevx_strided_batched", testing_syevx_heevx}, // heevdx {"heevdx", testing_syevdx_heevdx}, {"heevdx_batched", testing_syevdx_heevdx}, {"heevdx_strided_batched", testing_syevdx_heevdx}, // hegv {"hegv", testing_sygv_hegv}, {"hegv_batched", testing_sygv_hegv}, {"hegv_strided_batched", testing_sygv_hegv}, // hegvd {"hegvd", testing_sygvd_hegvd}, {"hegvd_batched", testing_sygvd_hegvd}, {"hegvd_strided_batched", testing_sygvd_hegvd}, // hegvdj {"hegvdj", testing_sygvdj_hegvdj}, {"hegvdj_batched", testing_sygvdj_hegvdj}, {"hegvdj_strided_batched", testing_sygvdj_hegvdj}, // hegvj {"hegvj", testing_sygvj_hegvj}, {"hegvj_batched", testing_sygvj_hegvj}, {"hegvj_strided_batched", testing_sygvj_hegvj}, // hegvx {"hegvx", testing_sygvx_hegvx}, {"hegvx_batched", testing_sygvx_hegvx}, {"hegvx_strided_batched", testing_sygvx_hegvx}, // hegvdx {"hegvdx", testing_sygvdx_hegvdx}, {"hegvdx_batched", testing_sygvdx_hegvdx}, {"hegvdx_strided_batched", testing_sygvdx_hegvdx}, }; // Grab function from the map and execute auto match = map_complex.find(name); if(match != map_complex.end()) { match->second(argus); return rocblas_status_success; } else return rocblas_status_invalid_value; } public: static void invoke(const std::string& name, char precision, Arguments& argus) { rocblas_status status; if(precision == 's') status = run_function(name.c_str(), argus); else if(precision == 'd') status = run_function(name.c_str(), argus); else if(precision == 'c') status = run_function(name.c_str(), argus); else if(precision == 'z') status = run_function(name.c_str(), argus); else throw std::invalid_argument("Invalid value for --precision"); if(status == rocblas_status_invalid_value) { if(precision == 's') status = run_function_limited_precision(name.c_str(), argus); else if(precision == 'd') status = run_function_limited_precision(name.c_str(), argus); else if(precision == 'c') status = run_function_limited_precision(name.c_str(), argus); else if(precision == 'z') status = run_function_limited_precision(name.c_str(), argus); } if(status == rocblas_status_invalid_value) { std::string msg = "Invalid combination --function "; msg += name; msg += " --precision "; msg += precision; throw std::invalid_argument(msg); } } };