macos - Concurrent execution of metal compute kernels
问题描述
Lets say, I have around 10 kernels, which I encode in an MTLComputeCommandEncoder
and these 10 kernels, run on a set of data under consideration.
I have multiple sets of these data, let's say 5, and I want to execute these 10 kernels on all the separate sets of data. And NO! I cannot combine these data sets into a single data.
A naive approach would be to loop around all the data sets and execute all the 10 kernels on each data set, one after another.
What I'm looking for is a way that I can tell Metal
, that these are separate data sets and they can be executed in parallel. That is, instead of encoding 10 kernels, 5 times sequently, I want to run all of them concurrently on the GPU.
CUDA provides Streams
to achieve this behaviour. Is there anything similar the Metal provides?
I know there exists MTLDispatchType
, setting it to MTLDispatchTypeConcurrent
, would mean running my 10 kernels concurrently, but that is not the requirement.
Thanks!
解决方案
推荐阅读
- java - ArrayList 添加不正确的值
- java - 从 Activity 退出后,片段上的 OnItemClickListener 不起作用
- php - 使用 AJAX xmlhttprequest 上传图片文件失败
- python - 我应该如何假设三个贵重物品并在此代码块中打印它们
- python - 我试图每天在某个时间执行我的代码,但它不起作用
- python - 为什么我的 QSplitter 的 QSplitterHandles 拒绝格式化?
- sql - 如何将数据集拆分为多个子集并将其导出到 Excel
- amazon-web-services - AWS IoT 设备在线/离线检查
- javascript - Firebase @firebase/数据库PERMISSION_DENIED
- firebase - 使用 firebase/firestore JS SDK 过滤掉文档 ID 子集的最佳方法?