kernelLiquidOnLanes function

KernelLiquid? kernelLiquidOnLanes({
  1. SimulationProfile profile = SimulationProfile.deterministic,
  2. FluidSolver rest = const DartFluid(),
})

The liquid with its pair loops on the native lanes, for a run under profile; null where they are refused — a bit-exact profile, whose bytes must be the CPU kernel's on every machine — or not there: the browser, a build with no C compiler.

What the hardware layer's answer builds, and nothing else. Where the loops run is not this package's to choose: placeKernelLiquid in flutter3d_effects calls this when FrameCompute.placeHosted answers that the lanes run the work, so a GPU the rule put first is never passed over by a caller reaching for the lanes. Exported only by package:flutter3d_physics_native/internal.dart, and a structure rule names any other importer.

Implementation

KernelLiquid? kernelLiquidOnLanes({
  SimulationProfile profile = SimulationProfile.deterministic,
  FluidSolver rest = const DartFluid(),
}) {
  if (profile.isBitExact || !KernelLiquid.isNativeLanesBuilt) return null;
  return KernelLiquid._lanes(
    loops: (LiquidLoopsContext context) =>
        openLiquidLanes(context.constants.list) ??
        (throw StateError('the native lanes went away')),
    rest: rest,
  );
}