@@ -46,11 +46,9 @@ xMC = MC{1, NS}(2.5, Interval(-1.0, 4.0), 1)
46
46
47
47
@btime xMC*(15+xMC)^2
48
48
# 228.381 ns (15 allocations: 384 bytes)
49
- # MC{1, NS}(683.5, 952.0, [-361, 1444], [501.0], [328.0], false)
50
49
51
50
@btime x_cv_eval(2.5, 2.5, 4.0, -1.0)
52
51
# 30.382 ns (1 allocation: 16 bytes)
53
- # 683.5
54
52
```
55
53
56
54
This is not an * entirely* fair example because the operation with xMC is simultaneously calculating
@@ -68,22 +66,27 @@ using CUDA
68
66
69
67
# Using McCormick.jl
70
68
xMC_array = MC{1,NS}.(rand(10000), Interval.(zeros(10000), ones(10000)), ones(Int, 10000))
69
+
71
70
@btime xMC_array.*(15 .+ xMC_array).^2
72
71
# 1.616 ms (120012 allocations: 2.37 MiB)
73
72
73
+
74
74
# Using SourceCodeMcCormick.jl, broadcast using CPU
75
75
xcc = rand(10000)
76
76
xcv = copy(xcc)
77
77
xhi = ones(10000)
78
78
xlo = zeros(10000)
79
+
79
80
@btime x_cv_eval.(xcc, xcv, xhi, xlo)
80
81
# 100.100 μs (4 allocations: 78.27 KiB)
81
82
83
+
82
84
# Using SourceCodeMcCormick.jl and CUDA.jl, broadcast using GPU
83
85
xcc_GPU = cu(xcc)
84
86
xcv_GPU = cu(xcv)
85
87
xhi_GPU = cu(xhi)
86
88
xlo_GPU = cu(xlo)
89
+
87
90
@btime x_cv_eval.(xcc_GPU, xcv_GPU, xhi_GPU, xlo_GPU)
88
91
# 6.575 μs (33 allocations: 2.34 KiB)
89
92
```
0 commit comments