Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (26 sloc) 850 Bytes
PREAMBLE = \
"""
#include <thrust/reduce.h>
"""
INITIALIZE = \
"""
thrust::host_vector<$InputType> h_input = unittest::random_integers<$InputType>($InputSize);
thrust::device_vector<$InputType> d_input = h_input;
$InputType init = 13;
$InputType h_result = thrust::reduce(h_input.begin(), h_input.end(), init);
$InputType d_result = thrust::reduce(d_input.begin(), d_input.end(), init);
ASSERT_EQUAL(h_result, d_result);
"""
TIME = \
"""
thrust::reduce(d_input.begin(), d_input.end(), init);
"""
FINALIZE = \
"""
RECORD_TIME();
RECORD_THROUGHPUT(double($InputSize));
RECORD_BANDWIDTH(sizeof($InputType) * double($InputSize));
"""
InputTypes = SignedIntegerTypes
InputSizes = StandardSizes
TestVariables = [('InputType', InputTypes), ('InputSize', InputSizes)]
Jump to Line
Something went wrong with that request. Please try again.