diff --git a/src/ensemblegpukernel/integrators/integrator_utils.jl b/src/ensemblegpukernel/integrators/integrator_utils.jl index 8ffa847f..e883d6d0 100644 --- a/src/ensemblegpukernel/integrators/integrator_utils.jl +++ b/src/ensemblegpukernel/integrators/integrator_utils.jl @@ -229,7 +229,7 @@ end continuous_modified = false discrete_modified = false saved_in_cb = false - if !(typeof(continuous_callbacks) <: Tuple{}) + if !(continuous_callbacks isa Tuple{}) event_occurred = false time, upcrossing, event_occurred, event_idx, idx, counter = DiffEqBase.find_first_continuous_callback(integrator, @@ -247,7 +247,7 @@ end integrator.vector_event_last_time = 1 end end - if !(typeof(discrete_callbacks) <: Tuple{}) + if !(discrete_callbacks isa Tuple{}) discrete_modified, saved_in_cb = apply_discrete_callback!(integrator, ts, us, discrete_callbacks...) return discrete_modified, saved_in_cb diff --git a/src/solve.jl b/src/solve.jl index eaedc452..304da20b 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -23,13 +23,13 @@ function SciMLBase.__solve(ensembleprob::SciMLBase.AbstractEnsembleProblem, if cpu_trajectories != 0 && ensembleprob.reduction === SciMLBase.DEFAULT_REDUCTION cpu_II = (gpu_trajectories + 1):trajectories - _alg = if typeof(alg) <: GPUODEAlgorithm + _alg = if alg isa GPUODEAlgorithm if adaptive == false cpu_alg[typeof(alg)][1] else cpu_alg[typeof(alg)][2] end - elseif typeof(alg) <: GPUSDEAlgorithm + elseif alg isa GPUSDEAlgorithm if adaptive == false SimpleEM() else @@ -418,7 +418,7 @@ function solve_batch(prob, alg, ensemblealg::EnsembleThreads, II, pmap_batch_siz kwargs...) end - if typeof(prob.prob) <: SciMLBase.AbstractJumpProblem && length(II) != 1 + if prob.prob isa SciMLBase.AbstractJumpProblem && length(II) != 1 probs = [deepcopy(prob.prob) for i in 1:Threads.nthreads()] else probs = prob.prob