MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / TEST

Function TEST

tests/cvcuda/unit/TestWorkspaceAllocator.cpp:24–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22#define EXPECT_PTR_EQ(a, b) EXPECT_EQ((const void *)(a), (const void *)(b))
23
24TEST(WorkspaceMemAllocatorTest, Get)
25{
26 alignas(64) char base[64];
27 cvcuda::WorkspaceMem wm{};
28 wm.req = {64, 64};
29 wm.data = base;
30
31 cvcuda::WorkspaceMemAllocator wa(wm);
32 EXPECT_PTR_EQ(wa.get<char>(3), base + 0);
33 EXPECT_PTR_EQ(wa.get<int32_t>(3), base + 4);
34 EXPECT_PTR_EQ(wa.get<float>(), base + 16);
35 EXPECT_PTR_EQ(wa.get<float>(1, 16), base + 32);
36 EXPECT_PTR_EQ(wa.get<float>(4), base + 48);
37}
38
39TEST(WorkspaceMemAllocatorTest, ExceedWorkspaceSize)
40{

Callers

nothing calls this directly

Calls 4

allocatedMethod · 0.80
acquireMethod · 0.80
getMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected