Hi,
I want to use shared memory to transfer several integer arrays between a kernel function and a device function.
There are 7 arrays each with 100 integer elements. I defined them as shared int A[100], B[100],…
In my kernel function
I coded
if (threadIdx.x == 0) {
LOAD DATA FROM GLOBAL MEMORY ARRAY TO SHARED MEMORY ARRAYS A[], B[],...
}
__syncthreads();
Then I pass these arrays to a device function device_sub(int *A, int *B, …)
My device function is within a loop.
The problem seems to be that the device function can be only called once. When it is called the second time within the loop, the kernel function returns me error “out of memory”
Does the code keep allocating resources when calling the device function? Otherwise, it should not exceed the share memory limit, which at least has 16K (or 48K) on my Tesla.
Thanks!