Hello dear all,

I am working on the HD image processing using CUDA. I have a 3750*3750 image, and I have troubles to initialize an array of this dimension.

-----------------------------------------------------------------------------------------------

__device__ int *B;

__global__ void initialize(int *tab, int v, int s)

{

int k = blockDim.x*blockIdx.x + threadIdx.x ;

if ( k < s )

tab[k] = v;

}

__global__ void  parentKernel(int sizeImage)

{

B = (int*)malloc(dim*dim*sizeof(int));

int threadsPerBlock = 256;

int blocksPerGrid = (sizeImage + threadsPerBlock -1) / threadsPerBlock;

initialize(B,0,sizeImage);

cudaDeviceSynchronize();

}

-----------------------------------------------------------------------------------------

Thank you

More Assma Azeroual's questions See All
Similar questions and discussions