Numbas parallel vectorized functions

徘徊边缘 提交于 2019-11-30 15:36:52

You ask:

where would "parallel" vectorized functions make sense given that it can lead to such problems

Given that ufuncs produced by numba.vectorize(target='parallel') have defective reduce() methods, the question is what can we do with them that is useful?

In your case, the ufunc does addition. A useful application of this with target='parallel' is elementwise addition of two arrays:

numba_sum(array, array)

This is indeed faster than a single-core solution, and seems not to be impacted by the bugs that cripple reduce() and friends.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!