How to use _mm256_log_ps by leveraging Intel OpenCL SVML?

谁都会走 提交于 2019-12-11 15:17:01

问题


I found that _mm256_log_ps can't be used with GCC7. Most common suggestions on stackoverflow is to use ICC or leveraging OpenCL SDK.

After downloading SDK and extracting RPM file, there are three .so files: __ocl_svml_l9.so, __ocl_svml_e9.so, __ocl_svml_h8.so

Can someone teach me how to call _mm256_log_ps with these .so files?

Thank you.


回答1:


You can use the log function from the Eigen library:

#include <Eigen/Core>

void foo(float* data, int size)
{
    Eigen::Map<Eigen::ArrayXf> arr(data, size);
    arr = arr.log();
}

Depending on the compile flags this generates optimized SSE or AVX code (as well as SIMD for other architectures). The implementation is based on http://gruntthepeon.free.fr/ssemath/ which is based on cephes.



来源:https://stackoverflow.com/questions/51796612/how-to-use-mm256-log-ps-by-leveraging-intel-opencl-svml

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!