Numbas parallel vectorized functions

后端 未结 1 1860
太阳男子
太阳男子 2021-01-03 08:09

I\'m currently experimenting with numba and especially vectorized functions, so I created a sum vectorized function (because it is eas

相关标签:
1条回答
  • 2021-01-03 08:44

    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.

    0 讨论(0)
提交回复
热议问题