Advertisement
Guest User

CacheLineSize

a guest
Sep 8th, 2012
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. uint core::CacheLineSize()
  2. {
  3.     int cacheLineSize = 0;
  4.     int cpuInfo[4] = {-1};
  5.     __cpuid(cpuInfo, 0x80000000);
  6.     uint nExIds = cpuInfo[0];
  7.     if( 0x80000006 <= nExIds )
  8.     {
  9.         __cpuid(cpuInfo, 0x80000006);
  10.         cacheLineSize = cpuInfo[2] & 0xff;
  11.     }
  12.     return cacheLineSize;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement