Boost
C++ Libraries
...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
BOOST_COMPUTE_FUNCTION
// In header: <boost/compute/function.hpp>
BOOST_COMPUTE_FUNCTION(return_type, name, arguments, source)Creates a function object with name and source.
The function declaration and signature are automatically created using the return_type, name, and arguments macro parameters.
The source code for the function is interpreted as OpenCL C99 source code which is stringified and passed to the OpenCL compiler when the function is invoked.
For example, to create a function which squares a number:
BOOST_COMPUTE_FUNCTION(float, square, (float x), { return x * x; });
And to create a function which sums two numbers:
BOOST_COMPUTE_FUNCTION(int, sum_two, (int x, int y), { return x + y; });
See Also: BOOST_COMPUTE_CLOSURE()
Parameters: |
|