如何通过利用Intel OpenCL SVML使用_mm256_log_ps? [英] How to use _mm256_log_ps by leveraging Intel OpenCL SVML?

查看:216
本文介绍了如何通过利用Intel OpenCL SVML使用_mm256_log_ps?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现_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?

谢谢.

推荐答案

您可以从log函数rel ="nofollow noreferrer">特征库:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆