Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
1 change: 0 additions & 1 deletion src/interval.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
6 changes: 5 additions & 1 deletion src/kernels.jl
Original file line number Diff line number Diff line change
@@ -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))
Expand Down Expand Up @@ -102,4 +104,6 @@ end
Y[j, batch_idx] += V[ind, batch_idx] * X[i, batch_idx]
end
end
end
end

## COV_EXCL_STOP
7 changes: 7 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down