如何通过利用Intel OpenCL SVML使用_mm256_log_ps? [英] How to use _mm256_log_ps by leveraging Intel OpenCL SVML?
问题描述
我发现_mm256_log_ps不能与GCC7一起使用.关于stackoverflow的最常见建议是使用ICC或利用OpenCL SDK.
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.
下载SDK并提取RPM文件后,共有三个.so文件:__ocl_svml_l9.so,__ocl_svml_e9.so,__ocl_svml_h8.so
After downloading SDK and extracting RPM file, there are three .so files: __ocl_svml_l9.so, __ocl_svml_e9.so, __ocl_svml_h8.so
有人可以教我如何使用这些.so文件调用_mm256_log_ps吗?
Can someone teach me how to call _mm256_log_ps with these .so files?
谢谢.
推荐答案
您可以从
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();
}
根据编译标志,这会生成优化的SSE或AVX代码(以及其他体系结构的SIMD).该实现基于 http://gruntthepeon.free.fr/ssemath/ cephes .
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.
这篇关于如何通过利用Intel OpenCL SVML使用_mm256_log_ps?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!