Permalink
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (23 sloc) 668 Bytes
PREAMBLE = \
"""
#include <thrust/reduce.h>
"""
INITIALIZE = \
"""
thrust::host_vector<$InputType> h_input = unittest::random_samples<$InputType>($InputSize);
thrust::device_vector<$InputType> d_input = h_input;
$InputType init = 13;
"""
TIME = \
"""
thrust::reduce(d_input.begin(), d_input.end(), init);
"""
FINALIZE = \
"""
RECORD_TIME();
RECORD_THROUGHPUT(double($InputSize));
RECORD_BANDWIDTH(sizeof($InputType) * double($InputSize));
"""
InputTypes = ['float']
InputSizes = [int(2**(k/2.0)) for k in range(42,56)]
TestVariables = [('InputType', InputTypes), ('InputSize', InputSizes)]