会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Wangtn
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
···
21
下一页
2022年2月10日
c++可调用对象使用示例
摘要: void func(void) {} struct Foo{ void operator()(void) {} }; struct Bar{ using fr_t=void (*)(void); static void func(void){} operator fr_t(void) { retur
阅读全文
posted @ 2022-02-10 14:10 Wangtn
阅读(64)
评论(0)
推荐(0)
2022年1月26日
虚函数中的默认参数
摘要: 默认参数是静态绑定的,而虚函数是动态绑定的。 默认参数的使用要看指针或者引用本身的类型,而不是对象的类型 #include <iostream> using namespace std; class Base { public: virtual void fun ( int x = 10 ) { c
阅读全文
posted @ 2022-01-26 13:34 Wangtn
阅读(364)
评论(0)
推荐(0)
2022年1月25日
const在*左边和*右边的区别
摘要: int n=1,m=2; const int* a=&n; cout<<*a<<endl; a=&m; cout<<*a<<endl; int* const b=&n; cout<<*b<<endl; *b=10; cout<<*b<<endl; const int* a中,const修饰变量,表示
阅读全文
posted @ 2022-01-25 10:37 Wangtn
阅读(284)
评论(0)
推荐(0)
2022年1月6日
为什么cudaMalloc()参数是二级指针
摘要: 类似于这个例子 #include <iostream> using namespace std; void sw(int a,int b) { int tmp=a; a=b; b=tmp; } void sw1(int* a,int* b) { int tmp; tmp=*a; *a=*b; *b=
阅读全文
posted @ 2022-01-06 11:04 Wangtn
阅读(486)
评论(0)
推荐(0)
2021年12月29日
c++ map循环删除
摘要: 参考 http://t.zoukankan.com/riskyer-p-3343268.html 为什么 for(auto i=map.begin();i!=map.end();++i) if(i.first==value) map.erase(i); 这种写法不行? 因为在这段代码中,i的自增是放
阅读全文
posted @ 2021-12-29 11:17 Wangtn
阅读(748)
评论(0)
推荐(0)
2021年12月21日
如何在cuda c/c++中实现数据传输的重叠
摘要: 原文链接 https://developer.nvidia.com/blog/how-overlap-data-transfers-cuda-cc/ 在我们上一篇 CUDA C/C++ 文章中,我们讨论了如何在主机和设备之间有效地传输数据。在这篇文章中我们将讨论数据传输与host端计算和device
阅读全文
posted @ 2021-12-21 18:02 Wangtn
阅读(879)
评论(0)
推荐(0)
如何优化cuda c/c++中的数据传输
摘要: 原文地址(host端就是cpu,device端就是gpu) https://developer.nvidia.com/blog/how-optimize-data-transfers-cuda-cc/ 在本系列的前三篇文章中,我们为该系列的主旨打下基础:如何优化cuda c代码。在这一篇和下一篇文章
阅读全文
posted @ 2021-12-21 11:31 Wangtn
阅读(1317)
评论(0)
推荐(0)
2021年12月20日
如何在cuda c/c++中查询设备属性和处理错误
摘要: 原文地址 https://developer.nvidia.com/blog/how-query-device-properties-and-handle-errors-cuda-cc/ 在cuda c/c++系列的第三篇博文中,我们讨论了各种支持cuda的gpu的各种特性,如何从cuda c/c+
阅读全文
posted @ 2021-12-20 16:18 Wangtn
阅读(624)
评论(0)
推荐(0)
如何执行cuda c/c++中的性能指标
摘要: 原文链接 https://developer.nvidia.com/blog/how-implement-performance-metrics-cuda-cc/ 在上一篇文章中,我们通过cuda c实现SAXPY来了解了cuda c的一些基本知识。在这篇文章中我们将讨论如何分析此代码和其他cuda
阅读全文
posted @ 2021-12-20 13:54 Wangtn
阅读(720)
评论(0)
推荐(0)
2021年12月17日
cuda c和c++的简单介绍
摘要: 原文地址,纯翻译 https://developer.nvidia.com/blog/easy-introduction-cuda-c-and-c/ 这是cuda并行计算平台 c和c++接口系列的第一篇文章。学习前要求熟练掌握c,针对cuda fortran编程的帖子也会同步更新。这两个系列将涵盖c
阅读全文
posted @ 2021-12-17 17:24 Wangtn
阅读(1708)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
···
21
下一页
公告