CodeXL_Quick_Start_Guide
CodeXL_Quick_Start_Guide
Table of Contents
INTRODUCTION ................................................................................................................... 3
LATEST VERSION OF THIS DOCUMENT ....................................................................... 3
PREREQUISITES ................................................................................................................... 3
DOWNLOAD AND INSTALL CODEXL ............................................................................. 4
CODEXL HELP ....................................................................................................................... 5
SYSTEM INFORMATION .................................................................................................... 6
TEAPOT SAMPLE PROJECT .............................................................................................. 8
Debug the Teapot Sample Application ........................................................................................ 9
Basic Debugging ........................................................................................................................ 10
Source Code View ..................................................................................................................... 11
Breakpoint View ....................................................................................................................... 12
Watch and Locals Views ............................................................................................................ 13
Explorer View ............................................................................................................................ 15
Call Stack View .......................................................................................................................... 18
Function Calls History View ....................................................................................................... 19
Debugged Process Events View ................................................................................................. 19
Memory View ........................................................................................................................... 19
Statistics View ........................................................................................................................... 19
MATRIX MULTIPLICATION PROJECT ........................................................................ 21
Perform CPU Profile for the Matrix Multiply Sample Application .............................................. 22
CPU Time Based Profile Navigation ........................................................................................... 22
Source Code View ..................................................................................................................... 23
Run the classic textbook sample ............................................................................................... 24
Analyzing the classic implementation ....................................................................................... 26
Analyzing the improved implementation .................................................................................. 28
D3DMULTITHREADING PROJECT............................................................................... 29
Open CodeXL D3DMultiThreading sample ................................................................................ 30
Start a Frame Analysis session .................................................................................................. 32
Capture frame for analysis ........................................................................................................ 33
Analyze a captured frame ......................................................................................................... 34
The frame timeline .................................................................................................................... 35
Navigating the frame timeline................................................................................................... 36
PROFILE MODE ................................................................................................................. 37
CPU Profiling ............................................................................................................................. 38
Overview Tab ........................................................................................................................... 39
Modules Tab ............................................................................................................................. 39
Call Graph Tab .......................................................................................................................... 40
Functions Tab ........................................................................................................................... 41
GPU Profiling ............................................................................................................................. 42
Summary Tab ........................................................................................................................... 43
Performance Counters View .................................................................................................... 44
CodeXL Explorer Tree ............................................................................................................... 45
Power Profiling ......................................................................................................................... 47
Switching to Power Profiling mode .......................................................................................... 47
Starting a new Power Profiling session .................................................................................... 47
Getting Started with CodeXL
Setting the Sampling Interval ................................................................................................... 49
Stopping a Power Profiling session .......................................................................................... 49
Power Profiling Real-Time Values ............................................................................................ 49
Power Profiling Timeline View ................................................................................................. 49
Power Profiling Summary View ................................................................................................ 51
Configuring Power Profiler Sessions ........................................................................................ 51
ANALYZE MODE ................................................................................................................ 52
Static Kernel and Shader Analysis ............................................................................................. 52
Switching to Analyze mode ...................................................................................................... 52
Creating a new project for Analysis ......................................................................................... 53
Working with the new CodeXL Analyzer Explorer Tree ........................................................... 53
Working with Programs ........................................................................................................... 56
Working with Folders ............................................................................................................... 58
Adding source files to an existing project ................................................................................ 60
Creating a new source file in an existing project ..................................................................... 61
Selecting target devices ........................................................................................................... 63
Build Options - defning kernel/shader compilation options .................................................... 64
Output Tab ............................................................................................................................... 68
Statistics Tab ............................................................................................................................ 69
Viewing compilation output: ISA and IL ................................................................................... 69
Navigating through ISA code with the Enhanced ISA View ...................................................... 71
KNOWN ISSUES ................................................................................................................. 72
SUPPORT ............................................................................................................................. 72
Prerequisites
Operating Systems
For detailed system requirements see the CodeXL Release Notes in the CodeXL
installation folder or on the Documentation section of the CodeXL web page.
For detailed system requirements see the CodeXL Release Notes in the CodeXL
installation folder or on the Documentation section of the CodeXL web page.
For Windows
1. Download the .exe file CodeXL_Win*.exe.
2. When the download completes, double-click the .exe file to install
CodeXL.
The installer guides you through the installation process.
The CodeXL Visual Studio 2010, 2012, 2013 and 2015 extensions are part
of the installer package and are installed by default.
3. In the configuration dialog, de-select the Visual Studio extensions if you
do not want to install them.
4. Launch CodeXL from C:\Program Files (x86)\CodeXL\CodeXL.exe or from
the created Desktop shortcut.
For Linux
Either install the dedicated distribution package or use the tar archive.
The default installation folder
For Red Hat and other Fedora based Linux distributions
1. Download the 64-bit Linux .rpm package CodeXL_Linux*.rpm.
2. If installed version 1. at the machine, remove it first:
$ rpm -qa | grep -i codexl
$ sudo rpm –e <package name>
3. Install the RPM package:
$ sudo rpm -Uvh CodeXL_Linux*.rpm
4. Navigate to /opt/CodeXL_X.Y-ZZZZ/
5. Launch CodeXL using ./CodeXL.
CodeXL Help
To bring up a CodeXL Help window:
1. Click on the CodeXLUser Guide link on the CodeXL startup Home Page.
OR
2. Select Help >> View Help from the CodeXL toolbar.
CodeXL Help provides some of the same information provided in this document,
but also includes additional details about CodeXL views and modules.
To bring up the CodeXL Help window for the Visual Studio extension:
1. Select CodeXL >> Help >> View Help from the VS menu.
System information
To display system information:
1. Select Tools >> System Information from the CodeXL toolbar.
The tabs let you select a category of information. The following screenshot
shows OpenCL device information for a GPU device and a CPU device on the
runtimes available locally - a 32-bit and 64-bit runtime.
See the CodeXL Help for more details about project settings.
or
2. Click on the green right arrow taskbar.
The program begins execution, and soon displays a rotating smoking teapot in a
separate window.
Basic Debugging
The CodeXL GPU Debugger lets you examine the runtime behavior of your
OpenCL/OpenGL application in detail. You can use the information it provides to
find bugs and to improve application performance. You can debug OpenCL
kernels, inspect variable values across different work items and work groups,
and inspect call stacks, among other things.
This quick start guide presumes you are familiar with the use of a GUI debugger;
so the guide provides only a quick introduction to the basic CodeXL debugging
features.
The following four buttons, at the far left of the CodeXL taskbar, let you select
Debug mode, Profile mode, Frame Analysis or Analyze mode.
These controls are (left to right): start, pause and stop debugging, frame / api /
draw step (in drop-down menu), step in, step over, step out. You can also
perform these actions from the taskbar Debug pull-down menu, or by using
function keys.
Note: host code debugging (stepping and breaking in C/C++ code) is currently
only available in the Linux CodeXL standalone application, and in Windows
CodeXL Visual Studio extension (32-bit native C/C++ target applications only). In
all other configurations, the step commands will only be enabled in kernel
debugging mode.
The following taskbar buttons show, or hide, various views.
These buttons are (left to right): CodeXL Explorer , Properties, Function Calls
History, Debugged Process Events, Call Stack, Locals, Watch, OpenGL™ State
Variables, OpenCL Multi-Watch (1,2,3), Breakpoints, Memory, and Statistics.
You can resize views, drag, and drop views to rearrange them, or move them to a
separate window. The next sections of this guide describe individual CodeXL
views in more detail.
Breakpoint View
The Breakpoint view shows active breakpoints. Initially, the Breakpoint view
shows no breakpoints:
To add a breakpoint:
1. Double-click “Double-click to add or remove breakpoints…”
A new Breakpoints window appears.
2. Select the API Functions tab to set a breakpoint on an API function, or select the
Kernel Functions tab to set a breakpoint on a kernel function.
When program execution hits a breakpoint, the Source view displays the line
where the breakpoint occurs. A yellow arrow indicates the current location.
A red dot next to the line number indicates a set breakpoint.
The Watch view shows the values and types of program variables you specify.
The Locals view displays the values and types of local variables in a kernel.
In the image above, the Watch view displays the value of variable normPos. The
Locals view displays the values of all local variables in the current kernel (in this
case, applySources in tpApplySources.cl). For a structured variable, click on
the triangle to the left of the variable name to see the name and value of each
member.
When CodeXL is in Kernel Debugging mode, move the mouse cursor to hover
over any variable name in the OpenCL kernel source code to display a tooltip
with the variable value. This is demonstrated in the screenshot below.
Multi-Watch view
The Multi-Watch view lets you compare the values of an OpenCL kernel variable
across work items and work groups.
Explorer View
The Explorer view displays OpenCL-allocated objects and OpenCL/OpenGL
shared contexts.
2. Click on Vertex Buffer object VBO 1 to display its data, with a variety of
available drop-down menu display and format options in the right-
hand panel.
You can manipulate an Image view with the following image manipulation
buttons on the CodeXL toolbar:
These buttons let you select, zoom in, zoom out, pan, enable R/G/B/alpha
channels, enable grayscale mode, enable color invert mode, original size, best fit,
and rotate CCW/CW. Hovering over the image displays pixel-specific
information (position and color) in the Image Information panel.
Alternatively, select the Data view tab of the depth buffer to display the buffer as
raw spreadsheet data rather than as an image.
Memory View
The Memory view summarizes memory use.
Statistics View
The Statistics view provides statistical information about the program. Select a
tab to choose among options, such as Function Types:
or Function Calls:
Click CodeXL -> Start Profiling or Click on the green right arrow
taskbar. (Local means local host profiling. Use the right black arrow to
configure remote host settings)
The program begins execution, and soon displays a command line window that
will run the matrix multiplication executable. Once the sample execution
completes, CodeXL will open a CPU Profile session overview that displays the
profile results.
This screenshot display the session overview window. See marked red
rectangles:
1. CodeXL Explorer - The current profile session selected in CodeXL
explorer. Double click on this node in the tree will open the session after it
is closed.
2. Functions view – display the 5 most sampled functions. See that the
function “inefficient_multiply_matrices” was sampled 490 times.
3. Modules view – display the 5 most sampled modules. In this example this
table is not useful. Use it to find inefficient modules in multiple modules
executables.
4. Profile Overview – displays general information of the session.
Executable path, working directory, etc’.
Clicking this will open the source code view for the file containing
“inefficient_multiply_matrices”.
The source code view display a line-by-line performance table for the requested
function. In this sample, we can see, marked in red in the above screenshot, that
line 126 had 100% of the samples for this function. Looking at the marked
comment we can see that the function is called 3 times, which is redundant.
To call the “classic_multiply_matrices” only once, we will change the command
line arguments.
In order to look for ideas how to improve this line, we can run an Assess
Performance session, to see how our sample is consuming the current system
resources.
1. Click on Profile -> CPU: Assess Performance to select this profile type.
2. Click on Profile -> Start Profile to run an assess performance session.
3. Look at the displayed session.
4. Right click on “classic_multiply_matrices” to see a line-by-line display of
the system resources.
In the source code view, look at the values for each of the counters for the
specified line. We can see that we have many data cache misses, which might
cause a performance bottle neck.
to this line:
matrix_r[row][outCol] = matrix_r[row][outCol] + matrix_a[row][inCol] *
matrix_b[inCol][outCol];
The improved function, for the same line, we only have 97 cache misses.
D3DMultiThreading Project
The CodeXL distribution includes a DX12 Frame Analysis sample. This sample is
a taken from Microsoft DX12 SDK and can be used to try the Frame Analysis
features in CodeXL.
Start by clicking on the D3DMultiThreading sample link in CodeXL welcome
page.
The sample project is loaded. You can see that the sample name in CodeXL
Explorer. CodeXL will also select the Frame Analysis mode for this sample.
Click on the File->Project Settings command to see the project settings for the
sample. The project Executable Path will point to CodeXL bundled
D3DMultiThreading sample.
CodeXL will open a session window. The session window monitors the
running application and will help you Capture the requested frames for later
Frame Analysis.
A frame timeline will open with the detailed trace of the D3DMultiThreading
The frame timeline view contains the following elements (from bottom to top).
Each of the elements’ numbers is in the screenshot above.
Use the left and right handles to expand/reduce the focused timeline fragment in
and out:
Double click a CPU API table item, and the timeline chart will zoom to the
corresponding timeline item and highlight it. If there is a linked GPU API item, it
will also be highlighted in the GPU API table
Select “Duration” in the top left combo box, to view the API call duration in
details:
Select “Count” in the top left combo box, to view the API calls count for each time
fragment:
Select “Concurrency” in the top left combo box, to view the max / average busy
threads concurrency over the frame timeline:
Profile Mode
CodeXL profile mode is a powerful performance analysis tool that supports CPU
and GPU profiling to provide program performance data. CodeXL profiling does
not require modifications to your source code or project. Profiling does not
require recompilation, except for CPU profiling, which requires compilation with
debugging enabled. Profiling lets you find performance hotspots and issues,
determine the top data transfer and kernel execution operations, and identify
problems such as failed API calls and resource leaks. You can use profiling to
improve application performance through proper synchronization, bottleneck
elimination, and load balancing.
CodeXL provides several modes of profiling. These modes let you assess
program performance, use instruction-based sampling (IBS) or time-based
sampling (TBS), or investigate branching, data access, instruction access, or L2
cache access. GPU profiling provides application timeline trace and performance
counter modes.
© Copyright 2016 (c), Advanced Micro Devices, Inc.
Getting Started with CodeXL
The following is a quick introduction to CPU and GPU profiling. For further
details, see the CodeXL Help information.
CPU Profiling
To profile a program:
1. Click on the profiling mode taskbar button.
2. Use the Profile drop-down menu to select the profiling mode.
For example, for CPU performance profiling, select Profile >> CPU: Assess
Performance.
3. Click the start button to launch the application for profiling.
4. To stop it, use the stop button any time during profiling. The bottom of the
CodeXL window displays the elapsed clock time.
Profiling is available up to the time the application is closed. For the teapot
example: click on the ‘x’ in the upper right corner of the teapot window.
After profiling is complete and data translation is over, a node in the left session
tree is added for this session.
The first page shown is the overview page. It shows the Modules and Functions
tables and a brief description of the execution environment and profile detail. If
multiple processes are profiled, then the Process table is shown. Each table
shows the top five hot items.
Modules Tab
Functions Tab
GPU Profiling
For GPU application timeline trace profiling:
1. Click on the profiling mode taskbar button.
2. Select Profile >> GPU: Application Timeline Trace from the Profile drop-
down menu.
3. Run the program, then let it complete, or terminate it.
An Application Timeline Trace view appears with a timeline of the
program execution. This timeline shows the created OpenCL contexts
and command queues, as well as the relationships between them.
To select a subrange of the timeline, hold down <Ctrl>, and click and
drag on a section of the timeline.
To shift the timeline display left or right, simply click on it and drag.
To zoom in/out, use the mouse wheel or the +/- keys. Selecting a small
subrange lets you zoom in to see details about each event.
For additional information, hover over an event; this displays a pop-up.
The following screenshot is an example of a COPY_BUFFER_TO_IMAGE data
transfer event at 7752.980 ms on the timeline. The pop-up provides detailed
timing data.
Summary Tab
The Summary tab provides several options for viewing profiling data: API,
context, kernel, top 10 data transfer, top 10 kernel, warnings/errors.
The following screenshot shows an example of a Top 10 Kernel Summary.
A pull-down bar at the top of the window under the Code Viewer tab (see
following screenshot) lets you select OpenCL source (CL), intermediate language
(IL), or instruction set architecture (ISA) code.
The Explorer view lets you switch between profiling sessions. This view lists all
profiling sessions for the current project.
After switching to Power Profiling mode, double click New Power Session… in
the CodeXL Explorer tree.
Please note that if your hardware does not support Power Profiling, you will not
be able to start the session.
After double clicking on New Power Session… in the CodeXL Explorer tree, an
empty Power Profiling session window will be opened.
Clicking the Start button will start the session with the current configuration.
We will now see how to change a Power Profiling session’s configurations.
To configure the sampling interval (the time period which will pass between
every two consecutive samples of the active counters), click on Profile->Profile
Settings -> Power Profile:
Please note that the current minimum sampling interval is 100 milliseconds.
Click OK to apply your changes.
Stopping a Power Profiling session
Throughout the Power Profiling session, the collected data will be streaming in
real-time to the graphs. There are two tabs that present data: Timeline View and
Summary View.
Power Profiling Timeline View
The Power Profiler Timeline View displays the measured values of the activated
counters throughout the session. The horizontal axis of all charts represents the
time that has passed since the beginning of the session. During profiling sessions,
© Copyright 2016 (c), Advanced Micro Devices, Inc.
Getting Started with CodeXL
all of the charts in the Timeline View are being updated in real-time with the
measured values which are streaming in. The uppermost ribbon (titled “Total
APU Power”) displays the overall power consumption of the APU throughout the
session.
The top chart has an adjustable range slider that controls the display of all the
other timeline charts. By performing such actions as dragging the slider
sideways, extending or retracting it, you set the scope of attention and the focus
of the timeline charts. Each of the charts below displays only the data that was
collected in the time range corresponding to the slider’s position and length.
That is, the data in all timeline charts, except for the Total APU Power chart itself,
is dictated by the time range which is selected by the Total APU Power chart’s
range slider.
Below the Total APU Power ribbon, you will find additional ribbons containing
more graphs, according to the set of activated counters: A Power chart which
displays the power consumed by specific APU components (such as CPU cores or
integrated GPU), a Frequency chart which displays the frequency of the selected
components, a Temperature chart which displays the thermal trend of the
selected components, and a CPU State chart which displays the CPU core states.
The APU Power graph is always displayed, since the Total APU Power counter is
activated by default and cannot be deactivated. The other charts (frequency,
temperature and CPU core state) are optional, and will only be displayed if the
relevant counters were activated.
To the right side of each chart you will find a legend that displays the measured
values at a specific point in time. To change the point in time for which the values
are displayed, reposition the mouse cursor horizontally on one of the graphs. The
list of counters in the legends is customizable, and specific counters can be
removed/added between profile sessions.
The Power Profiler Summary View displays an analysis of the values measured
throughout the session. Similarly to the Timeline View, this view is updated in
real-time when power profiling sessions are running.
At the upper-left side of the summary view, you can see the session duration
which is the amount of time that the profiling session was in progress.
The following Power histograms graphs are plotted in the Summary View:
Total Energy Consumption
This histogram graph displays the cumulative energy consumed by the APU
and discrete GPU components, measured in Joules.
Average Power Consumption
This graph displays the average power consumption of the APU and the
discrete GPU components, measured in Watts.
If CPU or GPU frequency counters were activated for the session, you will find
additional histogram graphs below the Power graph in the Summary View:
CPU Frequency Graph
This stacked histograms graph displays for each CPU core how much time it
spent at each frequencies range.
GPU Frequency Graph
This graph displays how much time the GPU spent at each frequencies range.
Configuring Power Profiler Sessions
For further configuration options of the Power Profiler such as selecting which
counters will be sampled and launching an application when the session begins,
see the CodeXL User Guide by selecting from the menu bar Help -> View Help.
© Copyright 2016 (c), Advanced Micro Devices, Inc.
Getting Started with CodeXL
Analyze Mode
Static Kernel and Shader Analysis
In Analyze mode, you can compile and generate performance statistics for
OpenCL kernels, DirectX Shaders, OpenGL Programs and Vulkan Programs. The
compilation and statistics generation process can be targeted at a variety of AMD
GPUs and APUs, independent from the actual type of GPU/APU that is installed
on your system. Using the Analyzer, you can generate and inspect performance
statistics, ISA code, IL code and D3D ASM code.
Switching to Analyze mode
Option 1:
Option 2:
Click on the “File->Create Project”, or use the Ctrl+N shortcut. The following
CodeXL Project Settings dialog will appear:
If you are familiar with the former versions of the Analyzer, you probably noticed
that the tree has a different structure than the one used in previous versions.
Let’s examine the structure of the new CodeXL Analyzer Explorer:
1. The Source Files pool: this is a logical container that holds all of the source files that
have been added or created in the project since its creation. Note that source files
cannot be built directly from the pool. In order to build a source file, we first need to
attach it to a suitable Program or a Folder. This can be easily done by dragging the
source file from under the Source Files pool to the relevant program or folder. The
next item in this section discusses the concept of Programs and Folders in more
detail.
2. Programs and Folders: before describing how to technically create Programs and
Folders, let’s first discuss what those objects are, and why they can be useful.
a. Programs (OpenGL, Vulkan):
As of version 2.0, CodeXL can compile and link together multiple
source files for OpenGL and Vulkan. This is especially important when
different shaders have mutual impact on one another’s ISA and
performance statistics. To provide that type of support, CodeXL
Analyzer introduced the concept of a Program. There are two types of
Programs in CodeXL 2.0:
- Rendering Programs
- Compute Programs
You may ask yourself why CodeXL does not support the concept of DirectX
Programs, just like it does for OpenGL and Vulkan. This is a good point.
Supporting DirectX Programs is at a high priority in the Analyzer’s roadmap, and
we will do our best to add that feature in the upcoming versions of the product.
Creating a new Program or Folder
To create a new Program or a Folder, double-click on the “Create new
program/folder” item in CodeXL Analyzer Explorer Tree:
After creating a new program, you will see that it contains an empty placeholder
for every pipeline stage. Right-click on any stage to add an existing shader or
create a new one:
Note: You can also double-click on a stage to create a new shader and
automatically attach it to that Program’s stage.
Whether you chose to create a new shader or to attach an existing one, after the
shader is added to the program, it will also being listed under the Source Files
pool for future use. This will enable you to attach that specific shader to other,
You can also select the Program and manually click on the Build button in the
Analyzer toolbar:
After creating a new OpenCL or DirectX Folder, an empty Folder would be listed
in the Explorer Tree:
To create a new source file, and automatically add it to the Folder, double-click
on the “Create new source file item…” item of the folder:
To add an existing source file, and automatically add it to the Folder, double-click
on the “Add existing source file item…” item of the folder:
After adding source files to the Folder, they will be listed both under the active
Folder and under the Source Files pool (for future use):
To configure the build properties of a source file under a specific Folder, click on
that source file and use the Analyzer toolbar’s Type and Entry point drop-down
lists. The first sets the type of the shader and the latter specifies the specific
target shader (among the shaders in the source file). This configuration is Folder-
specific. That is, the same source file can be set with different properties under
different Folders. CodeXL will remember those configurations for you.
To configure the build properties of the Folder, click on the Folder and adjust the
enabled items in the Analyzer toolbar. For CodeXL 2.0, this is only relevant to the
DX Shader Model property of DX Folders:
Unlike the case with Programs, Folders are more flexible as they allow you to
build selected source files, without being required to build the whole Folder. To
build selected source files, click on the selected source files under the program,
while holding the Ctrl key. Then, right-click on one of the selected files and select
the build option:
The previous sections described how to add existing source files to specific
Programs or Folders. You can also add existing source files to the Source Files
pool of a project, without attaching the files to any Program or Folder. To do so,
The previous sections described how to create a new source files and attach it to
a specific Program or Folder. You can also create new source files which will only
be added to the Source Files pool of a project, without attaching the files to any
Program or Folder. To do so, double click on the “Create new source file…” node
under the Source Files pool:
As a last step, you need to select what to do with that file using the Associate
with program drop-down list:
CodeXL Analyzer can target a variety of devices, independent of the device that is
physically installed on your system. To select the target devices, for which the
build would be performed, first click on the Select Devices button in the Analyzer
toolbar:
Then, the CodeXL Options dialog would pop-pup with its Analyze tab activated.
The devices are grouped by generations. You can use the check boxes to select
and remove devices:
In the Static Analyze toolbar, there is a text box where you can manually define
specific OpenCL/HLSL build options (there is no support for GLSL build options):
Note: The display of this toolbar is dynamic; you can set it from the right-click
menu in the main CodeXL frame:
The Build Options box is a place to set compiler build flags such as –x clc++ or
–o3. Any compiler build flag can be placed in this box.
This dialog will help you choose the correct OpenCL build options for you and
hopefully will prevent you from making spelling mistakes while typing the
options manually.
To open the OpenCL Build Options dialog, press the Button. You can
browse between the ‘General & Optimization’ tab and the ‘Other’ tab to view all
the available options. Once you choose an option, the option text will appear in
the text box below marked as ‘OpenCL Build Command Line’. This string will also
appear in the menu bar after you click the OK button.
© Copyright 2016 (c), Advanced Micro Devices, Inc.
Getting Started with CodeXL
Typing the command line in the text box will also mark the corresponding check
boxes in the dialog.
This dialog will help you choose the correct DirectX build options for you and
hopefully will prevent making spelling mistakes while typing the options
manually.
To open the dialog, press The Button. The dialog will be opened. Click
the”HLSL Build Options” node to view the available options.
Once you choose an option, the option text is displayed in the”HLSL Build
Command Line” text box that appears below.
This build option string will also appear in the toolbar’s build options box after
you click the OK button.
As an alternative to selecting options through the radio buttons, it is possible to
type a command in the “HLSL Build Command Line” text box. Build options types
in the text box will automatically be translated to update of the relevant controls
accordingly. For example, typing “D3DCOMPILE_DEBUG” in the lower text box
automatically updates the “Debug” check box to be checked.
Output Tab
The compiler output appears in the Output tab. The example below shows
successful builds (no warnings or errors) for 4 devices.
If errors occur, the output will display the error and the line in which the error
occurred.
If there were errors, the output pane will display the error and the line where the
error occurred:
Double clicking on an error navigates the user to the Source Code view,
displaying the kernel/shader source code:
The Statistics tab gives detailed statistics for the selected kernel/shader for each
target device. To open the Statistics tab, expand the desired kernel in the project
tree, and double-click the Statistics node:
Note: the statistics tab for pre-GCN devices (v4 & v5 generations) is a bit
different. For more information, see the complete help manual document.
Viewing compilation output: ISA and IL
The performance statistics tab will be opened automatically when the build
process is over. To view the compilation output, double click the node of the
desired ASIC in the explorer tree, under the Program/Folder and configuration
(32-bit or 64-bit):
This will open a tab containing the source code, the IL and the ISA. The program
source code and the AMD IL code will be presented as standard text documents.
The ISA will be presented in the “Enhanced ISA View” for GCN devices, and as a
standard text document for pre-GCN devices.
The context menu enables to display/hide line numbers for each source
code/IL/ISA tab.
Using this view, you can inspect the ISA code of GCN devices and see the
estimation for instruction cost in clock cycle. The view contains 5 columns:
- Address: the instruction’s offset within the program (in bytes)
- Opcode: the operation to be performed
- Operands: the data for the operation
- Cycles: the number of clock cycles which are required by a Compute Unit
in order to process the instruction for a 64-thread Wavefront, while
neglecting the system load and any other runtime-related factor.
- Instruction Type: the category of instructions to which the instruction
belongs
- Hex: binary representation of the instruction, in hexadecimal format
Notes:
1. Note that code labels which appear in the Operands column are clickable. By
clicking on a label link, you can navigate to the label’s spot in the code.
2. Note that this view is only available for GCN devices. For pre-GCN devices, the
plain textual ISA view will be displayed.
Known Issues
For a list of known CodeXL issues, review the release notes on the CodeXL web
page and the AMD Developer Tools CodeXL forum:
https://github.com/GPUOpen-Tools/CodeXL/issues
Support
AMD general developer support page:
http://developer.amd.com/support/
Tools & SDKs section in AMD Developer Tools website:
http://developer.amd.com/tools-and-sdks/
OpenCL Zone in AMD Developer Tools website:
http://developer.amd.com/tools-and-sdks/opencl-zone/