Intel® oneAPI DPC++/C++ Compiler Developer Guide and Reference

ID 767253
Date 3/22/2024
Public
Document Table of Contents

code_align

Specifies the byte alignment for a loop.

Syntax

Windows

[[clang::code_align(n)]]

Linux

__attribute__((code_align(n)))

or

[[clang::code_align(n)]]

Arguments

n

Optional. A positive integer constant initialization expression indicating the number of bytes for the minimum desired alignment boundary. Its value must be a power of 2, between 1 and 4096, such as 1, 2, 4, 8, and so on.

If you specify 1 for n, no alignment is performed. If you do not specify n, the default alignment is 16 bytes.

Description

This attribute must precede the loop to be aligned.

If a procedure has the code_align(k) attribute and another code_align(n) attribute precedes a loop, then both the procedure and the loop are aligned on a max(n,k) byte boundary.