MCPcopy Create free account
hub / github.com/OpenNMT/CTranslate2 / have_same_compute_capability

Function have_same_compute_capability

src/cuda/utils.cc:241–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

loadMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected