Skip to content
Snippets Groups Projects
Commit a0053385 authored by Xuan Thang Nguyen's avatar Xuan Thang Nguyen
Browse files

refactor out permutation 8

parent b57ba7f1
No related branches found
No related tags found
No related merge requests found
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
TEST(permutations, allPermutationSize_1_to_8) TEST(permutations, allPermutationSize_2_to_7)
{ {
for(int i = 2; i<=8; i++ ) for(int i = 2; i<=7; i++ )
{ {
int size = i; int size = i;
std::vector<int> orig(size); std::vector<int> orig(size);
...@@ -33,6 +33,30 @@ TEST(permutations, allPermutationSize_1_to_8) ...@@ -33,6 +33,30 @@ TEST(permutations, allPermutationSize_1_to_8)
} }
} }
TEST(permutations, allPermutationSize_8)
{
int size = 9;
const int stride = 151;
int i = 0;
std::vector<int> orig(size);
std::iota(orig.begin(), orig.end(), 0);
do
{
if ((i++) % stride != 0)
continue;
TNL::Containers::Array<int, TNL::Devices::Cuda> cudaArr(orig);
auto view = cudaArr.getView();
bitonicSort(view);
ASSERT_TRUE(is_sorted(view)) << "result " << view << std::endl;
}
while (std::next_permutation(orig.begin(), orig.end()));
}
TEST(permutations, somePermutationSize9) TEST(permutations, somePermutationSize9)
{ {
int size = 9; int size = 9;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment