|
84 | 84 |
|
85 | 85 | @test isapprox(mean_kernel, mean_serial, rtol = 0.05) |
86 | 86 | end |
87 | | - |
88 | | -# Test PureLeaping validation for GPU |
89 | | -@testset "PureLeaping GPU Validation" begin |
90 | | - β = 0.1 / 1000.0 |
91 | | - ν = 0.01 |
92 | | - p = (β, ν) |
93 | | - |
94 | | - regular_rate = (out, u, p, t) -> begin |
95 | | - out[1] = p[1] * u[1] * u[2] # β*S*I (infection) |
96 | | - out[2] = p[2] * u[2] # ν*I (recovery) |
97 | | - end |
98 | | - |
99 | | - regular_c = (dc, u, p, t, counts, mark) -> begin |
100 | | - dc .= 0.0 |
101 | | - dc[1] = -counts[1] # S: -infection |
102 | | - dc[2] = counts[1] - counts[2] # I: +infection - recovery |
103 | | - dc[3] = counts[2] # R: +recovery |
104 | | - end |
105 | | - |
106 | | - u0 = [999.0, 10.0, 0.0] # S, I, R |
107 | | - tspan = (0.0, 50.0) |
108 | | - prob_disc = DiscreteProblem(u0, tspan, p) |
109 | | - rj = RegularJump(regular_rate, regular_c, 2) |
110 | | - |
111 | | - # This should fail - Direct aggregator with SimpleTauLeaping |
112 | | - jump_prob_direct = JumpProblem(prob_disc, Direct(), rj) |
113 | | - @test_throws ErrorException solve(EnsembleProblem(jump_prob_direct), |
114 | | - SimpleTauLeaping(), EnsembleGPUKernel(CUDABackend()); |
115 | | - trajectories = 10, dt = 1.0) |
116 | | -end |
0 commit comments