• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kul-forbes / ProximalOperators.jl / 375
92%

Build:
DEFAULT BRANCH: master
Ran 27 Jun 2018 07:28AM UTC
Jobs 2
Files 70
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
375

push

travis-ci

nantonel
Add simd to for loops (#56)

* Add simd to for loops

A simple benchmark with `julia -O 3` shows almost double performance in some cases

Example, `prox2!` is the updated prox function with `@simd` added. Run on julia v0.6.2
```julia
using ProximalOperators
using BenchmarkTools

function prox2!{T <: Real, R <: Real}(y::AbstractArray{R}, f::NormL1{T}, x::AbstractArray{R}, gamma::Real=1.0)
  n1y = zero(R)
  gl = gamma*f.lambda
  @inbounds @simd for i in eachindex(x)
    y[i] = x[i] + (x[i] <= -gl ? gl : (x[i] >= gl ? -gl : -x[i]))
    n1y += y[i] > 0 ? y[i] : -y[i]
  end
  return f.lambda*n1y
end


f = NormL1(1.0)
x = randn(1_000_000);
y = similar(x);

julia> @benchmark prox!($y,$f,$x)

BenchmarkTools.Trial: 
  memory estimate:  0 bytes
  allocs estimate:  0
  --------------
  minimum time:     2.866 ms (0.00% GC)
  median time:      2.897 ms (0.00% GC)
  mean time:        2.984 ms (0.00% GC)
  maximum time:     5.647 ms (0.00% GC)
  --------------
  samples:          1671
  evals/sample:     1

julia> @benchmark prox2!($y,$f,$x)
BenchmarkTools.Trial: 
  memory estimate:  0 bytes
  allocs estimate:  0
  --------------
  minimum time:     1.456 ms (0.00% GC)
  median time:      1.479 ms (0.00% GC)
  mean time:        1.553 ms (0.00% GC)
  maximum time:     5.520 ms (0.00% GC)
  --------------
  samples:          3206
  evals/sample:     1
```

* Update normL1.jl

Check input arguments for compatible lengths

1911 of 2061 relevant lines covered (92.72%)

34854.36 hits per line

Jobs
ID Job ID Ran Files Coverage
1 375.1 27 Jun 2018 07:30AM UTC 0
92.72
Travis Job 375.1
2 375.2 27 Jun 2018 07:28AM UTC 0
92.72
Travis Job 375.2
Source Files on build 375
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #375
  • d5dd2a66 on github
  • Prev Build on master (#372)
  • Next Build on master (#378)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc