cuda
文章平均质量分 75
maowenge
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
GPU线程运行机制
///****测试在kernel里面交换全局内存的值 #include #include #include #include using namespace std; const int N=300; __global__ void show(int* a) { for(int i=blockIdx.x*blockDim.x+threadIdx.x;i i+=blo原创 2014-11-10 19:03:14 · 1553 阅读 · 0 评论 -
测试cuda的unified memory和cudaMemcpy的加减乘除及空间申请时间对比
#include #include #include #include using namespace std; const int N=1234567; const int sample=100; const int threads=256; __global__ void judge(int *da,int *data,int sam) { cons原创 2014-10-28 17:28:43 · 1130 阅读 · 0 评论 -
测试cuda的unified memory和cudaMemcpy的if判断
// //#include //#include //#include //#include //using namespace std; // //const int N=1001569; //const int threadPerBlock=256; // // //__global__ void aplusb(int *a,int *b,float *c) //{原创 2014-10-28 17:29:42 · 1020 阅读 · 0 评论 -
cudaDeviceSynchronize的优化
#include #include #include #include using namespace std; __global__ void nullKernel() {} int main(void) { const int sum=1000000; cout cudaEvent_t start,stop; float time; c原创 2015-01-06 17:37:25 · 5268 阅读 · 1 评论 -
异步内存、直接复制及流处理复制对比
#include #include #include using namespace std; template __device__ void saxpy_unrolled( float *out, const float *px, const float *py, size_t N, float alpha ) { float x[n],y[n];原创 2015-01-07 22:18:53 · 1512 阅读 · 0 评论 -
检测gpu if的运行
#include #include #include #include using namespace std; const int N=500; __global__ void test(int* a,int n) { const int tid=blockIdx.x*blockDim.x+threadIdx.x; int i=blockDim.x*gridDim.x*n+ti原创 2014-12-10 16:51:54 · 630 阅读 · 0 评论 -
cuda的计时技术
在CUDA中统计运算时间,大致有三种方法: 使用cutil.h中的函数 unsigned int timer=0; //创建计时器 cutCreateTimer(&timer); //开始计时 cutStartTimer(timer); { //统计的代码段 ………… } //停转载 2015-01-04 17:36:34 · 650 阅读 · 0 评论 -
测试gpu的if判断的加速比
#include #include #include #include using namespace std; const int N=123456; const int sample=100; const int threads=256; const int blocks=2048; __global__ void judge(int* da,int* dat原创 2015-01-04 15:44:21 · 974 阅读 · 0 评论
分享