@@ -46,11 +46,9 @@ xMC = MC{1, NS}(2.5, Interval(-1.0, 4.0), 1)
4646
4747@btime xMC*(15+xMC)^2
4848# 228.381 ns (15 allocations: 384 bytes)
49- # MC{1, NS}(683.5, 952.0, [-361, 1444], [501.0], [328.0], false)
5049
5150@btime x_cv_eval(2.5, 2.5, 4.0, -1.0)
5251# 30.382 ns (1 allocation: 16 bytes)
53- # 683.5
5452```
5553
5654This is not an * entirely* fair example because the operation with xMC is simultaneously calculating
@@ -68,22 +66,27 @@ using CUDA
6866
6967# Using McCormick.jl
7068xMC_array = MC{1,NS}.(rand(10000), Interval.(zeros(10000), ones(10000)), ones(Int, 10000))
69+
7170@btime xMC_array.*(15 .+ xMC_array).^2
7271# 1.616 ms (120012 allocations: 2.37 MiB)
7372
73+
7474# Using SourceCodeMcCormick.jl, broadcast using CPU
7575xcc = rand(10000)
7676xcv = copy(xcc)
7777xhi = ones(10000)
7878xlo = zeros(10000)
79+
7980@btime x_cv_eval.(xcc, xcv, xhi, xlo)
8081# 100.100 μs (4 allocations: 78.27 KiB)
8182
83+
8284# Using SourceCodeMcCormick.jl and CUDA.jl, broadcast using GPU
8385xcc_GPU = cu(xcc)
8486xcv_GPU = cu(xcv)
8587xhi_GPU = cu(xhi)
8688xlo_GPU = cu(xlo)
89+
8790@btime x_cv_eval.(xcc_GPU, xcv_GPU, xhi_GPU, xlo_GPU)
8891# 6.575 μs (33 allocations: 2.34 KiB)
8992```
0 commit comments