I have just written a code that use a large amount of global memory in device. what i have written is given below:
I allocate large memory as char type array
char *chArray = 0; CUDA_SAFE_CALL( cudaMalloc((void**) &chArray , sizeof(int) *10000)); and using this as my need by typecasting it, as: int *Int_array = (int*)chArray; double* Dou_array = (double*) &Int_array ;
It is working fine.
But as we know type casting is a costly operations.
So, what is the efficient way to handle this problem.