Skip to main content
Tweeted twitter.com/StackGameDev/status/662603069667020804
added 63 characters in body
Source Link

I've read a lot about the benefits of organizing data into 'Structs of Arrays' (SoA) instead of the typical 'Array of Structs' (AoS) to get better throughput when using SIMDSIMD instructions. While the 'why' makes total sense to me, I'm not sure how much to do this when working with things like vectors.

Vectors themselves can be tought of as a struct of a (fixed size) array of data, so you could convert an array of these into a struct of X, Y and Z arrays. Through this, you can work on 4 vectors at once as opposed to one at a time.

Now, for the specific reason I'm posting this on GameDev:

Does this make sense for working with vectors on the SPU? More specifically, does it make sense to DMA multiple arrays just for a single vector? Or would it be better to stick with DMAing the array of Vectors and unrolling them into the different components to work with?

I could see the benefit of cutting out the unrolling (if you did it 'AoS'), but it seems like you could quickly run out of DMA channels if you took this route and were working with multiple sets of vectors at once.

(Note: no professional experience with Cell yet, but have been toying around in OtherOS for a while)

I've read a lot about the benefits of organizing data into 'Structs of Arrays' (SoA) instead of the typical 'Array of Structs' (AoS) to get better throughput when using SIMD instructions. While the 'why' makes total sense to me, I'm not sure how much to do this when working with things like vectors.

Vectors themselves can be tought of as a struct of a (fixed size) array of data, so you could convert an array of these into a struct of X, Y and Z arrays. Through this, you can work on 4 vectors at once as opposed to one at a time.

Now, for the specific reason I'm posting this on GameDev:

Does this make sense for working with vectors on the SPU? More specifically, does it make sense to DMA multiple arrays just for a single vector? Or would it be better to stick with DMAing the array of Vectors and unrolling them into the different components to work with?

I could see the benefit of cutting out the unrolling (if you did it 'AoS'), but it seems like you could quickly run out of DMA channels if you took this route and were working with multiple sets of vectors at once.

(Note: no professional experience with Cell yet, but have been toying around in OtherOS for a while)

I've read a lot about the benefits of organizing data into 'Structs of Arrays' (SoA) instead of the typical 'Array of Structs' (AoS) to get better throughput when using SIMD instructions. While the 'why' makes total sense to me, I'm not sure how much to do this when working with things like vectors.

Vectors themselves can be tought of as a struct of a (fixed size) array of data, so you could convert an array of these into a struct of X, Y and Z arrays. Through this, you can work on 4 vectors at once as opposed to one at a time.

Now, for the specific reason I'm posting this on GameDev:

Does this make sense for working with vectors on the SPU? More specifically, does it make sense to DMA multiple arrays just for a single vector? Or would it be better to stick with DMAing the array of Vectors and unrolling them into the different components to work with?

I could see the benefit of cutting out the unrolling (if you did it 'AoS'), but it seems like you could quickly run out of DMA channels if you took this route and were working with multiple sets of vectors at once.

(Note: no professional experience with Cell yet, but have been toying around in OtherOS for a while)

Retag; deleted 56 characters in body
Source Link
coderanger
  • 6.1k
  • 38
  • 38

I've read a lot about the benefits of organizing data into 'Structs of Arrays' (SoA) instead of the typical 'Array of Structs' (AoS) to get better throughput when using SIMD instructions. While the 'why' makes total sense to me, I'm not sure how much to do this when working with things like vectors.

Vectors themselves can be tought of as a struct of a (fixed size) array of data, so you could convert an array of these into a struct of X, Y and Z arrays. Through this, you can work on 4 vectors at once as opposed to one at a time.

Now, for the specific reason I'm posting this on GameDev:

Does this make sense for working with vectors on the SPU? More specifically, does it make sense to DMA multiple arrays just for a single vector? Or would it be better to stick with DMAing the array of Vectors and unrolling them into the different components to work with?

I could see the benefit of cutting out the unrolling (if you did it 'AoS'), but it seems like you could quickly run out of DMA channels if you took this route and were working with multiple sets of vectors at once.

(Note: no professional experience with Cell yet, but have been toying around in OtherOS for a while)

(PS: Can someone create some new tags for this post)

I've read a lot about the benefits of organizing data into 'Structs of Arrays' (SoA) instead of the typical 'Array of Structs' (AoS) to get better throughput when using SIMD instructions. While the 'why' makes total sense to me, I'm not sure how much to do this when working with things like vectors.

Vectors themselves can be tought of as a struct of a (fixed size) array of data, so you could convert an array of these into a struct of X, Y and Z arrays. Through this, you can work on 4 vectors at once as opposed to one at a time.

Now, for the specific reason I'm posting this on GameDev:

Does this make sense for working with vectors on the SPU? More specifically, does it make sense to DMA multiple arrays just for a single vector? Or would it be better to stick with DMAing the array of Vectors and unrolling them into the different components to work with?

I could see the benefit of cutting out the unrolling (if you did it 'AoS'), but it seems like you could quickly run out of DMA channels if you took this route and were working with multiple sets of vectors at once.

(Note: no professional experience with Cell yet, but have been toying around in OtherOS for a while)

(PS: Can someone create some new tags for this post)

I've read a lot about the benefits of organizing data into 'Structs of Arrays' (SoA) instead of the typical 'Array of Structs' (AoS) to get better throughput when using SIMD instructions. While the 'why' makes total sense to me, I'm not sure how much to do this when working with things like vectors.

Vectors themselves can be tought of as a struct of a (fixed size) array of data, so you could convert an array of these into a struct of X, Y and Z arrays. Through this, you can work on 4 vectors at once as opposed to one at a time.

Now, for the specific reason I'm posting this on GameDev:

Does this make sense for working with vectors on the SPU? More specifically, does it make sense to DMA multiple arrays just for a single vector? Or would it be better to stick with DMAing the array of Vectors and unrolling them into the different components to work with?

I could see the benefit of cutting out the unrolling (if you did it 'AoS'), but it seems like you could quickly run out of DMA channels if you took this route and were working with multiple sets of vectors at once.

(Note: no professional experience with Cell yet, but have been toying around in OtherOS for a while)

Source Link
Chris Waters
  • 478
  • 1
  • 3
  • 10

SoA Vectors on SPU

I've read a lot about the benefits of organizing data into 'Structs of Arrays' (SoA) instead of the typical 'Array of Structs' (AoS) to get better throughput when using SIMD instructions. While the 'why' makes total sense to me, I'm not sure how much to do this when working with things like vectors.

Vectors themselves can be tought of as a struct of a (fixed size) array of data, so you could convert an array of these into a struct of X, Y and Z arrays. Through this, you can work on 4 vectors at once as opposed to one at a time.

Now, for the specific reason I'm posting this on GameDev:

Does this make sense for working with vectors on the SPU? More specifically, does it make sense to DMA multiple arrays just for a single vector? Or would it be better to stick with DMAing the array of Vectors and unrolling them into the different components to work with?

I could see the benefit of cutting out the unrolling (if you did it 'AoS'), but it seems like you could quickly run out of DMA channels if you took this route and were working with multiple sets of vectors at once.

(Note: no professional experience with Cell yet, but have been toying around in OtherOS for a while)

(PS: Can someone create some new tags for this post)