随笔分类 -  C++

摘要:由于最新的多播模式区别于原来的广播模式,原来同一个warp不同线程访问同一个bank的相同地址不再是bank conflict, 现在总结为:只要同一个 warp 的不同线程会访问到同一个 bank 的不同地址就会发生 bank conflict,除此之外的都不会发生 bank conflict。 阅读全文
posted @ 2017-11-29 09:09 djiankuo 阅读(199) 评论(0) 推荐(0)
摘要:typedef声明有助于创建平台无关类型,甚至能隐藏复杂和难以理解的语法。 不管怎样,使用 typedef 能为代码带来意想不到的好处,通过本文你可以学习用typedef避免缺欠,从而使代码更健壮。 typedef声明,简称typedef,为现有类型创建一个新的名字。比如人们常常使用 typedef 阅读全文
posted @ 2017-01-17 17:24 djiankuo 阅读(425) 评论(0) 推荐(0)
摘要:This question already has an answer here: External calls are not supported - CUDA 1 answer I am trying to understand how to decouple CUDA __device__ c 阅读全文
posted @ 2016-09-26 20:15 djiankuo 阅读(1905) 评论(0) 推荐(0)
摘要:最近在学cuda ,找了好久入门的教程,感觉入门这个教程比较好,网上买的书基本都是在掌握基础后才能看懂,所以在这里记录一下。百度文库下载,所以不知道原作者是谁,向其致敬! 文章目录 1. CUDA是什么 2. 64位Ubuntu12.04安装CUDA5.5 3. 对CUDA C的个人懵懂感觉 4. 阅读全文
posted @ 2016-03-31 16:37 djiankuo 阅读(2365) 评论(0) 推荐(0)
摘要:解决方案是为项目添加 /FS (Force Synchronous PDB Writes) 编译选项,具体位置在: 直接修改cocos的项目模板templates\cpp-template-default\proj.win32\HelloCpp.vcxproj为: 这样不仅解决了这个问题,还能避免每 阅读全文
posted @ 2016-03-17 20:33 djiankuo 阅读(1501) 评论(0) 推荐(0)
摘要:好几次碰到这个错误,必须mark 一下!!!!!Project Properties > Configuration Properties > C/C++ > General > SDL checks关掉 阅读全文
posted @ 2016-03-17 20:29 djiankuo 阅读(1515) 评论(0) 推荐(0)
摘要:error C4996声明已被否决,不止一次碰到这个问题,在这里必须mark一下! 尝试这个1.Project Properties > Configuration Properties > C/C++ > General > SDL checks关掉其他方法:2.#pragma warning(d 阅读全文
posted @ 2016-03-03 10:18 djiankuo 阅读(1008) 评论(0) 推荐(0)
摘要:一、标准C和C++都可用 1、获取时间用time_t time( time_t * timer ),计算时间差使用double difftime( time_t timer1, time_t timer0 )。 精确到秒。 测试程序如下: [c-sharp] view plain copy #inc 阅读全文
posted @ 2016-02-27 09:27 djiankuo 阅读(1487) 评论(0) 推荐(0)
摘要:最近需要了解sbin与bin的功能,需要整理一下。一下全部为Ubuntu14里面默认安装的。在这里收集一下,转载请注明出处!bin bashshellbunzip2.bz2文件的解压缩程序。busyboxBusyBox 是一个集成了一百多个最常用linux命令和工具的软件。BusyBox 包含了一... 阅读全文
posted @ 2016-01-18 10:19 djiankuo 阅读(940) 评论(0) 推荐(0)
摘要:今天遇到求模与求余的区别,特此查询了一下,在此做标记求模运算和求余运算在第一步不同: 取余运算在取c的值时,向0 方向舍入(fix()函数);而取模运算在计算c的值时,向负无穷方向舍入(floor()函数)。例如:计算-7 Mod 4那么:a = -7;b = 4;第一步:求整数商c,如进行求模运算... 阅读全文
posted @ 2016-01-15 09:20 djiankuo 阅读(382) 评论(0) 推荐(0)
摘要:我从网上找了一个类似的问题,具体的内容如下创建了个mfc的共享链接库,里面只有这样一个加法_declspec(dllexport) int add(int a,int b){return a+b ;}然后创建了个mfc的exe,选择对话框,添加一个按钮,事件里面extern int add(int ... 阅读全文
posted @ 2016-01-04 11:05 djiankuo 阅读(722) 评论(0) 推荐(0)
摘要:最近在尝试用UDT进行通信,写了两个简单的客户端和服务端,但是编译的时候出现了“error LNK2019: 无法解析的外部符号”错误,为了以后进行总结,还是把解决方法记录下来。1>------ 已启动生成: 项目: udt_appserver, 配置: Debug Win32 ------1>生成... 阅读全文
posted @ 2015-12-31 17:33 djiankuo 阅读(4926) 评论(0) 推荐(1)
摘要:Openssl是个为网络通信提供安全及数据完整性的一种安全协议,囊括了主要的密码算法、常用的密钥和证书封装管理功能以及SSL协议,并提供了丰富的应用程序供测试或其它目的使用。首先下载Openssl包:(http://www.openssl.org/),这是一个C语言类库包,在Windows下可以通过... 阅读全文
posted @ 2015-12-31 16:16 djiankuo 阅读(2721) 评论(0) 推荐(0)
摘要:这个东西搞了好几天,现在终于没有问题了,其实现在想来还是微软做的东西好用啊,在这里点个赞!!!LL是一个包含可由多个程序同时使用的代码和数据的库,DLL不是可执行文件。动态链接提供了一种方法,使进程可以调用不属于其可执行代码的函数。函数的可执行代码位于一个 DLL 中,该 DLL 包含一个或多个已被... 阅读全文
posted @ 2015-12-31 16:04 djiankuo 阅读(5283) 评论(0) 推荐(0)
摘要:Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example, Given n = 3,You should return the followin... 阅读全文
posted @ 2015-11-29 00:03 djiankuo 阅读(152) 评论(0) 推荐(0)
摘要:Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.N... 阅读全文
posted @ 2015-11-28 23:07 djiankuo 阅读(140) 评论(0) 推荐(0)
摘要:Given a linked list, swap every two adjacent nodes and return its head.For example, Given 1->2->3->4, you should return the list as 2->1->4->3.Your al... 阅读全文
posted @ 2015-11-28 22:33 djiankuo 阅读(148) 评论(0) 推荐(0)
摘要:Given a collection of numbers, return all possible permutations.For example, [1,2,3] have the following permutations: [1,2,3], [1,3,2], [2,1,3], [2,3,... 阅读全文
posted @ 2015-11-28 22:21 djiankuo 阅读(163) 评论(0) 推荐(0)
摘要:Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, ... 阅读全文
posted @ 2015-11-28 21:35 djiankuo 阅读(155) 评论(0) 推荐(0)
摘要:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists./** * Def... 阅读全文
posted @ 2015-11-28 20:43 djiankuo 阅读(136) 评论(0) 推荐(0)