Timeline for Recovering Matlab performance scaling via vectorization
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 24, 2017 at 1:51 | comment | added | Michael E2 |
@B.Solver Not only is InterpolatingFunction not vectorized, it is not compilable. As a result, Compile wastes a lot of time with call back to the main kernel.
|
|
Nov 24, 2017 at 1:18 | comment | added | B. Solver | This looks great! I've tried updating this example so that I can use it with an interpolating function, and I find that the Compile-d version is in that case 10x slower than not compiling. See here: g = Table[-Exp[-x^2/2], {x, -2, 2, .01}]; gg = ListInterpolation[g, {-2, 2}]; Quiet[Block[{x}, f = x [Function] Evaluate[gg[x]]; gradf = x [Function] Evaluate[D[f[x], x]]; With[{code = gradf[x]}, cgradf = Compile[{{x, _Real}}, code, CompilationTarget -> "C", RuntimeAttributes -> {Listable}, Parallelization -> True]]; ] ] | |
Nov 23, 2017 at 23:34 | history | edited | Henrik Schumacher | CC BY-SA 3.0 |
deleted 1 character in body
|
Nov 23, 2017 at 21:53 | history | edited | Henrik Schumacher | CC BY-SA 3.0 |
deleted 23 characters in body
|
Nov 23, 2017 at 21:46 | history | answered | Henrik Schumacher | CC BY-SA 3.0 |