| 239 | #endif |
| 240 | |
| 241 | bool have_same_compute_capability(const std::vector<int>& devices) { |
| 242 | if (devices.size() > 1) { |
| 243 | int ref_major = -1; |
| 244 | int ref_minor = -1; |
| 245 | for (const int device : devices) { |
| 246 | const cudaDeviceProp& device_prop = get_device_properties(device); |
| 247 | const int major = device_prop.major; |
| 248 | const int minor = device_prop.minor; |
| 249 | if (ref_major < 0) { |
| 250 | ref_major = major; |
| 251 | ref_minor = minor; |
| 252 | } else if (major != ref_major || minor != ref_minor) |
| 253 | return false; |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | return true; |
| 258 | } |
| 259 | |
| 260 | static thread_local bool true_fp16_gemm = read_bool_from_env("CT2_CUDA_TRUE_FP16_GEMM", true); |
| 261 | |