MCPcopy Create free account
hub / github.com/apache/singa / TEST

Function TEST

test/singa/test_platform.cc:28–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26using singa::Platform;
27
28TEST(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
40TEST(Platform, NumGPUs) {
41 int n = Platform::GetNumGPUs();

Callers

nothing calls this directly

Calls 9

NewBlockMethod · 0.80
mutable_dataMethod · 0.80
FreeBlockMethod · 0.80
ToHostMethod · 0.80
sizeMethod · 0.45
GetAllocatedMemMethod · 0.45
SetValueMethod · 0.45
SizeMethod · 0.45
ToDeviceMethod · 0.45

Tested by

no test coverage detected