diff --git a/README.md b/README.md index 840ba4a..85ae1e6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # BatchNLPKernels.jl -[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://LearningToOptimize.github.io/BatchNLPKernels.jl/dev/) -[![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) +[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://klamike.github.io/BatchNLPKernels.jl/dev/) +[![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) +[![Coverage](https://codecov.io/gh/LearningToOptimize/BatchNLPKernels.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/LearningToOptimize/BatchNLPKernels.jl) `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: diff --git a/src/interval.jl b/src/interval.jl index fd884f5..d31c7ba 100644 --- a/src/interval.jl +++ b/src/interval.jl @@ -15,7 +15,6 @@ Base.broadcastable(s::Interval) = Ref(s) Base.isempty(s::Interval{VT}) where {VT} = isempty(s.l) || isempty(s.u) # empty support (unconstrained) -Interval(::Nothing) = Interval() Interval() = Interval(nothing, nothing) Base.isempty(::Interval{Nothing}) = true @inline _violation(v, ::Interval{Nothing}) = zero(v) diff --git a/src/kernels.jl b/src/kernels.jl index 743f75e..27ee83b 100644 --- a/src/kernels.jl +++ b/src/kernels.jl @@ -1,3 +1,5 @@ +## COV_EXCL_START + @kernel function kerf_batch(Y, @Const(f), @Const(itr), @Const(X), @Const(Θ)) I, batch_idx = @index(Global, NTuple) @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 Y[j, batch_idx] += V[ind, batch_idx] * X[i, batch_idx] end end -end \ No newline at end of file +end + +## COV_EXCL_STOP \ No newline at end of file diff --git a/test/runtests.jl b/test/runtests.jl index 1b1dfd1..2bc5b19 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -38,6 +38,13 @@ if haskey(ENV, "BNK_TEST_CUDA") @info "CUDA detected" end +@testset "Empty Intervals" begin + empt = BNK.Interval() + @test isempty(empt) + @test isnothing(empt.l) + @test isnothing(empt.u) + @test BNK._violation([1.0, 2.0, 3.0], empt) == [0.0, 0.0, 0.0] +end include("luksan.jl") include("power.jl")