摘要:
__syncthreads() acts as a barrier at which all threads in the block must wait before any is allowed to proceed.//计算向量的内积程序#include<stdio.h>#define imin(a,b) (a<b?a:b)//N为输入的向量的规模const int N=33*1024;const int threadsPerBlock=256;const int blocksPerGrid= imin(32,(N+threadsPerBlock-1)/threadsP 阅读全文