futhark-0.25.32: An optimising compiler for a functional, array-oriented language.

Safe Haskell | Safe-Inferred
Language | GHC2021

Futhark.AD.Derivatives

Description

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

Synopsis

- pdBuiltin :: Name -> [PrimExp VName] -> Maybe [PrimExp VName]
- pdBinOp :: BinOp -> PrimExp VName -> PrimExp VName -> (PrimExp VName, PrimExp VName)
- pdUnOp :: UnOp -> PrimExp VName -> PrimExp VName

# 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`.