![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| timing your functions | bebop1111116 | High Level Programming | 3 | 11-01-2006 04:19 PM |
| Kshell scripts and timing | dbridle | AIX | 3 | 10-10-2006 12:26 PM |
| Timing out a SSH | rcunn87 | Shell Programming and Scripting | 9 | 07-31-2006 05:11 PM |
| scp timing out | jph | UNIX for Advanced & Expert Users | 1 | 06-09-2005 10:59 PM |
| timing a loop in unix. | wolkott | Shell Programming and Scripting | 1 | 02-04-2003 02:52 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Help with __builtin_prefetch function and it's timing
Hello there, I just needed to know how to get the timing right when using the gcc __builtin_prefetch() function, that is, how many instructions before the actual utilization of the data should I make the prefetch call.
I will be measuring the L1 cache hit rate with valgrind's cachegrind, simulating a 1KB L1 Data cache. Just in case you ask yourself what's the point in doing what I'm doing, I tell you it's a university project. |
|
||||
|
The prefetch instruction should be issued at a time before the data is used at least as large as the L1 cache latency. You should be able to find out what that latency is for the machine you are using. I imagine that your code will have some sort of loop over the array, so you take into account the time taken per loop iteration (without cache latency), the amount of data read per iteration and the size of the L1 data cache. These figures should give you an idea of the memory bandwidth you need to sustain and hence how often you need to prefetch and how far ahead each prefetch should touch the data. This gives you somewhere to start, but your professors are correct; guessing and timing is the only way to be sure.
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| cachegrind, prefetch |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|