- 博客(18)
- 资源 (32)
- 收藏
- 关注
转载 【CUDA】初步了解PageLocked host memory的mapped memory功能使用
导言: 大家都知道CUDA 中PageLocked memory 相比portable memory 有着多种优势:在有front-side bus的系统中,pagelocked memory 所提供的host 与device之间的数据传送速度,快得多。测试结果如图Fig.1 Fig.2所示。kernel execution 和 pagelocked memory 与 dev
2012-09-28 09:43:29 2204
翻译 Use the CUDA Warp Watch
Use the CUDA Warp WatchVS2010的局部变量和全局变量工具窗口只支持在一个thread中查看变量一次,Nsight Debuger使用current focus thread and stack frame来计算这些表达式。Nsight提出cuda Warp Watch的工具窗口,可以展示一个单独的focused Warp中的表达式的值的信息。To
2012-09-27 21:39:03 2133
翻译 Nsight
1.点击按钮,找到2.vs2010的菜单中选择:3.vs2010的菜单中选择,选择4.按F11查看内存1.vs2010的菜单中选择,选择,选择2.从窗口点击并拖动一个变量名到窗口,窗口显示该变量的地址值
2012-09-26 21:48:10 1016
原创 运算符优先级与结合性
运算符的结合性指同一优先级的运算符在表达式中操作的组织方向,即: 当一个运算对象两侧运算符的优先级别相同时,运算对象与运算符的结合顺序, C 语言规定了各种运算符的结合方向( 结合性) 。大多数运算符结合方向是“自左至右”, 即: 先左后右, 例如a- b+c,b 两侧有- 和+两种运算符的优先级相同, 按先左后右结合方向, b 先与减号结合, 执行a- b 的运算, 再执行加
2012-09-25 17:02:20 754
原创 实参、形参 C++
值传递方式:1、普通调用,形参与实参为同样的类型fun(int i)()fun(Student stud)()main(){ fun(1);Student s1; fun1(s1);}在函数中可以修改形参的值,但不能改变其对应的实参的值(形参的值变化无法传送到实参) 原因:在函数调用时将建立一个新的对象,是
2012-09-21 22:50:28 1046 1
原创 想一想?
#include using namespace std;void testFun(int *po,int len){int size=sizeof(po);cout}int main(){int p[6]={1,2,3,4,5,6};int sizeP1=sizeof(p);couttestFun(p,6);return 0;}输出
2012-09-20 16:06:47 526
转载 vector的基本操作实现
/***Dsexceptions.h代码***/#ifndef DS_EXCEPTIONS_H#define DS_EXCEPTIONS_Hclass UnderflowException { };class IllegalArgumentException { };class ArrayIndexOutOfBoundsException { };class IteratorOut
2012-09-19 09:37:02 998
转载 Debug Assertion Failed.Expression:_BLOCK_TYPE_IS_VALID(phead->nBlockUse)
Debug Assertion Failed.Expression:_BLOCK_TYPE_IS_VALID(phead->nBlockUse)关于上面这个错误,我在上一篇文章中的程序遇到过了,在网上查了一些资料,有些人说是重复释放内存的原因,他们说得很对,但是有些人会觉得自己的程序并没有重复释放内存,所以在这里我记录一下我的问题,方便以后编程。 假如你申请了两个错针
2012-09-18 16:12:11 1740
原创 可自增内存的数组<类似vector的pushback>
#include using namespace std;class poi{public:int x;int y;poi(){}poi(int xx,int yy){x=xx;y=yy;}void display(){cout}~poi(){}};template clas
2012-09-18 16:11:27 1418
原创 error LNK2001: 无法解析的外部符号 "public: static class std::vector<class......
vector类型作为class的static成员,需要在class外 define。如:class MyClass {private: static std::vector myObjectCache;public: static void UpdateCache ();};需要在类外std::vector MyClass::myObjectCache;
2012-09-18 09:54:40 12931 6
转载 面向对象语言中的callback(C++)
面向对象语言中的callback(C++) 回调函数必须是标准调用 __stdcall,用户调用也以以,不过意义不大。回调一定是__stdcal 但是__stdcal不一定是回调 许多程序员都发现,利用MFC或者其它的C++应用编写回调函数是非常麻烦的,其根本原因是回调函数是基于C编程的Windows SDK的技术,不是针对C++的,程序员可以将一个C函数直接作为回调函数,但是如
2012-09-16 17:35:57 670
转载 opengl 直线的线型(各种虚线)
除了直线的宽度可以根据需要进行改变外,直线的线型也可以改变。glLineStipple就可以提供不同于常规的连续线段的中心线、虚线、点划线等等。其函数原型如下 void glLineStipple( GLint factor, GLushort pattern);其中factor 是比例因子,它表示在线型模式中,每一位的放大倍数。例如,factor为3,那么线型模式
2012-09-12 22:04:02 10024 1
转载 C++防灾——为指针成员分配专门的存储空间
在C++中,当类中有指针类型的数据成员时,必须注意在构造函数中,分配专门的存储单元,并将地址赋值给指针型数据成员。 这样做的目的在于,要保证指针指向的存储单元能够由类本身控制。 如果这种情形处理不好,将可能会造成灾难性的后果,尽管多数情况程序看上去执行还算正常(这种错误是真正可怕的错误)。 为了帮助读者理解,本文将从实例出发,展示不用这种处理的灾难性后果,同时给出正确
2012-09-11 16:32:57 676
原创 C++ 动态二维数组
#include#include using namespace std;int main(){ int wid,hei; cout<<"Input wid"<<endl; cin>>wid; cout<<"Input hei"<<endl; cin>>hei; /***声明***/ int **arra=new int *[hei]; for (int
2012-09-04 14:32:57 689
转载 C++ 申请一个动态三维数组
#include#include using namespace std;int main(){ int i,j,k; int nWidth,nHeight,nThird; cin>>nThird>>nHeight>>nWidth; /***声明一个三维数组***/ int ***grayScale = new int ** [nThird]; fo
2012-09-03 22:07:39 1676
原创 C++中类似C# region的功能
//语法描述#pragma region name#pragma endregion comment//END//实例代码#pragma region Region_1void Test() {}void Test2() {}void Test3() {}#pragma endregion Region_1int main() {}
2012-09-02 20:34:48 7973 1
Dynamic Parallax Occlusion Mapping with Approximate Soft Shadows
2014-06-17
Practical Parallax Occlusion Mapping for Highly Detailed Surface Rendering
2014-06-17
opengl 超级宝典 第5版 第五版 中文版 蓝宝书
2013-08-13
opengl 超级宝典 第5版 中文版
2013-08-13
Mathematics for 3D Game Programming and Computer Graphics
2013-08-13
opengl 4.0 shading language cookbook 源码
2012-10-29
OpenGL超级宝典 中文 第四版 7_7
2011-09-08
OpenGL超级宝典 中文 第四版 7_5
2011-09-08
OpenGL超级宝典 中文 第四版 7_4
2011-09-08
OpenGL超级宝典 中文 第四版7_2
2011-09-08
OpenGL超级宝典 中文 第四版7_1.pdf
2011-09-08
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人