CUDA之——入门程序

来源:互联网 发布:淘宝卖家数据分析 编辑:程序博客网 时间:2024/06/05 02:27
摘要

本文主要讲述CUDA的第一个入门程序"Hello World"。This simple "Hello World" example is meant to illustrate that, at most of time, there is no different between CUDA C language and standard C language! That is really important.


1. VS下,新建CUDA项目

在Visual Studio中新建CUDA项目,如下



2. "Hello World"入门(HelloWorld.cu)

#include "cuda_runtime.h"

#include "device_launch_parameters.h"#include <stdio.h>int main(void) {printf("Hello CUDA \n");return 0;}

3. 测试结果



0 0
原创粉丝点击