matlab二维插值源码,matlab实现基于二维cuda的双线性插值

这篇博客介绍了一个使用CUDA驱动的2D双线性插值MEX程序,该程序利用NVIDIA显卡的内置纹理插值能力实现高速运算。在适当大小的操作中,CUDA代码比线性interp2快5-10倍。然而,对于非常大的矩阵,可能会导致计算机崩溃或产生奇怪结果,使用时需谨慎。
摘要由CSDN通过智能技术生成

2D CUDA-based bilinear interpolation

This MEX performs 2d bilinear interpolation using an NVIDIA graphics chipset. To compile and run this software, one needs the NVIDIA CUDA Toolkit (http://www.nvidia.com/object/cuda_get.html) and, of course, an NVIDIA graphics card of reasonably modern vintage.

BUILDING INSTRUCTIONS: Change the 'MATLAB' (and if necessary, 'MEX') variables in the Makefile to appropriate values, then simply run 'make' at a prompt and an executable (mex/mexmac/mexmaci/dll?) file will be created.

This code uses your GPU's built-in bilinear texture interpolation capability, and is very fast. For reasonably sized operations (taking, say, a 50x50 matrix up to 1000x1000) CUDA-based code is 5-10x faster than linear interp2 (as tested on a MBP 2.4GHz C2D, GeForce 8600M GT).

With very (VERY) large matrices, however, it has the capability of completely crashing your computer or giving bizarre results. Be careful!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值