From 61fb6cdf053da66f29f1afb3161f8a86434b0572 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Fri, 5 Oct 2018 14:02:00 +0100 Subject: [PATCH] jit macro --- src/utils.jl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/utils.jl b/src/utils.jl index 6a970f0b..74d479bd 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -153,3 +153,18 @@ function jacobian(m,x) end J' end + +""" + @jit ... + +The `@jit` annotation can be applied to any code, and the code will be compiled +for performance. + + @jit f(x) = @jit(x) + @jit(x) + +Note that compilation happens regardless of the `@jit` macro, so it should only +be used for aesthetic purposes, or by recovering Python users. +""" +macro jit(ex) + esc(ex) +end