cuda - OpenCL 中是否有与 native_recip() 等效的 CUDA?

标签 cuda opencl porting

OpenCL 有一个名为 native_recip 的内置函数:

gentype native_recip(gentype x);

native_recip computes reciprocal over an implementation-defined range. The maximum error is implementation-defined.

The vector versions of the math functions operate component-wise. The description is per-component.

The built-in math functions are not affected by the prevailing rounding mode in the calling environment, and always return the same value as they would if called with the round to nearest even rounding mode.

CUDA 中有与此功能等效的函数吗?

最佳答案

正如评论中所述,它是 __frcp_rn()对于 float__drcp_rn()对于的;以及向量类型的实现(例如 float4),以便按元素应用 frcp/drcp。

注意:“rcp”是“reciprocal”的缩写,“rn”是舍入模式 "round to nearest even" .

关于cuda - OpenCL 中是否有与 native_recip() 等效的 CUDA?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63101094/

相关文章:

linux - 在嵌入式 linux 平台上使用 QT 运行在 Windows 中创建的应用程序

c - WaitForSingleObject 和 WaitForMultipleObjects 等同于 Linux?

pointers - cuda统一内存: memory transfer behaviour

cuda - Visual C++ 中的 OpenACC

c# - OpenCL 和 GPU 编程路线图

ffmpeg - 用于 ffmpeg 和多 GPU 卡的 CLI

parallel-processing - CUDA:我是否需要在多个 GPU 上并行执行不同的流?

cuda - Compute Visual Profiler 不填充 .csv 文件

c - 如何在 CUDA 中将展平的 2D 数组从全局内存复制到共享内存

linux - 套接字选项 SO_SNDLOWAT 的用途是什么