Reputation: 163
There are two arrays named A and B, they are corresponding to each other, and their space are allocated during the kernels running. the details of A and B are that A[i] is the position and B[i] is value.All the threads do the things below:
Is the upper implementing supported by CUDA?
Upvotes: 0
Views: 1511
Reputation: 21475
Concerning point #2, you would need something like C++'s realloc()
, which, as long as I know, is not supported by CUDA. You can write your own realloc()
according to this post
CUDA: Using realloc inside kernel
but I do not know how efficient will be this solution.
Alternatively, you should pre-allocate a "large" amount of global memory to be able to account for the worst case memory occupation scenario.
Upvotes: 1