1

I am writing particle engine in cuda C, I am in need to initialize huge array to a specific value and with low possible time expense. Currently my array size is 32461759 and will be increasing.. How can I initialize array that size..

In short, I want fastest method to initialize huge array Thanks

bhuwan
  • 21
  • 4

1 Answers1

2

Assuming you want to initialize int or float types to arbitrary values, the fastest method will probably be to use cuMemsetD32 from the driver API.

Additional details and discussion are here

If you simply need to initialize int, float, or double quantities to zero (only), you can use cudaMemset.

Community
  • 1
  • 1
Robert Crovella
  • 143,785
  • 11
  • 213
  • 257