Use the CUDA Warp Watch

VS2010的局部变量和全局变量工具窗口只支持在一个thread中查看变量一次,Nsight Debuger使用current focus thread and stack frame来计算这些表达式。

Nsight提出cuda Warp Watch的工具窗口,可以展示一个单独的focused Warp中的表达式的值的信息。

To use the CUDA Debugger Warp Watch feature: 
  1. 首先在VS中进入调试状态
  2. 从Nsight菜单中,选择Windows > CUDA Warp Watch. 
  3. 选择合适的Warp Watch窗口。



  4. 选择后,你可以在Warp Watch窗口中添加自己的表达式来观察,当Debugger遇到断点或异常而停止时,将会计算表达式的值

     

  5. 右击工具窗口,表达式可以从Warp Watch菜单中编辑

    The features shown here include the following: 
    • Add Watch - Adds a new expression to the Watch window. (You can use F2 to edit the expression in the current column.) 
    • Copy column - This will copy elements to the clipboard so they may be pasted into another document (e.g., a spreadsheet).
    • Delete Watch / Clear All - Deletes the current expression, or deletes all expressions that have been entered.
    • Hexadecimal Display - This menu item controls the Visual Studio global hexadecimal display setting. It is the same setting used in the Visual Studio watch, locals, and autos windows.
  6. CUDA focus可以通过以下四个工具窗口来改变
    • CUDA Focus Picker
    • CUDA Info Pages
    • The Next / Previous warp commands
    • A suspend event

    The view updates when the current CUDA focus changes, and always shows the warp that contains the current focus thread.

     

 

Example Scenarios

Example: Diverged Warp Watch

In this scenario, the lane is at a different PC than the focus lane. Lanes diverged from focus have a gray background.

Note this is NOT the same as inactive lanes. You can change to an inactive lane, and the other lanes will show diverged.


 
Example 1. An example of a successful evaluation, diverged at lane 16. In this figure, the focus is lane 16.


 
Example 2. Changing to a different focus shows the other lanes as diverged from focus. (This is represented by reversing the white and gray backgrounds.) In this instance, the lane was changed to 0, so lanes 16-31 are now gray; the PC is at line 54.


 
Example 3. Here, you can see that it is possible to have a variable that is valid in some lanes, but not in others.

Example: Error Types

Errors can occur for various reasons within the warp watch. For example: 

  • A lane may be at a different PC; hence the evaluation scope of a given expression could be different.
  • A shadow variable could be a different type than the focus lane.

 
Example 4. This illustrates a shadow variable error. Here, the focus variable's type isfloat, but it is shadowing anint.

 

Another common cause for error is when the lane has diverged from the focus lane and is in a different stack frame. The CUDA Warp Watch feature does not evaluate in other stack frames.

 
Example 5. This illustrates a stack frame error. Here, the frame "SubFrame" does not exist in the even lanes, hence it cannot evaluate.

 

Warp Exceptions

The CUDA Memory Checker shows results in the Warps Page of the CUDA Info window. Select theWarp Exceptions bookmark, and it will filter to show any warp that is currently at an exception. These exceptions will match the output in the Output window.

When an exception is detected, the CUDA Debugger will stop in the first CUDA thread that triggered the exception. Use theSet Focus command in the Lanes and Warps pages, to switch to other threads.


Figure 1. A misaligned load in Global memory. The exception is being hit on the first 16 lanes in 5 warps.


Figure 2. The focus lane shows that 16 of the lanes have hit the exception.

  

转载于:https://www.cnblogs.com/Vulkan/archive/2012/09/27/7530258.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值