Skip to content

Conversation

jszuppe
Copy link
Contributor

@jszuppe jszuppe commented Aug 8, 2015

There is a bug which causes using reduce_on_gpu whenever reduction function is plus<T>, even if device is not a GPU. Now for CPU devices serial_reduce is always used.

This should fix #476.

Also this change improves performance of reduce algorithm as reduce_on_gpu is not efficient on CPU.

Device: AMD Phenom(tm) II X3 710 Processor (CPU)

=== accumulate with compute === [ MASTER, reduce_on_gpu is used]
size,time (ms)
2,0.179798
4,0.186708
8,0.172284
16,0.187684
32,0.163798
64,0.185535
128,0.173303
256,0.186923
512,0.168256
1024,0.173956
2048,0.200156
4096,0.235499
8192,0.282913
16384,0.664291
32768,0.699428
65536,1.259930
131072,2.511260
262144,4.673290
524288,9.389420
1048576,17.946400
2097152,38.079900
4194304,76.685300
8388608,123.566000
16777216,296.414000
33554432,603.888000

=== accumulate with compute === [ FIX, serial_reduce is used ]
size,time (ms)
2,0.075449
4,0.075187
8,0.076612
16,0.074292
32,0.073260
64,0.072319
128,0.072425
256,0.077508
512,0.068213
1024,0.077216
2048,0.074187
4096,0.077526
8192,0.083586
16384,0.087925
32768,0.103001
65536,0.149885
131072,0.201135
262144,0.307403
524288,0.557656
1048576,1.031420
2097152,2.347310
4194304,4.742430
8388608,9.330300
16777216,18.533900
33554432,36.776200

(This is perf_accumulate but accumulate uses reduce algorithm in this benchmark.)

kylelutz added a commit that referenced this pull request Aug 12, 2015
Using serial_reduce() when reducing on CPU device
@kylelutz kylelutz merged commit fd43795 into boostorg:develop Aug 12, 2015
@jszuppe jszuppe deleted the pr_always_serial_reduce_for_cpus branch August 12, 2015 22:56
@jszuppe
Copy link
Contributor Author

jszuppe commented Aug 13, 2015

#476 can be closed (I assume you tested it on OSX like you said you'd do).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants