Jump to content

Hello guyz,

In CUDA kernel call, I am passing an array of points and which is then divided into 4 different quadrants in the GPU depending on their value. After the kernel call is over some more points are added to the initial array of points and then the array is resent.

I want to ask when the array is resent, whether all the computations done during the first kernel call be present in the device memory or if all the computations would have to be done again?

Thank you.
 

Link to comment
https://linustechtips.com/topic/792085-cuda-gpu-memory/
Share on other sites

Link to post
Share on other sites

Just to be sure that I got the question:

  • Have an array of points
  • Split the array using a GPU kernel
  • You have more data and you want to run the same kernel and append te result to the previous results?

 

What you can do is keep track of the size of the output quadrants.

Add an offset for each quadrant to your kenrel so that you write the results after the previous results (instead of overwriting them).

 

Another solution is to allocate new GPU arrays for borth the new input data and the output quadrants.

You can then copy those resuls to the CPU and merge them with your existing results.

Desktop: Intel i9-10850K (R9 3900X died 😢 )| MSI Z490 Tomahawk | RTX 2080 (borrowed from work) - MSI GTX 1080 | 64GB 3600MHz CL16 memory | Corsair H100i (NF-F12 fans) | Samsung 970 EVO 512GB | Intel 665p 2TB | Samsung 830 256GB| 3TB HDD | Corsair 450D | Corsair RM550x | MG279Q

Laptop: Surface Pro 7 (i5, 16GB RAM, 256GB SSD)

Console: PlayStation 4 Pro

Link to comment
https://linustechtips.com/topic/792085-cuda-gpu-memory/#findComment-9981772
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×