C++ cache aware programming

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

    The cache will usually do the right thing. The only real worry for normal programmer is false sharing, and you can't take care of that at runtime because it requires compiler directives.

提交回复
热议问题