Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

How to access Cache memory

suraj_pune
ビギナー
1,603件の閲覧回数
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
0 件の賞賛
2 返答(返信)
delacy__david
ビギナー
1,603件の閲覧回数
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
TimP
名誉コントリビューター III
1,603件の閲覧回数
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.
返信