gpt4 book ai didi

C/C++ : Caching the Camera Data

转载 作者:太空宇宙 更新时间:2023-11-03 21:54:54 25 4
gpt4 key购买 nike

我正在通过千兆以太网接口(interface)从相机获取数据。因为数据很小,所以我想直接把它放在L1缓存中(而不是DRAM),这样处理速度很快。

我该怎么做?是否有任何编译器指令?

平台信息
Windows 7、Intel Core2Duo、Visual Studio 2010、C/C++、OpenCV。

最佳答案

Gcc 将为 -O1 -O2 -O3 的数组数据生成数据预取指令。这都是最近重新设计的。因此,_DATAPREFETCH 标志不太可能提供超过标准优化级别的任何改进。

至于绕过内存,如何为数据分配缓存标签?缓存标签是在内存获取时发出的,cpu 通过它的缓存标签在缓存中找到数据。

DuoCore 共享一个标签总线,我相信 GPU 可以卡在标签总线上,因此我们可以设想一个 I/O Controller 这样做,但我还没有找到引用资料。你的 Giga 卡插在哪个 socket 上?

(各种 cpu 系列的旧标签列表。)[ http://gcc.gnu.org/projects/prefetch.html]

" -fprefetch-loop-arraysIf supported by the target machine, generate instructions to prefetch memory to improve the performance of loops that access large arrays. This option may generate better or worse code; results are highly dependent on the structure of loops within the source code. "(gcc-4.7)[ http://gcc.gnu.org/onlinedocs/gcc-4.7.1/gcc/Optimize-Options.html#Optimize-Options ]

关于C/C++ : Caching the Camera Data,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11060781/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com