Iterator
Iterator are implemented using Rayon trait UnindexedProducer
, the tasks are splitted in split method. The main loop is happened in fold_with. Iterator can be used to implement elementwise or broadcast elementwise calculations. Usage can be found at here and here
Known issue
Current iterator like
ParStrided
, thefold_with
method doesn't have any looping logic. Maybe we can write same logic asParStridedZip
infold_with
.When outer loop size is 1, there will be no parallelism because the tasks splits based on the outer loop size.