Replies: 2 comments
-
目前这块支持还不完善,建议先直接改成 .cu 编译。最近也没什么时间去改进这块,等后面有空再看看吧,可以先提 issues 备着 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
想法主要是受pbrtv4影响,希望cuda能够复用之前写的cpu代码,
编译期通过宏控制加上__device__,从而满足设备端调用需要
目前的问题是没有找到能把cpp当作cu编译以及后续链接的方法
功能上应该类似于这个回答给出的cmake版
以及 https://github.com/mmp/pbrt-v4/blob/39e01e61f8de07b99859df04b271a02a53d9aeb2/CMakeLists.txt#L711-L770
在文档中查到的比较接近的做法是通过sourcekind调整 https://xmake.io/#/about/changelog?id=v231 #675
但简单尝试发现
add_files("a.cpp", {sourcekind = "cu"})
没起作用(包括乱试的add_files("a.cpp", {language= "cuda"})
这种 ),但从log看编译该文件的时候还是用cl似乎这里还仅限于c和cpp之间的转换?
预期效果应该比较类似于这个回答
环境是cuda11.8 vs2022 17.7.4 xmake2.9.1
demo和log输出在reproduce.zip
Beta Was this translation helpful? Give feedback.
All reactions