rprechelt / Vectorize.jl

Cross-platform vectorization of Julia code using Accelerate, VML, and Yeppp!
http://vectorizejl.readthedocs.io/en/latest/
Other
19 stars 7 forks source link

Replace base #19

Closed platawiec closed 5 years ago

platawiec commented 5 years ago

Based off #18, this introduces a new macro @replacebase which overloads broadcast calls to use the benchmarked Vectorize functions. I've updated the documentation and tests.

As an example on my machine:

julia> using BenchmarkTools

julia> a = rand(1000); b = similar(a);

julia> @btime $b .= $a.^(-1/3)
  19.044 μs (0 allocations: 0 bytes)

julia> using Vectorize

julia> @replacebase ^

julia> @btime $b .= $a.^(-1/3);
  2.209 μs (0 allocations: 0 bytes)

I've also added a bunch of new VML functions.

platawiec commented 5 years ago

I'll also note that #13 seems to work now - passing a multi-dimensional array to either the Vectorize.f or Vectorize.f! functions works just fine, and likewise for the @replacebase broadcasted calls. I think #13 can be closed.

rprechelt commented 5 years ago

Great work!

carlomontec commented 5 years ago

Great, thanks all!