MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / TEST

Function TEST

test/cpp/compat/c10_Stream_test.cc:90–99  ·  view source on GitHub ↗

Test device_count() works in both CPU and CUDA builds

Source from the content-addressed store, hash-verified

88
89// Test device_count() works in both CPU and CUDA builds
90TEST(StreamTest, DeviceCount) {
91 c10::DeviceIndex count = c10::cuda::device_count();
92#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
93 // In CUDA builds, should return actual device count (>= 0)
94 EXPECT_GE(count, 0);
95#else
96 // In CPU-only builds, should return 0
97 EXPECT_EQ(count, 0);
98#endif
99}
100
101// ==================== native_handle ====================
102

Callers

nothing calls this directly

Calls 15

getDefaultCUDAStreamFunction · 0.85
getStreamFromPoolFunction · 0.85
EnqueueBlockingCallbackFunction · 0.85
setCurrentCUDAStreamFunction · 0.85
GPUPlaceClass · 0.85
unwrapMethod · 0.80
native_handleMethod · 0.80
device_countFunction · 0.50
is_availableFunction · 0.50
getCurrentCUDAStreamFunction · 0.50
DeviceClass · 0.50
queryMethod · 0.45

Tested by

no test coverage detected