January 2018
Intermediate to advanced
374 pages
9h 53m
English
If we would like to execute other algorithms, for example sort the circles by their radius, we provide predicates just like in STL.
Here is how you would use a predicate for sorting circles on the CPU and the corresponding predicate in Boost Compute/OpenCL.
|
CPU predicate |
GPU predicate |
auto less_r_cpu = [](Circle a,Circle b){ return a.r < b.r;}; |
BOOST_COMPUTE_FUNCTION( bool, // Return type less_r_gpu, // Function Name (Circle a, Circle ... |
Read now
Unlock full access