Visible to Intel only — GUID: GUID-60C6C1BD-01BB-4C7D-ABFA-6E88207497F9
Visible to Intel only — GUID: GUID-60C6C1BD-01BB-4C7D-ABFA-6E88207497F9
Using Structs
Intel®SDK for OpenCL™ Applications standalone version supports user-defined structs. To use structs for kernel analysis, you need to define them:
- Go to Analyze > Struct Management.
- Choose data type and enter fill name.
- Click Add to add a new field.
- Click OK to save the created field.
After defining the struct, you can select is as type when creating a buffer variable:
A CSV file for a struct buffer should have the following format:
- Line numbers should be greater or equal to the buffer size.
- Each line should contain all concatenated data fields.
For example:
typedef struct Point { int x; int y; float value; }
For a buffer of size 4, the CSV file contains:
0,1,3.56 1,1,33.7 1,0,12.58 0,0,4.85 .
Zero and random values are available as with regular-type buffers.
You can edit a struct. In such case any buffer using the struct reinitializes with the new data.
You can delete a struct as long as other structures or buffer variables do not use it.
When working with uniform variables, fill the values in the pop-up dialog for every field to insert values for the struct. For example: