摘要:
cudaEvent_t start,stop;cudaEventCreate(&start);//创建事件cudaEventCreate(&stop);cudaEventRecord(start,0);//记录当前时间//要记录时间的事情/工作cudaEventRecord(stop,0);//记录... 阅读全文
摘要:
1.shared memory__shared__ 声明为共享内存,将会保存在共享内存中2.constant memory__constant__ 声明为常量内存,将会保存在常量内存中,常量内存是只读内存,声明时要静态的分配空间将数据从CPU拷贝到常量内存中时用cudaMemcpyToSymbol,... 阅读全文
摘要:
内建变量:threadIdx(.x/.y/.z代表几维索引):线程所在block中各个维度上的线程号blockIdx(.x/.y/.z代表几维索引):块所在grid中各个维度上的块号blockDim(.x/.y/.z代表各维度上block的大小):block的大小即block中线程的数量,block... 阅读全文