MCPcopy Create free account
hub / github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator / PerformPoolTests

Function PerformPoolTests

src/Tests.cpp:7949–8173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7947}
7948
7949static void PerformPoolTests(FILE* file)
7950{
7951 wprintf(L"POOL TESTS:\n");
7952
7953 const size_t AVG_RESOURCES_PER_POOL = 300;
7954
7955 uint32_t repeatCount = 1;
7956 if(ConfigType >= CONFIG_TYPE_MAXIMUM) repeatCount = 3;
7957
7958 PoolTestConfig config{};
7959 config.RandSeed = 2346343;
7960 config.FrameCount = 200;
7961 config.ItemsToMakeUnusedPercent = 2;
7962
7963 size_t threadCountCount = 1;
7964 switch(ConfigType)
7965 {
7966 case CONFIG_TYPE_MINIMUM: threadCountCount = 1; break;
7967 case CONFIG_TYPE_SMALL: threadCountCount = 2; break;
7968 case CONFIG_TYPE_AVERAGE: threadCountCount = 2; break;
7969 case CONFIG_TYPE_LARGE: threadCountCount = 3; break;
7970 case CONFIG_TYPE_MAXIMUM: threadCountCount = 3; break;
7971 default: assert(0);
7972 }
7973 for(size_t threadCountIndex = 0; threadCountIndex < threadCountCount; ++threadCountIndex)
7974 {
7975 std::string desc1;
7976
7977 switch(threadCountIndex)
7978 {
7979 case 0:
7980 desc1 += "1_thread";
7981 config.ThreadCount = 1;
7982 break;
7983 case 1:
7984 desc1 += "16_threads";
7985 config.ThreadCount = 16;
7986 break;
7987 case 2:
7988 desc1 += "2_threads";
7989 config.ThreadCount = 2;
7990 break;
7991 default:
7992 assert(0);
7993 }
7994
7995 // 0 = buffers, 1 = images, 2 = buffers and images
7996 size_t buffersVsImagesCount = 2;
7997 if(ConfigType >= CONFIG_TYPE_LARGE) ++buffersVsImagesCount;
7998 for(size_t buffersVsImagesIndex = 0; buffersVsImagesIndex < buffersVsImagesCount; ++buffersVsImagesIndex)
7999 {
8000 std::string desc2 = desc1;
8001 switch(buffersVsImagesIndex)
8002 {
8003 case 0: desc2 += " Buffers"; break;
8004 case 1: desc2 += " Images"; break;
8005 case 2: desc2 += " Buffers+Images"; break;
8006 default: assert(0);

Callers 1

TestFunction · 0.85

Calls 5

TestPool_BenchmarkFunction · 0.85
WritePoolTestResultFunction · 0.85
CalcAvgResourceSizeMethod · 0.80
clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected