@kasia we have implemented a proof of concept for differentiable BEM that you might be interested in. Note: it is still a work in progress
https://github.com/symbiotic-engineering/MarineHydro.jl/
This package uses AD for the gradients.