在 GPU 硬件中实现的特殊数学函数
今天我了解到,在 NVIDIA GPU 中,顶点单元中有特殊的硬件函数,用于计算 3D 规则网格中的线性插值。我想知道这种类型是否还有更多,更重要的是,人们在做GPGPU来加速代码时是否真的使用它们
I learnt today that in NVIDIA GPUs there are in the vertex unit special hardware functions for calculating linear interpolation in a 3D regular grid. I wonder if there are more of this kind and more important, if people really use them when they do GPGPU to accelerate codes
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有许多功能是在硬件中实现的。您要查找的术语是“CUDA 内在函数”。线性插值由纹理处理,这与此类似。
请参阅此处:http://developer.download。 nvidia.com/compute/DevZone/docs/html/C/doc/CUDA_C_Programming_Guide.pdf
内部函数通常用前导双下划线拼写,例如__sin,或使用 --use_fast_math nvcc 选项全局启用。
是的,它们实际上经常被使用。 :) 从数值角度来看,它们稍微不准确,因此将一个内在函数的结果重复传递到另一个内在函数中可能会产生不可接受的错误,具体取决于您的用例。测试是关键。
There are a number of functions that are implemented in hardware. The term you're looking for are "CUDA intrinsic functions." The linear interpolation is handled by textures, which is something similar.
See here: http://developer.download.nvidia.com/compute/DevZone/docs/html/C/doc/CUDA_C_Programming_Guide.pdf
The intrinsic functions are typically spelled with leading double underscores, like __sin, or enabled globally with the --use_fast_math nvcc option.
And yes, they're actually used quite often. :) They are slightly more inaccurate from a numerical perspective, so passing the results of one intrinsic into another repeatedly can have unacceptable error, depending on your use case. Testing is key.