forked from NVIDIA/thrust
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinclusive_scan.test
36 lines (27 loc) · 968 Bytes
/
inclusive_scan.test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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)]