How to access Cache memory

How to access Cache memory

Hello All,
I need to access the CPU Cache memories (L1, L2, L3) for reading and writing into it. Can I do this? I think so far that Cache is made only for processor for spped up the operations. Is'nt it? I am calling the CPU intrinsic method _mm_prefetch interuction for this. whether I am on right track to get cache information or not. Please let me know As early as possible.

Thanks in advance,

regards,
Suraj

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Quoting - suraj_pune
Hello All,
I need to access the CPU Cache memories (L1, L2, L3) for reading and writing into it. Can I do this? I think so far that Cache is made only for processor for spped up the operations. Is'nt it? I am calling the CPU intrinsic method _mm_prefetch interuction for this. whether I am on right track to get cache information or not. Please let me know As early as possible.

Thanks in advance,

regards,
Suraj

if you write to the cpu cache it will become invalid and unload the data in the cache and reload the ram data
i think you want to use un-cached data
please say what you are trying to do because i seem to remember that writing to the cpu cache is wrong

The Intel compiler documentation includes some advice about use of explicit prefetch, as well as the opt-prefetch global compile option, and loop level prefetch pragmas. There are additional specialized options for IA64 (Itanium). All recent Xeon and AMD CPUs have effective hardware prefetch implementations, so the role of software prefetch is limited to situations not covered by the hardware, such as early new page fetches where the programmer knows the addresses in advance, possibly in situations where some of the hardware prefetch options are disabled. The compiler options cover single level indirection in a loop. CPUs which are no longer in production, such as P-III, Athlon32, P4, allowed for use of prefetch in ways which aren't useful for current and future CPUs, such as those for which this forum was started. So, as the other reply said, we can't guess if you are on the right track, without some information from you.

Leave a Comment

Please sign in to add a comment. Not a member? Join today