MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST

Function TEST

tensorflow/core/common_runtime/gpu/pool_allocator_test.cc:27–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25namespace {
26
27TEST(PoolAllocatorTest, ZeroSizeBuffers) {
28 se::Platform* platform =
29 se::MultiPlatformManager::PlatformWithName("cuda").ValueOrDie();
30 PoolAllocator pool(
31 2 /*pool_size_limit*/, false /*auto_resize*/,
32 new GpuHostAllocator(
33 platform->GetExecutor(se::StreamExecutorConfig(/*ordinal=*/0))
34 .ValueOrDie(),
35 0 /*numa_node*/, {}, {}),
36 new NoopRounder, "pool");
37
38 EXPECT_EQ(nullptr, pool.AllocateRaw(4 /*alignment*/, 0 /*num_bytes*/));
39 pool.DeallocateRaw(nullptr); // Should not crash.
40 EXPECT_EQ(0, pool.get_from_pool_count());
41 EXPECT_EQ(0, pool.put_count());
42 EXPECT_EQ(0, pool.allocated_count());
43 EXPECT_EQ(0, pool.evicted_count());
44}
45
46TEST(PoolAllocatorTest, ZeroSizePool) {
47 se::Platform* platform =

Callers

nothing calls this directly

Calls 8

get_from_pool_countMethod · 0.80
GetExecutorMethod · 0.45
AllocateRawMethod · 0.45
DeallocateRawMethod · 0.45
ClearMethod · 0.45
RoundUpMethod · 0.45
NameMethod · 0.45

Tested by

no test coverage detected