Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About BufferAllocator and Reorder内存管理与内存排序方面咨询 #81

Closed
huwenfeng opened this issue May 20, 2019 · 1 comment
Closed

Comments

@huwenfeng
Copy link

尝试扩展OP一些疑问:
在使用Opencl时,需要在CPU(host?)和GPU(device?)之间交换内存,使用原生Opencl可以使用DMA/SVM等方式创建交换Device的内存,MNN这块如何处理;
使用CPU推理时,是否还需要区分host和device的内存管理和交互?

是否有更多推理运行时机制以及内部API介绍,谢谢

@jxt1234
Copy link
Collaborator

jxt1234 commented May 20, 2019

1、出于性能/减少内存占用的考虑 opencl / vulkan 一般使用 fp16 的 image 作为存储格式,这种格式 cpu 无法或不易直接使用(image 类型其内存并不一定是线性排列的),因此必然有一个转换的过程,由于深度学习是计算密集型应用,大部分情况下转换过程所占的损耗比很小。
2、使用 CPU 时均为 host 内存,不需要管 device 。
3、其他文档参考:
doc/AddBackend_CN.md
doc/FAQ.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants