Device-specific : Further improvements in the validity check of the GEMM template