Ejemplo n.º 1
0
SEXP R_cuCtxSetLimit(SEXP r_limit, SEXP r_value)
{
    SEXP r_ans = R_NilValue;
    enum CUlimit_enum limit = (enum CUlimit_enum) INTEGER(r_limit)[0];
    unsigned long value = REAL(r_value)[0];
    
    CUresult ans;
    ans = cuCtxSetLimit(limit, value);
    
    r_ans = Renum_convert_CUresult(ans) ;
    
    return(r_ans);
}
Ejemplo n.º 2
0
void CUDARenderer::initCUDA()
{
	gpuErrchk(cudaSetDevice(0));
	gpuErrchk(cudaGLSetGLDevice(0));
	gpuErrchk(cudaMalloc((void **)&d_scene, sizeof(SlowScene)));
	gpuErrchk(cudaMemcpy(d_scene, &h_scene, sizeof(SlowScene), cudaMemcpyHostToDevice));

	setImageInfo(h_info);
	gpuErrchk(cuCtxSetLimit(CU_LIMIT_STACK_SIZE, 1024 * 10));

	dimBlock = dim3(THREAD_DIM, THREAD_DIM, 1);
	dimGrid = dim3(h_info.width / dimBlock.x + (h_info.width % dimBlock.x > 0), h_info.height / dimBlock.y + (h_info.height % dimBlock.y > 0), 1);

	snapshot.init();
}