VS2013 VC + + the. cpp file invokes a function in the cuda. cu file

Source: Internet
Author: User

CUDA 8.0 in the function of the call is easy to move people. The following is the VC + + from the online learning of the. cpp file calls the Cuda. cu file in the function method, and the general VC + + function call method basically no difference.

The Cuda version used is Cuda 8.0, which is installed by default.

1.vs2013 New Cuda 8.0 Project

2. Modification of the project

The. cpp call. cu file is based on the definition of functions and the implementation of functions can be in different files, and. cu files also support this feature, so you can modify the following conditions, That is, new kernel.h and Main.cpp, the head file and function declaration are written in the header file, Kernel.cu contains the header file, and implements the function declared in the header file, the function is called in main.cpp.

3. Running Results

Project Source: http://download.csdn.net/download/qq_33892166/9840090

VS2013 VC + + the. cpp file invokes a function in the cuda. cu file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.