首页 \ 问答 \ CUDA全局内存事务的成本(The cost of CUDA global memory transactions)

CUDA全局内存事务的成本(The cost of CUDA global memory transactions)

根据CUDA 5.0编程指南,如果我同时使用L1和L2缓存(在Fermi或Kepler上),所有全局内存操作都是使用128字节内存事务完成的。 但是,如果我仅使用L2,则使用32字节内存事务(第F.4.2章)。

我们假设所有缓存都是空的。 如果我有一个warp,每个线程以完全对齐的方式访问一个4字节字,这将导致L1 + L2情况下的1x128B事务,以及仅L2情况下的4x32B事务。 是对的吗?

我的问题是 - 4个32B交易是否比单个128B交易慢? 我对前费米硬件的直觉表明它会更慢,但也许在新硬件上不再如此? 或者我可以只看一下带宽利用率来判断我的内存访问效率?


According to CUDA 5.0 Programming Guide, if I am using both L1 and L2 caching (on Fermi or Kepler), all global memory operations are done using 128-byte memory transactions. However, if I am using L2 only, 32-byte memory transactions are used (chapter F.4.2).

Let us assume that all caches are empty. If I have a warp, with each thread accessing a single 4-byte word, in a perfectly aligned fashion, this will result in 1x128B transaction in L1+L2 case, and in 4x32B transaction in L2-only case. Is that right?

My question is - are the 4 32B transactions any slower than a single 128B transaction? My intuition from pre-Fermi hardware suggests that it would be slower, but perhaps this is no longer true on the newer hardware? Or maybe I should just look at the amount of bandwidth utilization to judge the efficiency of my memory access?


原文:https://stackoverflow.com/questions/12798503
更新时间:2022-04-05 08:04

相关问答

更多
  • 我写了jsPerf使用的Benchmark.js 。 “ ops/sec ”代表每秒的操作。 这是测试预计在一秒钟内执行多少次。 重复执行测试,直到达到测量小于或等于1%的百分比不确定度所需的最短时间。 迭代次数取决于环境计时器的分辨率以及测试可以在最短运行时间内执行多少次。 我们收集完成的测试运行5秒(可配置)或至少5次运行(也可配置) ,然后对样本执行统计分析。 因此,测试可能会在50 ms重复100,000次(大多数环境的最短运行时间) ,然后重复100次( 5秒) 。 较大的样本量(在本例中为100 ...
  • 在这种情况下我通常会做什么,我会在第一个电话中添加一个点: val m2 = List(1->"a",2->"b").map {case (k,v) => (k.toString,v)}.toMap 就个人而言,我更喜欢这个有额外的括号。 What I usually do in this situation, I'll add a dot to the first call: val m2 = List(1->"a",2->"b").map {case (k,v) => (k.toString,v)}. ...
  • 嘿,我是jsPerf的创造者。 最快的测试(s)得到绿色背景。 最慢的测试(s)得到粉红色/红色背景。 见下文。 这意味着测试可以每秒运行约95,814,583次。 ±1.95是误差范围。 (有关更多信息,请参阅下文。) “最快”意味着这是测试案例中最快的测试。 慢19%意味着这个测试比测试案例中最快的测试慢19%。 有关以下内容的详细说明,请参阅John-David Dalton对“jsPerf如何工作?”的回答 : 什么是“ops / sec”? 它做了多少次迭代? 它在什么基础上计算哪个更快? 这些计 ...
  • jsperf是基于benchmarkjs,因此使用在线代码编辑器(如jsfiddle , jsbin , plunker等),并且包括benchmarkjs作为库将会做。 您不会拥有的唯一功能将是每个浏览器的编译结果。 这只是一个临时的选择。 这是一个jsfiddle模板: https ://jsfiddle.net/533hc71h/ 但是由于我们并不关心html或css,我发现plunker更适合。 再加上systemj,您可以将代码分成多个文件。 以下是模板: https : //plnkr.co/e ...
  • 请参阅https://github.com/bestiejs/benchmark.js/blob/7fc4c3cf7c4bccff4dbce58883a4181c2e830f85/example/jsperf/ui.js#L556 : percent = (1 - (hz / fastestHz)) * 100 See https://github.com/bestiejs/benchmark.js/blob/7fc4c3cf7c4bccff4dbce58883a4181c2e830f85/example ...
  • 它允许您在后缀位置使用操作符语法。 例如 List(1,2,3) tail 而不是 List(1,2,3).tail 在这个无害的例子中,这不是一个问题,但它可能导致歧义。 这不会编译: val appender:List[Int] => List[Int] = List(1,2,3) ::: //add ; here List(3,4,5).foreach {println} 并且错误消息不是很有帮助: value ::: is not a member of Unit 它尝试调用:::方 ...
  • random_ops.random_normal()返回一个张量,而不是一个Variable object , training_ops.apply_rms_prop(...., rnd, ...).op需要。 所以我导入变量ops,by from tensorflow.python.ops import variables 并构造Variable object rnd 。 毕竟,它的工作原理。 random_ops.random_normal() returns an tensor, instead a ...
  • 我在这里和这里写了几篇博客文章来解决这个问题。 第一部分详细介绍了解决方案的内部结构,第二部分介绍了如何使用scenerio。 这是一个基于你的对象Load / Loaded的伪示例: - AsyncOperation Load(YourObject subject, TextBox target) { return (completed) => { EventHandler eh = null; eh = (s, args) => ...
  • 您的解决方案看起 要获得* Magick推荐的“sigma”,即0.5到0.7,如果他们使用对角线为3000或4000像素的图像,他们必须加入0.1的百分比。 半径应该是整数,是西格玛的2或3倍。 如果没有给予Magick,Sigma默认为1。 Your solution looks reasonable. To get the "sigma" recommended by *Magick, which is 0.5 to 0.7, they'd have to put in percentages lik ...
  • 如果您查看表单中准备代码字段旁边的帮助文本: 在每个时钟测试循环之前运行,在定时代码区域之外 这意味着代码在每个测试用例之前运行,而不仅仅是一次。 因此,在第二个测试用例中,每个元素都有两个事件处理程序,第三个测试用例中有三个事件处理程序。 这就是为什么在准备区域下面有一个“拆解”字段的原因:它应该用于撤消你在设置中所做的事情以避免这样的情况。 如果你把这个添加到拆解: $(".target-element", "#context1").off("click"); 然后在添加新事件处理程序之前删除现有的事 ...

相关文章

更多

最新问答

更多
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)
  • 是否可以嵌套hazelcast IMaps?(Is it possible to nest hazelcast IMaps? And whick side effects can I expect? Is it a good Idea anyway?)
  • UIViewAnimationOptionRepeat在两个动画之间暂停(UIViewAnimationOptionRepeat pausing in between two animations)
  • 在x-kendo-template中使用Razor查询(Using Razor query within x-kendo-template)
  • 在BeautifulSoup中替换文本而不转义(Replace text without escaping in BeautifulSoup)
  • 如何在存根或模拟不存在的方法时配置Rspec以引发错误?(How can I configure Rspec to raise error when stubbing or mocking non-existing methods?)
  • asp用javascript(asp with javascript)
  • “%()s”在sql查询中的含义是什么?(What does “%()s” means in sql query?)
  • 如何为其编辑的内容提供自定义UITableViewCell上下文?(How to give a custom UITableViewCell context of what it is editing?)
  • c ++十进制到二进制,然后使用操作,然后回到十进制(c++ Decimal to binary, then use operation, then back to decimal)
  • 以编程方式创建视频?(Create videos programmatically?)
  • 无法在BeautifulSoup中正确解析数据(Unable to parse data correctly in BeautifulSoup)
  • webform和mvc的区别 知乎
  • 如何使用wadl2java生成REST服务模板,其中POST / PUT方法具有参数?(How do you generate REST service template with wadl2java where POST/PUT methods have parameters?)
  • 我无法理解我的travis构建有什么问题(I am having trouble understanding what is wrong with my travis build)
  • iOS9 Scope Bar出现在Search Bar后面或旁边(iOS9 Scope Bar appears either behind or beside Search Bar)
  • 为什么开机慢上面还显示;Inetrnet,Explorer
  • 有关调用远程WCF服务的超时问题(Timeout Question about Invoking a Remote WCF Service)