2

The template and cppIntegration examples in the CUDA SDK (version 3.1) use Externs to link function calls from the host code to the device code.

However, Tom's comment here indicates that the usage of extern is deprecated.

If this the case, what's the correct structure for a CUDA project such as the template example or cppIntegration example?

Community
  • 1
  • 1
Richard
  • 639
  • 2
  • 8
  • 24
  • Not so much deprectaed, as no longer required in all cases! If you're mixing C and C++ then you'll still need it, but by the nvcc front-end uses C++ binding so to call from C++ it is not required. – Tom Sep 27 '10 at 19:03

1 Answers1

1

Depends what your host code is. If you end up mixing C and C++ you still need the externs. For details see this guide.

Update: the content from the above link has been moved [here] (https://isocpp.org/wiki/faq/mixing-c-and-cpp).

pszilard
  • 1,942
  • 1
  • 15
  • 18
  • Link is not available! "Forbidden. You do not have permission to access the requested file on this server." – Bardo91 Jan 31 '16 at 22:38