| 26 | using singa::Platform; |
| 27 | |
| 28 | TEST(Platform, CreateMultDevice) { |
| 29 | int n = Platform::GetNumGPUs(); |
| 30 | auto devs = Platform::CreateCudaGPUs(n); |
| 31 | for (size_t i = 0; i < devs.size(); i++) { |
| 32 | auto b = devs[i]->NewBlock(512 + 512 * (2 - i)); |
| 33 | // for lazy allocation |
| 34 | b->mutable_data(); |
| 35 | EXPECT_EQ(512 + 512 * (2 - i), devs[i]->GetAllocatedMem()); |
| 36 | devs[i]->FreeBlock(b); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | TEST(Platform, NumGPUs) { |
| 41 | int n = Platform::GetNumGPUs(); |
nothing calls this directly
no test coverage detected