xcl_zero_global_work_offset - 2021.2 English

Vitis Unified Software Platform Documentation: Application Acceleration Development (UG1393)

Document ID
UG1393
ft:locale
English (United States)
Release Date
2021-12-15
Version
2021.2 English

Description

If you use clEnqueueNDRangeKernel with the global_work_offset set to NULL or all zeros, use this attribute to tell the compiler that the global_work_offset is always zero.

This attribute can improve memory performance when you have memory accesses like:

A[get_global_id(x)] = ...;
Note: You can specify REQD_WORK_GROUP_SIZE, VEC_TYPE_HINT, and XCL_ZERO_GLOBAL_WORK_OFFSET together to maximize performance.

Syntax

Place this attribute before the kernel definition or the primary function specified for the kernel.

__kernel __attribute__((xcl_zero_global_work_offset))
void test (__global short *input, __global short *output, __constant short *constants) { }