Is it necessary to use KokkosBlas::Impl::gemm_tpl_spec_avail defined in src/impl/tpls/KokkosBlas3-gemm_tpl_spec_avail.h to enable tpls?
Ignoring the eti_spec_avail, the calling stack of Kokko Blas3 gemm is like that: gemm<AVT,BVT,CVT> -> Impl::Gemm<AVT,BVT,CVT,gemm_tpl_spec_avail<AVT,BVT,CVT>::value>::gemm. If macro KOKKOSKERNELS_ENABLE_TPL_BLAS is defined, then there will be some spacialized gemm_tpl_spec_avail<AVT,BVT,CVT>, also there will be some specialized version of Impl::GEMM<AVT,BVT,CVT,true>. If AVT BVT and CVT are same except for the const description, the gemm_tpl_spec_avail<AVT,BVT,CVT>::value equals true and the most specialized version is perfered. So specialized version of Impl::GEMM<AVT,BVT,CVT,true> is called. But if we dont have a templete parameter gemm_tpl_spec_avail<AVT,BVT,CVT>::value the later one is still a more specialized version, and will be called when AVT, BVT, and CVT is suitable. So what the reason of maintaining the class gemm_tpl_spec_avail.
I am not sure what your questions is?
We have a TPL specialization layer that defines a struct with a value field set to true or false depending on the availability of the TPL at configure time.
If the value field is false then you will not be able to dispatch the GEMM operation to a TPL.
Are you trying to use the GEMM kernels or are you trying to write your own by modifying Kokkos Kernels?
In the former case (simply using GEMM), recall that you are not allowed to include _impl headers in your code as we reserve the right to modify these in any way at any time.
My question is about the implementation of Impl::Gemm. I mean that if we drop the fourth templete parameter in the decleration of Impl::Gemm, then the specialized versions of Impl::Gemm declared in src/impl/tpls/kokkosBlas3_gemm_tpl_spec_decl.hpp are still more specialized versions than the general one declared in src/blas/impl/KokkosBlas3_gemm_spec.hpp. So when macro KOKKOSKERNELS_ENABLE_TPL_BLAS is defined, and AVT BVT and CVT satisfie certain conditions that they have same type incude scalar type, layout and device type, then the complier will still chose this specialized ones than the general one. So I think it is not necessary to maintain the struct gemm_tpl_spec_avail in src/impl/tpls/KokkosBlas3-gemm_tpl_spec_avail.hpp. Am I correct?