C++ AMP: direct3d namespace and HLSL intrinsics in C++ AMP
来源:互联网 发布:珠海知想科技 编辑:程序博客网 时间:2024/06/05 14:54
As you know by now, as a rule most functionality in C++ AMP is in the concurrency namespace. The exception to that is the C++ AMP math library which introduces two sub namespaces (precise_math and fast_math), and thetextures and short vector types which introduce one sub namespace (graphics).
The other sub namespace is direct3d.
direct3d namespace
You’ve already seen in the concurrency::direct3d namespace four DirectX Interop APIs. Inconcurrency::graphics::direct3d there are two more for interop with textures, plus some aliased functions for short vector types.
In the concurrency::direct3d namespace there are also 20 functions that you can find in <amp.h>. These intrinsics are offered when you do HLSL programming and, we decided to offer them through C++ AMP too. You can only call them from restrict(amp) functions. The list below is for your reference and it includes links to the HLSL documentation (I also encourage you to open the header file and look at our xml comments in there for each function).
- int abs(int _X)
- float clamp(float _X, float _Min, float _Max)
- int clamp(int _X, int _Min, int _Max)
- unsigned int countbits(unsigned int _X)
- int firstbithigh(int _X)
- int firstbitlow(int _X)
- int imax(int _X, int _Y)
- int imin(int _X, int _Y)
- float mad(float _X, float _Y, float _Z)
- double mad(double _X, double _Y, double _Z)
- int mad(int _X, int _Y, int _Z)
- unsigned int mad(unsigned int _X, unsigned int _Y, unsigned int _Z)
- float noise(float _X)
- float radians(float _X)
- float rcp(float _X)
- unsigned int reversebits(unsigned int _X)
- float saturate(float _X)
- int sign(int _X)
- float smoothstep(float _Min, float _Max, float _X)
- float step(float _Y, float _X)
And that is all you will find in the direct3d namespace.
HLSL intrinsics
Beyond the aforementioned 20 functions, you may be wondering about other HLSL intrinsics and access to them through C++ AMP. Well, if we haven’t wrapped them for you, then you cannot use them. However we have done exactly that for many of them in our fast_math namespace, debug functions, memory fences & barriers, and ouratomic operations. If there are other intrinsics that we left out, please ask us about them (e.g. in our MSDN Forum) so we can potentially suggest a workaround or so we can consider them for a future release…
http://blogs.msdn.com/b/nativeconcurrency/archive/2012/02/24/direct3d-namespace-and-hlsl-intrinsics-in-c-amp.aspx
- C++ AMP: direct3d namespace and HLSL intrinsics in C++ AMP
- 回首C&&C++
- Number Comparison Program in Java & C
- c&cpp常见问题
- const & %c
- const & %c
- C++&&调试技巧备份
- C\C++ sizeof 陷阱&&总结
- 计算机通信c&c
- [C学习]赋值&逗号
- C#&..NET初学印象
- C++AMP介绍(一)
- C++AMP学习(1)-入门
- ICT R&amp;amp;amp;D and Innovation in the EU - increasing the scale and the impact
- 用C语言实现的Base64编码&amp;解码
- C++ AMP: C++AMP的tiled_index线程编号属性笔记
- C 碎片八 结构体&枚举&联合
- C 碎片九 预处理&位运算&文件操作
- 提高JSP执行效率的七种方法
- myeclipse cvs安装配置
- 深入研究java对String字符串对象的创建以及管理
- smartupload支持中文编码版
- HQL主动抓取关联表数据
- C++ AMP: direct3d namespace and HLSL intrinsics in C++ AMP
- 糗事网摘,悦读
- android中控件公用产生的冲突的解决办法
- java 可变数组参数
- hibernate移植多对多关系
- spring mvc中的乱码解决方法
- Eclipse Virgo插件
- 快排以及快排的中位数算法
- MFC使用CFile读写Unicode字符集文件