Ask Your Question
1

Is it impossible to pass and manipulate a multi-dimensional array in CUDA, or is it intentionally avoided for the sake of performance?

asked 2023-05-09 11:32:58 +0000

ladyg gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-05-09 11:33:02 +0000

qstack gravatar image

It is not impossible to pass and manipulate multi-dimensional arrays in CUDA. In fact, CUDA provides support for multi-dimensional arrays through the use of the "dim3" type, which represents a 3D block or grid configuration. However, it is important to note that in many cases, manipulating multi-dimensional arrays in CUDA will require additional memory access and computation overhead, which can impact performance. Therefore, it is often recommended to use flattened 1D arrays instead, for better data locality and cache utilization.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-09 11:32:58 +0000

Seen: 11 times

Last updated: May 09 '23