调度线程组错误

问题描述 投票:1回答:1

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

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

这个错误是什么?

ios swift multithreading
1个回答
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

© www.soinside.com 2019 - 2024. All rights reserved.