MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / HasCudaDevice

Function HasCudaDevice

oneflow/core/embedding/cache_test.cpp:29–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27#ifdef WITH_CUDA
28
29bool HasCudaDevice() {
30 int device_count = 0;
31 if (cudaGetDeviceCount(&device_count) != cudaSuccess) { return false; }
32 if (device_count <= 0) { return false; }
33 return true;
34}
35
36void TestCache(Cache* cache, uint32_t line_size) {
37 std::unique_ptr<ep::DeviceManagerRegistry> device_manager_registry(

Callers 1

TESTFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected