Skip to content

Commit 0bcbbf7

Browse files
Add note for vall
1 parent 16af262 commit 0bcbbf7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/vboolean.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ If `p` is omitted, test whether any values along the given `dims` are `true`
7070
7171
# Usage Recommendation
7272
If `A` is reasonably small, `vany` may be faster than `any`; however, as the size
73-
of `A` grows, the probability of any element returning true inevitably increases
73+
of `A` grows, the probability of any element returning `true` inevitably increases
7474
(it is repeated Bernoulli sampling, thus, even with a very small success probability,
7575
a large number of tries makes may yield a scenario where the `break` of `any` wins out).
7676
Consequently, the probability of individual elements being `true` should determine choice --
@@ -99,6 +99,15 @@ Determine whether predicate `p` returns true for all elements over the given `di
9999
If `p` is omitted, test whether all values along the given `dims` are `true`
100100
(in which case `A` should be `AbstractArray{Bool}`).
101101
102+
# Usage Recommendation
103+
If `A` is reasonably small, `vall` may be faster than `all`; however, as the size
104+
of `A` grows, the probability of all element returning `false` inevitably increases
105+
(it is repeated Bernoulli sampling, thus, even with a very small success probability,
106+
a large number of tries makes may yield a scenario where the `break` of `all` wins out).
107+
Consequently, the probability of individual elements being `true` should determine choice --
108+
if one suspects a reasonable success probability, then `all` may be preferable, depending
109+
on the size `A`. More testing is needed to determine potential breakpoints.
110+
102111
# Additional Notes
103112
This function suffers from the same issue as `vfindmax` and friends -- reductions
104113
which include the first dimension with max masks are not yet supported by LoopVectorization.

0 commit comments

Comments
 (0)