bug描述 Describe the Bug
海光DCU上设置-DWITH_CINN=ON,Paddle编译错误。
编译命令:cmake .. -DWITH_GPU=ON -DWITH_CINN=ON -DPY_VERSION=3.x
错误消息
/workspace/Paddle/paddle/phi/kernels/gpu/truncated_gaussian_random_kernel.cu:55:17: error: no member named 'clamp' in namespace 'std'
return std::clamp(ret, a, b);
~~~~~^
/workspace/Paddle/paddle/phi/kernels/gpu/truncated_gaussian_random_kernel.cu:89:17: error: no member named 'clamp' in namespace 'std'
return std::clamp(ret, a, b);
~~~~~^
6 warnings generated when compiling for gfx926.
2 errors generated when compiling for gfx906.
其他补充信息 Additional Supplementary Information
No response
3条答案
按热度按时间vof42yt11#
这个是C17标准的用法,std::clamp,检查下你编译的时候是不是用的C14?
2sbarzqh2#
@risemeup1 确实是因为c版本,不过改成c17还是出错。
原因在cmake/hip.cmake
改成-std=c++17,出现了另一个错误:
ckx4rj1h3#
CINN目前开源的代码还未支持DCU编译,后续功能会开源,请关注,谢谢