Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (27 sloc) 968 Bytes
PREAMBLE = \
"""
#include <thrust/scan.h>
"""
INITIALIZE = \
"""
thrust::host_vector<$InputType> h_input = unittest::random_integers<$InputType>($InputSize);
thrust::device_vector<$InputType> d_input = h_input;
thrust::host_vector<$InputType> h_output($InputSize);
thrust::device_vector<$InputType> d_output($InputSize);
thrust::inclusive_scan(h_input.begin(), h_input.end(), h_output.begin());
thrust::inclusive_scan(d_input.begin(), d_input.end(), d_output.begin());
ASSERT_EQUAL(h_output, d_output);
"""
TIME = \
"""
thrust::inclusive_scan(d_input.begin(), d_input.end(), d_output.begin());
"""
FINALIZE = \
"""
RECORD_TIME();
RECORD_THROUGHPUT(double($InputSize));
RECORD_BANDWIDTH(4*sizeof($InputType)*double($InputSize));
"""
InputTypes = SignedIntegerTypes
InputSizes = [2**24] #StandardSizes
TestVariables = [('InputType', InputTypes), ('InputSize', InputSizes)]