This example shows how to link a Thrust program contained in
a .cu file with a C++ program contained in a .cpp file. Note
that device_vector only appears in the .cu file while host_vector
appears in both. This relects the fact that algorithms on device
vectors are only available when the contents of the program are
located in a .cu file and compiled with the nvcc compiler.
On a Linux system where Thrust is installed in the default location
we can use the following procedure to compile the two parts of the
program and link them together.
$ nvcc -O2 -c device.cu
$ g++ -O2 -c host.cpp -I/usr/local/cuda/include/
$ nvcc -o tester device.o host.o
Alternatively, we can use g++ to perform final linking step.
$ nvcc -O2 -c device.cu
$ g++ -O2 -c host.cpp -I/usr/local/cuda/include/
$ g++ -o tester device.o host.o -L/usr/local/cuda/lib64 -lcudart
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
Thrust实例程序 v1.2是个CUDA并行算法库,含有一个类似于C++标准模板库(STL)的界面。Thrust提供了一个灵活的高级GPU编程接口,可以极大地增强开放者的生产力,可以利用Thrust迅速开发高性能的应用程序。这是一个非常重要的第三方CUDA开发库。 Thrust is a CUDA library of parallel algorithms with an interface resembling the C++ Standard Template Library (STL). Thrust provides a flexible high-level interface for GPU programming that greatly enhances developer productivity. Develop high-performance applications rapidly with Thrust!
资源推荐
资源详情
资源评论
收起资源包目录
examples-v1.2.zip (42个子文件)
examples
monte_carlo.cu 2KB
sort.cu 436B
segmented_scan.cu 2KB
saxpy.cu 2KB
wrap_pointer.cu 531B
run_length_encoding.cu 2KB
SConstruct 1KB
cpp_integration
SConstruct 893B
device.h 120B
README.txt 874B
device.cu 423B
host.cpp 559B
arbitrary_transformation.cu 2KB
fill_copy_sequence.cu 833B
bounding_box.cu 2KB
bucket_sort2d.cu 3KB
summary_statistics.cu 5KB
monte_carlo_disjoint_sequences.cu 3KB
sum_rows.cu 2KB
LICENSE 10KB
constant_iterator.cu 718B
histogram.cu 3KB
basic_vector.cu 984B
mode.cu 3KB
lexicographical_sort.cu 3KB
stream_compaction.cu 2KB
max_abs_diff.cu 1019B
norm.cu 1KB
minmax.cu 2KB
padded_grid_reduction.cu 4KB
remove_points2d.cu 2KB
counting_iterator.cu 1KB
transform_iterator.cu 4KB
README 401B
dot_products_with_zip.cu 5KB
sorting_aos_vs_soa.cu 2KB
permutation_iterator.cu 932B
word_count.cu 3KB
summed_area_table.cu 3KB
sum.cu 530B
unwrap_pointer.cu 824B
version.cu 291B
共 42 条
- 1
资源评论
- cccjunhui2014-02-16比较完整,但是使用起来有些复杂。
beyondht2003
- 粉丝: 2
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 课程设计-python爬虫-爬取日报,爬取日报文章后存储到本地,附带源代码+课程设计报告
- 软件和信息技术服务行业投资与前景预测.pptx
- 课程设计-基于SpringBoot + Mybatis+python爬虫NBA球员数据爬取可视化+源代码+文档+sql+效果图
- 软件品质管理系列二项目策划规范.doc
- 基于TensorFlow+PyQt+GUI的酒店评论情感分析,支持分析本地数据文件和网络爬取数据分析+源代码+文档说明+安装教程
- 软件定义无线电中的模拟电路测试技术.pptx
- 软件开发协议(作为技术开发合同附件).doc
- 软件开发和咨询行业技术趋势分析.pptx
- 软件测试题详解及答案.doc
- 软件漏洞生命周期管理策略.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功