MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / check_gpu_available

Function check_gpu_available

lite/test/test_common.h:171–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169#endif
170
171static inline bool check_gpu_available(size_t num) {
172 if (mgb::CompNode::get_device_count(mgb::CompNode::DeviceType::CUDA) < num) {
173 mgb_log_warn("skip test case that requires %zu GPU(s)", num);
174 return false;
175 }
176 return true;
177}
178#define REQUIRE_CUDA() \
179 { \
180 if (!check_gpu_available(1)) { \

Callers 1

TESTFunction · 0.85

Calls 1

get_device_countFunction · 0.85

Tested by

no test coverage detected