C++ cache aware programming

后端 未结 10 1448
离开以前
离开以前 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:18

    Depending on what you're trying to do, you might also leave it to some library. Since you mention multicore processing, you might want to have a look at Intel Threading Building Blocks.

    TBB includes cache aware memory allocators. More specifically, check cache_aligned_allocator (in the reference documentation, I couldn't find any direct link).

提交回复
热议问题