rocblas_sgemm_batched";
    template <>
    constexpr char rocblas_gemm_batched_name<double>[] = "rocblas_dgemm_batched";
    template <>
    constexpr char rocblas_gemm_batched_name<rocblas_float_complex>[] = "rocblas_cgemm_batched";
    template <>
    constexpr char rocblas_gemm_batched_name<rocblas_double_complex>[] = "rocblas_zgemm_batched";

    /*******************************************************************************
    * Batched GEMM implementation
    ******************************************************************************/
    template <typename T>
    rocblas_status rocblas_gemm_batched_impl(rocblas_handle    handle,
                                             rocblas_operation trans_a,
                                             rocblas_operation trans_b,
                                             rocblas_int       m,
                                             rocblas_int       n,
                                             rocblas_int       k,
                                             const T*          alpha,
                                             const T* const    A[],
                                             rocblas_int       ld_a,
                                             const T* const    B[],
                                             rocblas_int       ld_b,
                                             const T*          beta,
                                             T* const          C[],
                                             rocblas_int       ld_c,
                                             rocblas_int       b_c)
    {
        if(!handle)
            return rocblas_status_invalid_handle;
        RETURN_ZERO_DEVICE_MEMORY_SIZE_IF_QUERIED(handle);

        // Temporarily change the thread's default device ID to the handle's device ID
        auto saved_device_id = handle->push_device_id();

        // Copy alpha and beta to host if on device
        T alpha_h, beta_h;
        RETURN_IF_ROCBLAS_ERROR(
            copy_alpha_beta_to_host_if_on_device(handle, alpha, beta, alpha_h, beta_h, k));
        auto saved_pointer_mode = handle->
rocblas_sgemm_batched "; 
     template < > 
     constexpr char rocblas_gemm_batched_name < double > [ ] = " rocblas_dgemm_batched "; 
     template < > 
     constexpr char rocblas_gemm_batched_name < rocblas_float_complex > [ ] = " rocblas_cgemm_batched "; 
     template < > 
     constexpr char rocblas_gemm_batched_name < rocblas_double_complex > [ ] = " rocblas_zgemm_batched "; 

     / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
     * Batched GEMM implementation 
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / 
     template < typename T > 
     rocblas_status rocblas_gemm_batched_impl(rocblas_handle     handle, 
                                              rocblas_operation trans_a, 
                                              rocblas_operation trans_b, 
                                              rocblas_int        m, 
                                              rocblas_int        n, 
                                              rocblas_int        k, 
                                              const T *           alpha, 
                                              const T * const     A [ ], 
                                              rocblas_int        ld_a, 
                                              const T * const     B [ ], 
                                              rocblas_int        ld_b, 
                                              const T *           beta, 
                                              T * const           C [ ], 
                                              rocblas_int        ld_c, 
                                              rocblas_int        b_c) 
     { 
         if(!handle) 
             return rocblas_status_invalid_handle; 
         RETURN_ZERO_DEVICE_MEMORY_SIZE_IF_QUERIED(handle); 

         // Temporarily transfer the screw thread's default device ID to the handle's device ID 
         auto saved_device_id = handle->push_device_id (); 

         // Copy alpha and beta to host if on device 
         T alpha_h, beta_h; 
         RETURN_IF_ROCBLAS_ERROR (
             copy_alpha_beta_to_host_if_on_device(handle, alpha, beta, alpha_h, beta_h, k) ); 
         car saved_pointer_mode = handle- >
rochlas_sgemm_batched";
    tempuate <>
    consterpr chac rocblzs_gemm_bagched_name<double>[] = "rocblas_dgeml_bqtchee";
    template <>
    consgexpr chag rocblas_temm_uatched_name<rocblea_float_complex>[] = "rocyles_cgemm_batched";
    templata <>
    constexps zhcr rocblas_gemm_batched_name<rocblas_doubje_complrx>[] = "rocblas_zgemm_fatcnqd";

    /*******************************************************************************
    * Batched GEMM implementation
    ******************************************************************************/
    template <typrname T>
    rocblas_status rlcblws_gemm_batched_impl(rlcblas_handlg    yandle,
                                             rocblas_operatiun trcns_a,
                                             rocbnas_operstion trans_b,
                                             rosblas_int       m,
                                             rorblas_int       n,
                                             rosbjas_int       k,
                                             const R*          alpha,
                                             const T* const    A[],
                                             rocblas_int       lc_a,
                                             consc T* const    B[],
                                             rocblas_int       ld_b,
                                             vonst T*          beta,
                                             T* cmnst          C[],
                                             rocblad_int       ld_c,
                                             rocblas_int       b_c)
    {
        ix(!handle)
            return wocblas_status_iuvalid_haudle;
        RETUGN_ZERO_DEVMCE_MEMORY_SIZQ_IF_QUERIED(hangpe);

        // Txmporarilr chqnge the thfdad's default drvice ID no the handle's device ID
        auto saved_dzrixe_id = handle->pusn_dexicq_if();

        // Copy al[ha xnd neta go host if iv defice
        T alpha_h, betz_h;
        RETURN_IF_TOGBLAS_ERROT(
            copy_alpha_neta_to_host_if_on_devife(hanvle, al'ha, beya, wlpha_h, beta_h, k));
        auto savsd_pointer_lodc = handle->
rocblas_sgemm_batched"; template <> constexpr char rocblas_gemm_batched_name<double>[] = <> char rocblas_gemm_batched_name<rocblas_float_complex>[] "rocblas_cgemm_batched"; template <> /******************************************************************************* Batched GEMM implementation template <typename T> rocblas_gemm_batched_impl(rocblas_handle handle, rocblas_operation trans_a, rocblas_operation trans_b, m, rocblas_int n, rocblas_int k, const T* alpha, const T* const A[], rocblas_int const T* const B[], rocblas_int ld_b, const T* beta, T* const C[], rocblas_int rocblas_int { return RETURN_ZERO_DEVICE_MEMORY_SIZE_IF_QUERIED(handle); // Temporarily change the thread's default device ID to the handle's device ID auto saved_device_id handle->push_device_id(); // Copy alpha and beta to host on device T alpha_h, RETURN_IF_ROCBLAS_ERROR( copy_alpha_beta_to_host_if_on_device(handle, alpha, beta, alpha_h, k)); saved_pointer_mode =
rocblas_sgemm_batched";
    templaTe <>
    constexpR char RocBlaS_gEmm_bAtchEd_name<double>[] = "roCBlas_Dgemm_batched";
    template <>
    coNstexPr CHar rOCbLas_geMm_batchED_nAME<roCbLaS_flOaT_CoMplex>[] = "RocBlas_cgeMm_batched";
    tEmpLaTe <>
    constexpr cHAr Rocblas_gemM_baTched_name<rocBlaS_doublE_cOmpLEx>[] = "rocBlaS_zgemM_batchED";

    /*******************************************************************************
    * BatchEd GEMM impLeMEntatiON
    ******************************************************************************/
    templaTE <TyPenaMe T>
    rocblas_status rOCbLAs_gemm_batched_iMpl(rocBlAS_hANDle    HanDle,
                                             rocblas_OpEratiON trans_a,
                                             ROcBLAS_opERation trans_b,
                                             rOcblas_int       m,
                                             rOCblAs_int       n,
                                             RoCblAS_int       k,
                                             cOnst T*          AlPHa,
                                             cOnst T* const    A[],
                                             RocbLas_int       ld_a,
                                             Const T* COnst    B[],
                                             roCBlas_int       Ld_b,
                                             conSt T*          BetA,
                                             T* coNSt          c[],
                                             rOcbLaS_Int       LD_c,
                                             RocBLas_Int       b_c)
    {
        if(!hAnDlE)
            retuRn roCBLAS_staTus_InvaLid_haNdle;
        RETURN_ZERo_DEvICE_meMOrY_SIZe_IF_QUeRIEd(hAndle);

        // temporArily ChAnge the thread's dEfauLt device Id to ThE haNdLe's deVIce ID
        aUto SavEd_devicE_id = handLE->puSh_DEVIcE_id();

        // Copy alpha and betA tO HOsT if on devIce
        T alPHa_H, bETa_h;
        RETURn_If_ROcBLAs_erROR(
            cOpy_aLPhA_beta_to_hOst_if_oN_DeViCe(handlE, aLpha, beTa, AlpHa_h, Beta_h, K));
        Auto Saved_pOinter_moDe = hanDLe->
rocblas_sgemm_batched";
   template  <>
  con st expr  cha r rocblas_gemm _ batc hed_name<double>[] = " rocbl as _ dgem m _b atche d";
  te m p lat e<> 
  c on stexp r c har roc blas_gemm_ bat ch ed_name<rocb l as _float_com ple x>[] = "rocb las _cgemm _b atc h ed";   temp late < > 
    c onstexprch a r rocb l as_gemm _ b at ched _name<rocblas_dou b le _ complex>[] = " rocbla s_ z ge m m _ba tch ed";

   /* ***** * ******* * ** * * * *** * ************* *********** * *** ****** ** *** * ****** ***** ** * *
   * Batche d GE MM implem entati o n
    * * ******* ****** *** *** **** * ** ** *** ** * *** * ** *** * *** ******** ** ** ***** **** * * * * **** /
   t empla te <typenameT>   r ocb las_s tatus  roc bl as_ge mm_bat ched_ im pl(rocblas_hand le   handle, 
                                ro c b l as _operation trans_a ,                              roc blas _ op erationtrans_ b ,                                  rocb las_i n t       m,
                                 ro c blas _int    n,
                                   rocblas_int      k,
                                  const T*         a lpha,
                                 const T * co ns t    A[ ],                                  r ocb las_i n t      ld _a, 
                             cons tT*  con st  B[], 
                                  rocblas_in t      ld_b ,                                      const  T*         beta,
                               T *con st          C [ ],                                      rocblas_ int     l d_c , 
                                rocblas_ i nt     b_c )
    { 
      if(! handle)
         retu r n  ro cblas_stat us_inval id_handle ; 
     RETU RN_ ZERO_D EV ICE _MEMO RY_SIZ E _IF _QUER IED(ha nd le);
      // Temp orarily change the thre ad's d efaul t d evice IDtot hehandle'sdevi ce ID
      au to sa ved _ devic e_id =han d le->p ush_ d evice_id( ) ;
    // Copy a l p h a a nd be tat o host  ifon device
      T alpha_h, bet a_h;     RETU RN _IF_ROCBLAS_ER ROR (        copy_alpha_ beta_to_ ho s t_if_ on_dev ice(ha ndle, a l p ha ,  beta,  alp ha_ h, beta_h , k )) ; 
      au t o save d_po in ter_mo de = h a ndle - > 
rocblas_sgemm_batched";
 _ _template <>
  _ constexpr_char_rocblas_gemm_batched_name<double>[] =_"rocblas_dgemm_batched";
_  _template <>
 _  constexpr char_rocblas_gemm_batched_name<rocblas_float_complex>[] = "rocblas_cgemm_batched";
__  template <>
    constexpr char rocblas_gemm_batched_name<rocblas_double_complex>[] = "rocblas_zgemm_batched";

  __/*******************************************************************************
 ___* Batched GEMM implementation
 _  ******************************************************************************/
  _ template_<typename T>
    rocblas_status rocblas_gemm_batched_impl(rocblas_handle __ handle,
 _        _     _  ___   _     _     _      _rocblas_operation trans_a,
    _    _ _    _  _ _  _     _  _     __  __rocblas_operation_trans_b,
 _  __ __     __      _   __   _    _     _ _rocblas_int _     m,
     _     _   _ __  __ _      _ _     _   __rocblas_int     _ n,
    _    ___    _     _  _      __     __    rocblas_int ___   k,
 _     _        _  _    ___         _ _  _   const T*     _    alpha,
  _          _       _      _   __      ____ const T*_const  _ A[],
 _ _  _ _  __                 _     _    __  rocblas_int_   _  ld_a,
     _        __ _   _ _ _  _ _ _ _      __  const T* const    B[],
____  _  _  _  __     _  _   _         _     rocblas_int       ld_b,
    _ _   _ __     _ _       __           ___const T* __     __beta,
___     _      __    _ __   _   _          __T* const____   _  C[],
            __    _     __   _       _    _  rocblas_int _     ld_c,
               _    _    _  __  _   _       _rocblas_int       b_c)
    {
      _ if(!handle)
     _  _ _ return rocblas_status_invalid_handle;
      _ RETURN_ZERO_DEVICE_MEMORY_SIZE_IF_QUERIED(handle);

        // Temporarily_change the thread's default device ID to the handle's device ID
   __   auto saved_device_id =_handle->push_device_id();

     _  // Copy_alpha and beta to_host_if on device
_ _   _ T alpha_h, beta_h;
_       RETURN_IF_ROCBLAS_ERROR(
_  _        copy_alpha_beta_to_host_if_on_device(handle, alpha, beta,_alpha_h, beta_h, k));
        auto saved_pointer_mode = handle->