Calling inline function in .cu file from C++ class -


i'm trying call kernel wrapper foo c++ class. i've tried suggested here below:

// in cpp.h: class cls {     extern "c" inline void foo(); }  // in kernels.cu: #include "cpp.h" extern "c" inline void cls::foo() {     // call kernels here } 

but has not worked - compiler errors:

  • cpp.h: invalid storage class class member
  • cpp.h: "cls::foo" referenced not defined
  • kernels.cu: label "cls" declared never referenced

what's going wrong?

you shouldn't mark class method extern "c".

make wrapper non-member function extern "c" specifier, , let function call class's method (you need specify instance also).


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -