Skip to content
Benjamin Worpitz edited this page Jul 2, 2015 · 9 revisions

Kernel function object requirements:

struct MyKernelFnObj         
{
    template<
        typename TAcc>         // Templated on the accelerator type.
    ALPAKA_FN_ACC              // Macro marking the function to be executable on all accelerators.
    void operator()(           // The function / kernel to execute.
        TAcc const & acc,      // The interfaced accelerator implementation.
        ... ) const            // Must be 'const'.      
    {
        ... 
    }
    
    // Class can have members but has to be std::is_trivially_copyable.
    // Classes must not have pointers or references to host memory!
};
Clone this wiki locally