High-Productivity CUDA Development with the Thrust Template ...
High-Productivity CUDA Development with the Thrust Template ...
High-Productivity CUDA Development with the Thrust Template ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Algorithms<br />
� Standard operators<br />
// allocate memory<br />
device_vector A(10);<br />
device_vector B(10);<br />
device_vector C(10);<br />
// transform A + B -> C<br />
transform(A.begin(), A.end(), B.begin(), C.begin(), plus());<br />
// transform A - B -> C<br />
transform(A.begin(), A.end(), B.begin(), C.begin(), minus());<br />
// multiply reduction<br />
int product = reduce(A.begin(), A.end(), 1, multiplies());