C ++缓存感知编程 [英] C++ cache aware programming

查看:177
本文介绍了C ++缓存感知编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法在C ++中确定CPU的缓存大小?我有一个算法,处理大量的数据,我想把这些数据分成块,使其适合缓存。这可能吗?
你能给我提供任何关于编程cache-size的提示(尤其是关于多线程/多核数据处理)?

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 fit into the cache. Is this possible? Can you give me any other hints on programming with cache-size in mind (especially in regard to multithreaded/multicore data processing)?

谢谢! p>

Thanks!

推荐答案

这是我对另一个问题的回答的副本,但这里:

This a copy of my answer to another question, but here goes:

这里有一个链接,关于缓存/内存的一篇非常好的论文

Here's a link to a really good paper on caches/memory optimization by Christer Ericsson (of God of War I/II/III fame).

这是一对夫妇,但它仍然非常相关。

It's a couple of years old but it's still very relevant.

这篇关于C ++缓存感知编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆