opencl之code builder学习教程4
以下文章中缺少图片,请在百度网盘下载word观看
https://pan.baidu.com/s/1nuI2dRV
https://download.csdn.net/download/qccz123456/10567840
Debugging OpenCL™ Kernels on GPU
Intel® SDK for OpenCL™ Applications delivers aseamless debugging experience that enables you to debug both CPU and GPUportions of your application simultaneously.
This chapter provides OpenCL GPU Debuggerinstallation walkthrough and demonstrates how to use the debugger to debug anOpenCL sample application.
Usually the process requires two separatemachines (host machine and target machine) todebug OpenCL kernels on the GPU (unless you have a discrete graphics card, whenhost and target machines can be the same machine physically):
· HostMachine - The machineused for running the debugger (GDB or Microsoft Visual Studio* 2015/2017) andcontrolling the debugging process.
· TargetMachine - The machine usedfor running the OpenCL host app and kernel under debug.
NOTE: The reason forusing two separate machines is because the GPU is hung on the OpenCL kernelwhile it is under debugging. Therefore, the UI rendering seems frozen while itwaits for the GPU to render UI/desktop.
For more information, see the followingtopics:
· OpenCL™GPU Kernel Debugger for Windows*
· OpenCL™GPU Kernel Debugger for Linux* Beta
OpenCL™ GPU Kernel Debugger forWindows*
This chapter describes how to install theOpenCL™ Kernel Debugger on Microsoft Windows* OS and demonstrates how to use itfor debugging an OpenCL application.
For details, see the following topics:
· InstallingOpenCL™ Kernel Debugger for Windows*
· DebuggingOpenCL™ Kernels
Installing OpenCL™ KernelDebugger for Windows*
This topic provides a walkthrough for the installation of theOpenCL™ GPU Debugger on a Microsoft Windows* OS.
Supported OSes andPrerequisites
OpenCL™ Kernel Debugger for Windows* can be installed and run onthe following operating systems:
· Windows 7 (64-bit)
· Windows 8.1 (64-bit)
· Windows 10 (64-bit) (preferred)
Host machine
As a host machine you can use any machine with an Intel® CPUrunning a supported Windows* OS.
Target machine
A target machine is a 6th or 7th Generation Intel® Core™Processors machine running a supported Windows OS (Windows 10 is preferred)with the latest Graphics Driver is installed.
Installing OpenCL™ KernelDebugger
Installation of the OpenCL™ Kernel Debugger on Windows machinerequires installation on both host and target machines.
Installing on the Host
To install the debugger on the host machine, use the followingsteps:
1. Launch the Intel® SDK for OpenCL™ Applications installer andensure that IntelDebugger for Heterogeneous Compute is selected in the listof components to install.
2. Select either option you like and click Install:
3. Check the Opentarget installer folder option. Pay attention to thelocation of the target installer (in this instance it's C:\Intel\OpenCL\debugger), youwill need it for installing on the target machine:
NOTE: Rebootis required (usually for environment variables to propagate after setup), somake sure you reboot prior to the first usage.
Installing on the Target
The target machine is the machine used for running the OpenCLhost application under debug. This is usually a different machine (not thehost), unless you have a discrete graphics card used for displaying the WindowsDesktop, in which case host and target can be the same machine. Complete thefollowing steps to install the debugger on your target machine:
1. Copy the gen_debugger_target_*.msi installerfile from the host machine (from C:\Intel\OpenCL\debuggerbydefault) to your target machine.
2. Launch the installer and follow the instructions:
3. Click Finish andreboot the machine:
If you want to (remotely) debug your OpenCL kernels usingMicrosoft Visual Studio* 2015/2017, the following additional steps arerequired.
NOTE: Youcan skip these steps if you already have Visual Studio 2015/2017 installed onyour target machine.
To debug through Visual Studio 2015, do the following:
1. Open an elevated command prompt on your target machine
2. Create the RemoteDebugger directory: mkdirC:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Remote Debugger
3. Copy the entire folder C:\Program Files (x86)\Microsoft Visual Studio14.0\Common7\IDE\Remote Debugger from your host machine toyour target machine (into the same directory hierarchy)
4. Create a desktop shortcut (optional):
a. Open C:\Program Files(x86)\Microsoft Visual Studio 14.0\Common7\IDE\Remote Debugger\x64
b. Right-click on msvsmon.exe > Send to > Desktop (create shortcut),rename the shortcut to VS2015Remote Debugger.
If you wish to debug through Visual Studio 2017, do thefollowing:
1. Open an elevated command prompt on your target machine
2. Create the
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
