Skip to content

Commit 429d99d

Browse files
committed
Cleaning up README examples
1 parent 99865f7 commit 429d99d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

5654
This 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
7068
xMC_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
7575
xcc = rand(10000)
7676
xcv = copy(xcc)
7777
xhi = ones(10000)
7878
xlo = 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
8385
xcc_GPU = cu(xcc)
8486
xcv_GPU = cu(xcv)
8587
xhi_GPU = cu(xhi)
8688
xlo_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

Comments
 (0)