Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <boost/config.hpp>
  2. #include <MaxSLiCInterface.h>
  3. #include "vexcl_dfe_kernel.h"
  4.  
  5. struct kernel_api {
  6. virtual void execute(char*) const = 0;
  7. };
  8.  
  9. #define KERNEL_PARAMETER(type, name) \
  10. type name = *reinterpret_cast<type*>(_p); _p+= sizeof(type)
  11.  
  12. struct simple_t : public kernel_api {
  13. void execute(char*) const;
  14. };
  15.  
  16. extern "C" BOOST_SYMBOL_EXPORT simple_t simple;
  17. simple_t simple;
  18. void simple_t::execute(char *_p) const {
  19. KERNEL_PARAMETER(int, n);
  20. KERNEL_PARAMETER(const float *, x);
  21. KERNEL_PARAMETER(float *, y);
  22. vexcl_dfe_kernel(n, x, y);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement