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

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.