qwerty_asdf
Member level 4
In my project I want to do this: read 2 arrays (lets say 32 elements each of 64 bits,actually it's gonna be thousand of elements) and compute the minimum square difference between the first element of the first array and the whole array B, so on for the second etc. Let me explain my self. I want for the array A and for each of its elements, compute the minimum square difference between the elements of the other array B. My implementation so far is rather foollish but it works. i want to speed up and use less resources.
So far, i read element A1 (64 bits at once) and then read all the others B1...B32 and compute the differences. Then for the A2 and so on. something like a double for loop in C.
Here is my ideas(and other peoples ideas but I do not know exactly how to start coding them).
- Not read the whole element in one cycle, but in pieces of lets say 8 bits. My question is how this will help me? Will it reduce the memory i am using? If yes, how?
- A main problem I see is that I do not take advantage of concurrency. I mean in every cycle I do only one computation. (fetch element A1 and lets say B4 compute the difference). How to do something better? My code seems to me too much sequential. (like a softarea programmer). Will it be better for example do more than one computation on the same cycle? If yes, which of them?
Please let me know your ideas, comments and useful links. I can post my code so far if you wish.
So far, i read element A1 (64 bits at once) and then read all the others B1...B32 and compute the differences. Then for the A2 and so on. something like a double for loop in C.
Here is my ideas(and other peoples ideas but I do not know exactly how to start coding them).
- Not read the whole element in one cycle, but in pieces of lets say 8 bits. My question is how this will help me? Will it reduce the memory i am using? If yes, how?
- A main problem I see is that I do not take advantage of concurrency. I mean in every cycle I do only one computation. (fetch element A1 and lets say B4 compute the difference). How to do something better? My code seems to me too much sequential. (like a softarea programmer). Will it be better for example do more than one computation on the same cycle? If yes, which of them?
Please let me know your ideas, comments and useful links. I can post my code so far if you wish.