MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

compute/test/test_radix_sort.cpp:29–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27const bool descending = false;
28
29BOOST_AUTO_TEST_CASE(sort_char_vector)
30{
31 if(is_apple_cpu_device(device)) {
32 std::cerr
33 << "skipping all radix_sort tests due to Apple platform"
34 << " behavior when local memory is used on a CPU device"
35 << std::endl;
36 return;
37 }
38
39 using boost::compute::char_;
40
41 char_ data[] = { 'c', 'a', '0', '7', 'B', 'F', '\0', '$' };
42 boost::compute::vector<char_> vector(data, data + 8, queue);
43 BOOST_CHECK_EQUAL(vector.size(), size_t(8));
44 BOOST_CHECK(boost::compute::is_sorted(vector.begin(), vector.end(), queue) == false);
45
46 boost::compute::detail::radix_sort(vector.begin(), vector.end(), queue);
47 BOOST_CHECK(boost::compute::is_sorted(vector.begin(), vector.end(), queue) == true);
48 CHECK_RANGE_EQUAL(char_, 8, vector, ('\0', '$', '0', '7', 'B', 'F', 'a', 'c'));
49}
50
51BOOST_AUTO_TEST_CASE(sort_uchar_vector)
52{

Callers

nothing calls this directly

Calls 7

is_apple_cpu_deviceFunction · 0.85
is_sortedFunction · 0.85
radix_sortFunction · 0.85
CHECK_RANGE_EQUALFunction · 0.70
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected