我正在使用cuda toolkit 8.0在Ubuntu 16.04中使用CUDA开发应用程序.
我的问题是关于gtx960m(功能5.0)可以包含的每个块的线程数.我正在尝试使用每个块中的最大线程数,因此,我使用cudaGetDeviceProperties()函数来获取此信息(1024个线程,您可以在文档中看到)但是当我使用超过512个我的内核中的每个块的线程API返回错误代码0x7("警告:检测到Cuda API错误:cudaLaunch返回(0x7)"),这意味着"启动资源".
我的问题的一个小示例代码:
#include <random>
#include <curand.h>
#include <curand_kernel.h>
#define min(a,b) (a<b?a:b);
__global__ void bootstrap_V1(int nSamples, int sampleFraction, int seed, unsigned int* sampleIDs, unsigned int* inbagCounts){
int tid = threadIdx.x + blockIdx.x * blockDim.x;
int offset = gridDim.x * blockDim.x;
/*Generating a random number in a specific ranger:
1- Use CURAND to generate a uniform distribution between 0.0 and 1.0
2- Then multiply this by the desired range (largest value - smallest value + …Run Code Online (Sandbox Code Playgroud) cuda ×1