list(APPEND gpu_list gfx908 gfx90a gfx940 gfx941 gfx942)
set(target 0)
foreach(gpu IN LISTS GPU_TARGETS)
 if(gpu IN_LIST gpu_list AND target EQUAL 0)
   if(DTYPES MATCHES "fp16" OR NOT DEFINED DTYPES)
      add_test_executable(test_batched_gemm_fp16 batched_gemm_fp16.cpp)
      target_link_libraries(test_batched_gemm_fp16 PRIVATE utility)
      target_link_libraries(test_batched_gemm_fp16 PRIVATE device_batched_gemm_instance)
   endif()
   if(DTYPES MATCHES "fp32" OR NOT DEFINED DTYPES)
      add_test_executable(test_batched_gemm_fp32 batched_gemm_fp32.cpp)
      target_link_libraries(test_batched_gemm_fp32 PRIVATE utility)
      target_link_libraries(test_batched_gemm_fp32 PRIVATE device_batched_gemm_instance)
   endif()
   if(DTYPES MATCHES "bf16" OR NOT DEFINED DTYPES)
      add_test_executable(test_batched_gemm_bf16 batched_gemm_bf16.cpp)
      target_link_libraries(test_batched_gemm_bf16 PRIVATE utility)
      target_link_libraries(test_batched_gemm_bf16 PRIVATE device_batched_gemm_instance)
   endif()
   if(DTYPES MATCHES "int8" OR NOT DEFINED DTYPES)
      add_test_executable(test_batched_gemm_int8 batched_gemm_int8.cpp)
      target_link_libraries(test_batched_gemm_int8 PRIVATE utility)
      target_link_libraries(test_batched_gemm_int8 PRIVATE device_batched_gemm_instance)
   endif()
   set(target 1)
 endif()
endforeach()