Visible to Intel only — GUID: ewa1456413600674
Ixiasoft
Visible to Intel only — GUID: ewa1456413600674
Ixiasoft
11.3.1.2. Omit Communication Hardware between the Host and the Kernel
The autorun kernel attribute notifies the offline compiler that the kernel runs on its own and does not get enqueued by any host.
To leverage the autorun attribute, a kernel must meet all of the following criteria:
- Does not use I/O channels
Note: Kernel-to-kernel channels are supported.
- Does not have any arguments
- Has either the max_global_work_dim(0) attribute or the reqd_work_group_size(X,Y,Z) attribute. If the reqd_work_group_size(X,Y,Z) attribute is used, then X , Y , and Z must be divisors of 232.
As mentioned above, kernels with the autorun attribute cannot have any arguments and start executing without the host launching them explicitly. As a result, the offline compiler does not need to generate the logic for communication between the host and the kernel. Omitting this logic reduces logic utilization and allows the offline compiler to apply additional performance optimizations.
A typical use case for the autorun attribute is a kernel that reads data from one or more kernel-to-kernel channels, processes the data, and then writes the results to one or more channels. When compiling the kernel, the offline compiler generates hardware as illustrated in Figure 36.
channel int chan_in;
channel int chan_out;
__attribute__((max_global_work_dim(0)))
__attribute__((autorun))
__kernel void plusOne () {
while(1) {
int data_in = read_channel_intel(chan_in);
write_channel_intel(chan_out, data_in + 1);
}
}