Docs / nablatensor-core / com.nablatensor.engine

final class

JitOptimizations

Opt-in code-generation optimizations for the cpu-jit AAD engine.

The default is NONE: the generated kernel is a straight-line transcription of the recorded tape that calls java.lang.Math for every transcendental, so its output matches the scalar cpu interpreter bit for bit. Every optimization below is enabled explicitly, either by picking a level or by naming individual categories.

Nabla.model(base, this::asian)
    .greeks().fp64().threads(8).on("cpu-jit")
    .jit(JitOptimizations.Level.LOW_RISK)          // level form
    .build();

Nabla.model(base, this::asian)
    .greeks().fp64().threads(8).on("cpu-jit")
    .jit(JitOptimizations.Category.ROLLED_LOOPS,   // category form
         JitOptimizations.Category.DRAW_CACHE)
    .build();

The system properties -Dnablatensor.jit.roll and -Dnablatensor.crn still override this setting when present, so existing benchmark scripts are unaffected; the fluent value is what applies when they are absent.

Methods

static JitOptimizations NONE = new JitOptimizations(EnumSet.noneOf(Category.class) EnumSet.noneOf(Category.class))

The default: no optimizations.

static JitOptimizations level(Level level)

The optimizations bundled under level.

static JitOptimizations of(Category... categories)

Exactly the named categories, and nothing else.

JitOptimizations with(Category category)

This set plus category.

boolean has(Category category)

Whether category is enabled.

Set<Category> categories()

The enabled categories, unmodifiable.

boolean equals(Object other)
int hashCode()
String toString()