- Joined
- Oct 9, 2009
- Messages
- 9
- Reaction score
- 0
* Hi All
I read a lot of times that pipelining is a good trick to optimize and speed up your code.
I alway read basically to perform operations instead of this way
Operation_1_a;
Operation_2_a;
Operation_3_a;
Operation_1_b;
Operation_2_b;
Operation_3_b;
Operation_1_C;
Operation_2_C;
Operation_3_C;
I 'd better to do this
Operation_1_a;Operation_1_b;Operation_1_c;
Operation_2_a;Operation_2_b;Operation_2_c;
Operation_3_a;Operation_3_b;Operation_3_c;
where I can profit of the code that is already in the cache.
Do you have a sample code where I can better see this concept already in practice or some hint?
My guess that the real precondition for this technique is that Operation_1, Operation_2 and Operation_3 must be totally uncorrelated each other i.e. the result of one must not depend on the call of the previous function so no shared state or sharing variables.
Am I right?
Mn
I read a lot of times that pipelining is a good trick to optimize and speed up your code.
I alway read basically to perform operations instead of this way
Operation_1_a;
Operation_2_a;
Operation_3_a;
Operation_1_b;
Operation_2_b;
Operation_3_b;
Operation_1_C;
Operation_2_C;
Operation_3_C;
I 'd better to do this
Operation_1_a;Operation_1_b;Operation_1_c;
Operation_2_a;Operation_2_b;Operation_2_c;
Operation_3_a;Operation_3_b;Operation_3_c;
where I can profit of the code that is already in the cache.
Do you have a sample code where I can better see this concept already in practice or some hint?
My guess that the real precondition for this technique is that Operation_1, Operation_2 and Operation_3 must be totally uncorrelated each other i.e. the result of one must not depend on the call of the previous function so no shared state or sharing variables.
Am I right?
Mn