Loop Unrolling Transformation: Difference between revisions

Jump to navigation Jump to search
Line 25: Line 25:
Pragmas are compiler directives that influence how a compiler processes specific sections of code, such as loops. They offer direct control over transformations like loop unrolling, bypassing the compiler's default heuristics. This allows developers to optimize for performance or code size, depending on the application requirements. Below are pragma options available for different compilers.
Pragmas are compiler directives that influence how a compiler processes specific sections of code, such as loops. They offer direct control over transformations like loop unrolling, bypassing the compiler's default heuristics. This allows developers to optimize for performance or code size, depending on the application requirements. Below are pragma options available for different compilers.


==== '''Generic Pragmas (Applicable across multiple compilers)''' ====
==== Generic Pragmas (Applicable across multiple compilers) ====
* <code>#pragma unroll(n)</code> — Requests the compiler to unroll the loop by a factor of n.
* <code>#pragma unroll(n)</code> — Requests the compiler to unroll the loop by a factor of n.
* <code>#pragma nounroll</code> — Explicitly disables unrolling for the annotated loop.
* <code>#pragma nounroll</code> — Explicitly disables unrolling for the annotated loop.
Bots, Bureaucrats, Interface administrators, smwadministrator, smwcurator, smweditor, Administrators
2,557

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu