Skip to content

Commit 4a6ecde

Browse files
authored
Add coverage badge (#10)
* badge * exclude kernels.jl * test empty intervals
1 parent 683b5b7 commit 4a6ecde

4 files changed

Lines changed: 15 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# BatchNLPKernels.jl
22

3-
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://LearningToOptimize.github.io/BatchNLPKernels.jl/dev/)
4-
[![Build Status](https://github.com/LearningToOptimize/BatchNLPKernels.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/LearningToOptimize/BatchNLPKernels.jl/actions/workflows/CI.yml?query=branch%3Amain)
3+
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://klamike.github.io/BatchNLPKernels.jl/dev/)
4+
[![Build Status](https://github.com/klamike/BatchNLPKernels.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/klamike/BatchNLPKernels.jl/actions/workflows/CI.yml?query=branch%3Amain)
5+
[![Coverage](https://codecov.io/gh/LearningToOptimize/BatchNLPKernels.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/LearningToOptimize/BatchNLPKernels.jl)
56

67
`BatchNLPKernels.jl` provides [`KernelAbstractions.jl`](https://github.com/JuliaGPU/KernelAbstractions.jl) kernels for evaluating problem data from a (parametric) [`ExaModel`](https://github.com/exanauts/ExaModels.jl) for batches of solutions (and parameters). Currently the following functions (as well as their non-parametric variants) are exported:
78

src/interval.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Base.broadcastable(s::Interval) = Ref(s)
1515
Base.isempty(s::Interval{VT}) where {VT} = isempty(s.l) || isempty(s.u)
1616

1717
# empty support (unconstrained)
18-
Interval(::Nothing) = Interval()
1918
Interval() = Interval(nothing, nothing)
2019
Base.isempty(::Interval{Nothing}) = true
2120
@inline _violation(v, ::Interval{Nothing}) = zero(v)

src/kernels.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## COV_EXCL_START
2+
13
@kernel function kerf_batch(Y, @Const(f), @Const(itr), @Const(X), @Const(Θ))
24
I, batch_idx = @index(Global, NTuple)
35
@inbounds Y[ExaModels.offset0(f, itr, I), batch_idx] = f.f(itr[I], view(X, :, batch_idx), view(Θ, :, batch_idx))
@@ -102,4 +104,6 @@ end
102104
Y[j, batch_idx] += V[ind, batch_idx] * X[i, batch_idx]
103105
end
104106
end
105-
end
107+
end
108+
109+
## COV_EXCL_STOP

test/runtests.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ if haskey(ENV, "BNK_TEST_CUDA")
3838
@info "CUDA detected"
3939
end
4040

41+
@testset "Empty Intervals" begin
42+
empt = BNK.Interval()
43+
@test isempty(empt)
44+
@test isnothing(empt.l)
45+
@test isnothing(empt.u)
46+
@test BNK._violation([1.0, 2.0, 3.0], empt) == [0.0, 0.0, 0.0]
47+
end
4148

4249
include("luksan.jl")
4350
include("power.jl")

0 commit comments

Comments
 (0)