Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4874

General • Re: Multicore optimisations and memory use

$
0
0
Will be interesting to see if this helps, since the smaller loop iteration count may be what gets GCC all excited about "improving" the code!
Unfortunately, although this did as it said and stuck more to the larger 32 place Array's assembly, it didn't help with the issue, which says there's probably another issue somewhere else, that for some reason the size of this array is effecting.

Interestingly, if I use the pragma below on the inner loop (or both of the loops as shown) I can reduce the array to 16 entries, but no lower, despite only using 8 entries in any code that's being used. It doesn't seem to effect anything on only the outer loop.

Code:

#pragma GCC unroll 0for (int i = 0; i < length; i++) {#pragma GCC unroll 0for (int j = i+1; j < length; j++) {if(playBuffer[i].note > playBuffer[j].note) {                swap = playBuffer[i];                            playBuffer[i] = playBuffer[j];                        playBuffer[j] = swap;    }     }}

Statistics: Posted by Neo_nmik — Thu Jan 02, 2025 8:51 pm



Viewing all articles
Browse latest Browse all 4874

Trending Articles