mirror of
https://github.com/boostorg/compute.git
synced 2026-02-17 13:42:17 +00:00
Better names for tests
This commit is contained in:
@@ -70,7 +70,7 @@ BOOST_AUTO_TEST_CASE(is_same_ignore_const)
|
||||
));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(copy_host_float_to_device_double)
|
||||
BOOST_AUTO_TEST_CASE(copy_to_device_float_to_double)
|
||||
{
|
||||
if(!device.supports_extension("cl_khr_fp64")) {
|
||||
std::cout << "skipping test: device does not support double" << std::endl;
|
||||
@@ -88,7 +88,7 @@ BOOST_AUTO_TEST_CASE(copy_host_float_to_device_double)
|
||||
CHECK_RANGE_EQUAL(double_, 4, device_vector, (6.1f, 10.2f, 19.3f, 25.4f));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(copy_host_float_to_device_int)
|
||||
BOOST_AUTO_TEST_CASE(copy_to_device_float_to_int)
|
||||
{
|
||||
using compute::int_;
|
||||
using compute::float_;
|
||||
@@ -111,7 +111,9 @@ BOOST_AUTO_TEST_CASE(copy_host_float_to_device_int)
|
||||
);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(copy_host_float_to_device_int_mapping_device_vector)
|
||||
// HOST -> DEVICE
|
||||
|
||||
BOOST_AUTO_TEST_CASE(copy_to_device_float_to_int_mapping_device_vector)
|
||||
{
|
||||
using compute::int_;
|
||||
using compute::uint_;
|
||||
@@ -150,7 +152,7 @@ BOOST_AUTO_TEST_CASE(copy_host_float_to_device_int_mapping_device_vector)
|
||||
parameters->set(cache_key, "map_copy_threshold", map_copy_threshold);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(copy_host_float_to_device_int_convert_on_host)
|
||||
BOOST_AUTO_TEST_CASE(copy_to_device_float_to_int_convert_on_host)
|
||||
{
|
||||
using compute::int_;
|
||||
using compute::uint_;
|
||||
@@ -194,7 +196,7 @@ BOOST_AUTO_TEST_CASE(copy_host_float_to_device_int_convert_on_host)
|
||||
parameters->set(cache_key, "direct_copy_threshold", direct_copy_threshold);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(copy_host_float_to_device_int_with_transform)
|
||||
BOOST_AUTO_TEST_CASE(copy_to_device_float_to_int_with_transform)
|
||||
{
|
||||
using compute::int_;
|
||||
using compute::uint_;
|
||||
@@ -238,7 +240,7 @@ BOOST_AUTO_TEST_CASE(copy_host_float_to_device_int_with_transform)
|
||||
parameters->set(cache_key, "direct_copy_threshold", direct_copy_threshold);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(copy_async_host_float_to_device_int)
|
||||
BOOST_AUTO_TEST_CASE(copy_async_to_device_float_to_int)
|
||||
{
|
||||
using compute::int_;
|
||||
using compute::float_;
|
||||
@@ -264,72 +266,10 @@ BOOST_AUTO_TEST_CASE(copy_async_host_float_to_device_int)
|
||||
);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(copy_device_float_to_device_int)
|
||||
{
|
||||
using compute::int_;
|
||||
using compute::float_;
|
||||
|
||||
float_ data[] = { 6.1f, -10.2f, 19.3f, 25.4f };
|
||||
bc::vector<float_> device_fvector(data, data + 4, queue);
|
||||
bc::vector<int_> device_ivector(4, context);
|
||||
|
||||
// copy device float vector to device int vector
|
||||
bc::copy(
|
||||
device_fvector.begin(),
|
||||
device_fvector.end(),
|
||||
device_ivector.begin(),
|
||||
queue
|
||||
);
|
||||
|
||||
CHECK_RANGE_EQUAL(
|
||||
int_,
|
||||
4,
|
||||
device_ivector,
|
||||
(
|
||||
static_cast<int_>(6.1f),
|
||||
static_cast<int_>(-10.2f),
|
||||
static_cast<int_>(19.3f),
|
||||
static_cast<int_>(25.4f)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(copy_async_device_float_to_device_int)
|
||||
{
|
||||
using compute::int_;
|
||||
using compute::float_;
|
||||
|
||||
float_ data[] = { 6.1f, -10.2f, 19.3f, 25.4f };
|
||||
bc::vector<float_> device_fvector(data, data + 4, queue);
|
||||
bc::vector<int_> device_ivector(4, context);
|
||||
|
||||
// copy device float vector to device int vector
|
||||
compute::future<void> future =
|
||||
bc::copy_async(
|
||||
device_fvector.begin(),
|
||||
device_fvector.end(),
|
||||
device_ivector.begin(),
|
||||
queue
|
||||
);
|
||||
future.wait();
|
||||
|
||||
CHECK_RANGE_EQUAL(
|
||||
int_,
|
||||
4,
|
||||
device_ivector,
|
||||
(
|
||||
static_cast<int_>(6.1f),
|
||||
static_cast<int_>(-10.2f),
|
||||
static_cast<int_>(19.3f),
|
||||
static_cast<int_>(25.4f)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Test copying from a std::list to a bc::vector. This differs from
|
||||
// the test copying from std::vector because std::list has non-contiguous
|
||||
// storage for its data values.
|
||||
BOOST_AUTO_TEST_CASE(copy_from_host_float_list_to_int_device_map)
|
||||
BOOST_AUTO_TEST_CASE(copy_to_device_float_to_int_list_device_map)
|
||||
{
|
||||
using compute::int_;
|
||||
using compute::uint_;
|
||||
@@ -372,7 +312,7 @@ BOOST_AUTO_TEST_CASE(copy_from_host_float_list_to_int_device_map)
|
||||
// Test copying from a std::list to a bc::vector. This differs from
|
||||
// the test copying from std::vector because std::list has non-contiguous
|
||||
// storage for its data values.
|
||||
BOOST_AUTO_TEST_CASE(copy_from_host_float_list_to_int_device_convert_on_host)
|
||||
BOOST_AUTO_TEST_CASE(copy_to_device_float_to_int_list_convert_on_host)
|
||||
{
|
||||
using compute::int_;
|
||||
using compute::uint_;
|
||||
@@ -418,9 +358,73 @@ BOOST_AUTO_TEST_CASE(copy_from_host_float_list_to_int_device_convert_on_host)
|
||||
}
|
||||
|
||||
|
||||
// DEVICE -> DEVICE
|
||||
|
||||
BOOST_AUTO_TEST_CASE(copy_on_device_float_to_int)
|
||||
{
|
||||
using compute::int_;
|
||||
using compute::float_;
|
||||
|
||||
float_ data[] = { 6.1f, -10.2f, 19.3f, 25.4f };
|
||||
bc::vector<float_> device_fvector(data, data + 4, queue);
|
||||
bc::vector<int_> device_ivector(4, context);
|
||||
|
||||
// copy device float vector to device int vector
|
||||
bc::copy(
|
||||
device_fvector.begin(),
|
||||
device_fvector.end(),
|
||||
device_ivector.begin(),
|
||||
queue
|
||||
);
|
||||
|
||||
CHECK_RANGE_EQUAL(
|
||||
int_,
|
||||
4,
|
||||
device_ivector,
|
||||
(
|
||||
static_cast<int_>(6.1f),
|
||||
static_cast<int_>(-10.2f),
|
||||
static_cast<int_>(19.3f),
|
||||
static_cast<int_>(25.4f)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(copy_async_on_device_float_to_int)
|
||||
{
|
||||
using compute::int_;
|
||||
using compute::float_;
|
||||
|
||||
float_ data[] = { 6.1f, -10.2f, 19.3f, 25.4f };
|
||||
bc::vector<float_> device_fvector(data, data + 4, queue);
|
||||
bc::vector<int_> device_ivector(4, context);
|
||||
|
||||
// copy device float vector to device int vector
|
||||
compute::future<void> future =
|
||||
bc::copy_async(
|
||||
device_fvector.begin(),
|
||||
device_fvector.end(),
|
||||
device_ivector.begin(),
|
||||
queue
|
||||
);
|
||||
future.wait();
|
||||
|
||||
CHECK_RANGE_EQUAL(
|
||||
int_,
|
||||
4,
|
||||
device_ivector,
|
||||
(
|
||||
static_cast<int_>(6.1f),
|
||||
static_cast<int_>(-10.2f),
|
||||
static_cast<int_>(19.3f),
|
||||
static_cast<int_>(25.4f)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// DEVICE -> HOST
|
||||
|
||||
BOOST_AUTO_TEST_CASE(copy_device_float_to_host_int)
|
||||
BOOST_AUTO_TEST_CASE(copy_to_host_float_to_int)
|
||||
{
|
||||
using compute::int_;
|
||||
using compute::float_;
|
||||
|
||||
Reference in New Issue
Block a user