C++ cache aware programming

后端 未结 10 1449
离开以前
离开以前 2020-12-07 10:53

is there a way in C++ to determine the CPU\'s cache size? i have an algorithm that processes a lot of data and i\'d like to break this data down into chunks such that they f

10条回答
  •  一生所求
    2020-12-07 11:44

    read the cpuid of the cpu (x86) and then determine the cache-size by a look-up-table. The table has to be filled with the cache sizes the manufacturer of the cpu publishes in its programming manuals.

提交回复
热议问题