futhark-0.22.2: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Futhark.AD.Derivatives

Description

Partial derivatives of scalar Futhark operations and built-in functions.

Synopsis

Documentation

pdBuiltin :: Name -> [PrimExp VName] -> Maybe [PrimExp VName] Source #

pdBuiltin f args i computes the partial derivative of f applied to args with respect to each of its arguments. Returns Nothing if no such derivative is known.

pdBinOp :: BinOp -> PrimExp VName -> PrimExp VName -> (PrimExp VName, PrimExp VName) Source #

pdBinOp op x y computes the partial derivatives of op with respect to x and y.

pdUnOp :: UnOp -> PrimExp VName -> PrimExp VName Source #

pdUnOp op x computes the partial derivatives of op with respect to x.