调度线程组错误



我正在实时收到的视频提要上运行计算机视觉算法。我正在使用DispatchQueue异步运行这些操作/算法。但是,我遇到以下错误,我无法解释:

[MTLDebugComputeCommandEncoder dispatchThreadgroups:threadsPerThreadgroup:]:949: failed assertion (threadgroupsPerGrid.width(0) * threadgroupsPerGrid.y(12) * threadgroupsPerGrid.depth(1))(0) must not be 0.'

这个错误是什么?

此消息指出,[MTLDebugComputeCommandEncoder dispatchThreadgroups:threadsPerThreadgroup:]中的断言引起了断言失败。

据我了解,

有人断言这种表达:

threadgroupsPerGrid.width * threadgroupsPerGrid.y * threadgroupsPerGrid.depth

不应是0,而是0,导致这种断言失败。此外,他们已经注释了这些变量的值:

  • threadgroupsPerGrid.width0
  • threadgroupsPerGrid.y12
  • threadgroupsPerGrid.depth1
  • threadgroupsPerGrid.width * threadgroupsPerGrid.y * threadgroupsPerGrid.depth评估为0

这个无效状态可能是您将无效的参数传递给[MTLDebugComputeCommandEncoder dispatchThreadgroups:threadsPerThreadgroup:]的结果。如果我不得不猜测,问题可能是threadgroupsPerGrid.width0

相关内容

最新更新