Skip to content

Commit

Permalink
More trying to identify cause of GTC_bitfield time out...
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-lunarg committed Mar 5, 2024
1 parent aa3ab2a commit 8d6442f
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions test/gtc/gtc_bitfield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ namespace bitfieldInterleave3
{
int Error(0);

std::clock_t const LastTime = std::clock();

glm::uint16 const test_max = 5; // previously 11

glm::uint16 x_max = 1 << test_max;
Expand All @@ -242,6 +244,10 @@ namespace bitfieldInterleave3
Error += ResultA == ResultB ? 0 : 1;
}

std::clock_t const Time = std::clock() - LastTime;

std::printf("glm::bitfieldInterleave3 Test %d clocks\n", static_cast<int>(Time));

return Error;
}
}
Expand All @@ -267,6 +273,8 @@ namespace bitfieldInterleave4
{
int Error(0);

std::clock_t const LastTime = std::clock();

glm::uint16 const test_max = 5; // previously 11

glm::uint16 x_max = 1 << test_max;
Expand All @@ -284,6 +292,10 @@ namespace bitfieldInterleave4
Error += ResultA == ResultB ? 0 : 1;
}

std::clock_t const Time = std::clock() - LastTime;

std::printf("glm::bitfieldInterleave4 Test %d clocks\n", static_cast<int>(Time));

return Error;
}
}
Expand Down Expand Up @@ -500,6 +512,8 @@ namespace bitfieldInterleave
{
int Error = 0;

std::clock_t const LastTime = std::clock();

glm::uint8 const test_loop = 15; // 127 ideally

/*
Expand Down Expand Up @@ -560,6 +574,10 @@ namespace bitfieldInterleave
}
}

std::clock_t const Time = std::clock() - LastTime;

std::printf("glm::bitfieldInterleave Test %d clocks\n", static_cast<int>(Time));

return Error;
}

Expand Down Expand Up @@ -764,6 +782,8 @@ namespace bitfieldInterleave5
{
int Error = 0;

std::clock_t const LastTime = std::clock();

glm::size_t count = 256 / divider;

for(glm::size_t j = 0; j < count; ++j)
Expand Down Expand Up @@ -803,6 +823,10 @@ namespace bitfieldInterleave5
Error += A == B ? 0 : 1;
}
*/
std::clock_t const Time = std::clock() - LastTime;

std::printf("glm::bitfieldInterleave4 Test %d clocks\n", static_cast<int>(Time));

return Error;
}

Expand Down Expand Up @@ -967,24 +991,38 @@ namespace bitfieldInterleave5

static int test_bitfieldRotateRight()
{
std::clock_t const LastTime = std::clock();

glm::ivec4 const A = glm::bitfieldRotateRight(glm::ivec4(2), 1);
glm::ivec4 const B = glm::ivec4(2) >> 1;

std::clock_t const Time = std::clock() - LastTime;

std::printf("glm::bitfieldRotateRight Test %d clocks\n", static_cast<int>(Time));

return A == B;
}

static int test_bitfieldRotateLeft()
{
std::clock_t const LastTime = std::clock();

glm::ivec4 const A = glm::bitfieldRotateLeft(glm::ivec4(2), 1);
glm::ivec4 const B = glm::ivec4(2) << 1;

std::clock_t const Time = std::clock() - LastTime;

std::printf("glm::bitfieldRotateLeft Test %d clocks\n", static_cast<int>(Time));

return A == B;
}

int main()
{
int Error = 0;

std::clock_t const LastTime = std::clock();

Error += ::bitfieldInterleave::test();
Error += ::bitfieldInterleave3::test();
Error += ::bitfieldInterleave4::test();
Expand All @@ -1001,5 +1039,9 @@ int main()
Error += test_bitfieldRotateRight();
Error += test_bitfieldRotateLeft();

std::clock_t const Time = std::clock() - LastTime;

std::printf("gtc_bitfield %d clocks\n", static_cast<int>(Time));

return Error;
}

0 comments on commit 8d6442f

Please sign in to comment.