Kepler 中的二级缓存 [英] L2 cache in Kepler

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

问题描述

L2 缓存如何在具有 Kepler 架构的 GPU 中根据引用的局部性工作?例如,如果一个线程访问全局内存中的一个地址,假设该地址的值不在二级缓存中,那么该值是如何被缓存的?是暂时的吗?或者该地址的其他附近值是否也被带到 L2 缓存(空间)?

How does L2 cache work in GPUs with Kepler architecture in terms of locality of references? For example if a thread accesses an address in global memory, supposing the value of that address is not in L2 cache, how is the value being cached? Is it temporal? Or are other nearby values of that address brought to L2 cache too (spatial)?

下图来自 NVIDIA 白皮书.

Below picture is from NVIDIA whitepaper.

推荐答案

在计算能力 2.0 及更高版本中引入了统一二级缓存,并继续在 Kepler 架构上得到支持.使用的缓存策略是 LRU(最近最少使用),其主要目的是避免全局内存带宽瓶颈.GPU 应用程序可以展示两种类型的局部性(时间和空间).

Unified L2 cache was introduced with compute capability 2.0 and higher and continues to be supported on the Kepler architecture. The caching policy used is LRU (least recently used) the main intention of which was to avoid the global memory bandwidth bottleneck. The GPU application can exhibit both types of locality (temporal and spatial).

每当尝试读取它在缓存 L1 和 L2 中查找的特定内存时,如果未找到,它将从缓存行加载 128 字节.这是默认模式.从下图中可以理解为什么 128 位访问模式会产生好的结果.

Whenever there is an attempt read a specific memory it looks in the cache L1 and L2 if not found, then it will load 128 byte from the cache line. This is the default mode. The same can be understood from the below diagram as to why the 128 bit access pattern gives the good result.

这篇关于Kepler 中的二级缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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