-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Refactor CUDA Directory #1634
Comments
我想象中的cuda目录结构是:
|
嗯,这里可以只考虑涉及指令集相关的代码调整。我觉得可以先列一下哪些文件是相关的,然后再考虑怎么重构。另外,我觉得现在的指令集相关的代码没有特别多,可能不需要分这么细的目录。 |
跟 @gangliao 讨论了一下,一种简单的做法是可以在编译的时候记下当前编译时是否添加了-mavx选项,运行时check编译选项和机器cpu特性是否匹配。比如:
|
这里的编译的时候记下当前编译选项,其实就是通过 |
是的,可以写一个check函数,放到InitFunction里面。 |
因此,我觉得从源码、cmake方面,都很有必要重构一下。 |
@Xreki 今天和@hedaoyuan讨论了一番,目前采用类似于TF的方法(https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/platform/cpu_feature_guard.cc https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/platform/cpu_info.h 这种做法,优点:对目前的代码改动较小,否则需要更改大量代码和编译。缺点:其实没有做动态的切换。 |
先close这个issue,我重新在design doc里面描述。 |
The requirement of re-factoring CUDA directory from #1607 @gangliao, #1116 @hedaoyuan, and ARM @Xreki.
背景问题:
目前cuda目录包含不同架构甚至不同SIMD指令集的代码,逐渐出现各种不同程度的问题,比如:无法发布Paddle的单一CPU版本问题,function重构问题,ARM的扩展问题,以及今后的opencl问题。
为了有效的解决上述问题,我们需要调整cuda目录结构,使其更具可扩展性。
The text was updated successfully, but these errors were encountered: