# Marking code for Burst compilation


Apply the [`[BurstCompile]`](/engine/6000.7/script-reference/unity/burst/burstcompileattribute.md) attribute to the parts of your code you want Burst to compile. You can apply the `[BurstCompile]` attribute to the following:

* **Jobs**: When you apply `[BurstCompile]` to a job definition, Burst compiles everything within the job. For more information on jobs, refer to [Job system](/engine/6000.7/manual/scripting/optimization/job-system.md).
* **Classes**: Apply `[BurstCompile]` to a class definition if the class contains static methods that are also marked with `[BurstCompile]`. Burst can't compile the class itself but only its member methods.
* **Structs**: Apply `[BurstCompile]` to a regular (non-job) struct definition if the struct contains static methods that are also marked with `[BurstCompile]`.
* **Static methods**: Apply `[BurstCompile]` to the method and its parent type. To work with dynamic functions that process data based on other data states, refer to [Function pointers](/engine/6000.7/manual/scripting/compilation-and-code-reload/script-compilation/burst/csharp-language-support/csharp-function-pointers.md).
* **Assemblies**: Apply `[BurstCompile]` to an assembly to set options for all Burst jobs and function-pointers within the assembly. For more information, refer to [Defining Burst options for an assembly](/engine/6000.7/manual/scripting/compilation-and-code-reload/script-compilation/burst/compilation/burstcompile-assembly.md).

> **Note:**
>
> You don't always need to mark a method with the `[BurstCompile]` attribute for Burst to compile it. Any method where the program execution switches from managed to Burst-compiled code is referred to as a Burst entry point. If a static entry point method is marked with `[BurstCompile]`, Burst also compiles any methods it calls into, even if they're not marked `[BurstCompile]`.

## Configure Burst compilation with parameters

You can supply parameters to the [`[BurstCompile]`](/engine/6000.7/script-reference/unity/burst/burstcompileattribute.md) attribute to modify aspects of compilation and improve Burst's performance. You can use attribute parameters to:

* Use a different accuracy for math functions (for example, sin, cos).
* Relax the order of math computations so that Burst can rearrange the floating point calculations.
* Force a synchronous compilation of a job (only for [just-in-time compilation](/engine/6000.7/manual/scripting/compilation-and-code-reload/script-compilation/burst/compilation.md)).

For example, you can use the `[BurstCompile]` attribute to change the [floating precision](/engine/6000.7/script-reference/unity/burst/floatprecision.md) and [float mode](/engine/6000.7/script-reference/unity/burst/floatmode.md) of Burst as follows:

```
[BurstCompile(FloatPrecision.Medium, FloatMode.Fast)]
```

For more information on configuring precision and determinism in floating point calculations, refer to [Float precision and determinism](/engine/6000.7/manual/scripting/compilation-and-code-reload/script-compilation/burst/compilation/float-precision-determinism.md).

## Additional resources

* [`[BurstCompile]` attribute API reference](/engine/6000.7/script-reference/unity/burst/burstcompileattribute.md)
* [Defining Burst options for an assembly](/engine/6000.7/manual/scripting/compilation-and-code-reload/script-compilation/burst/compilation/burstcompile-assembly.md)
