griddedInterpolant not a built-In Functions on a GPU

조회 수: 8 (최근 30일)
Massimo
Massimo 2017년 12월 22일
댓글: Joss Knight 2018년 1월 20일
To make my code faster I have implemented "griddedInterpolant " instead of "interp1". Now I have a GPU but "griddedInterpolant" does not support gpu arrays, whereas "interp1" does. If this is the case I have to rewrite my code, using interp1. Is there a solution?

채택된 답변

Joss Knight
Joss Knight 2018년 1월 18일
I'm not sure what you're asking, but if you're asking "am I right that I have to rewrite my code?" then yes, you are right.
  댓글 수: 2
Massimo
Massimo 2018년 1월 18일
Thank you the answer. My question was bad posed. What I meant is if there is a way to implement "griddedInterpolant" with GPU anyway, since interp1 which works with GPU is based on "griddedInterpolant". Moreover, "interp1" in GPU does not implement "spline" but only "v5cubic", which does not permit extrapolation. Are there other ways to perform the interpolation with GPU? Perhaps in the future version of matlab?
Joss Knight
Joss Knight 2018년 1월 20일
GPU interp is a custom implementation and is not based on griddedInterpolant. Of course you can write your own implementation. If you write it in MATLAB code it's unlikely to be faster than just calling interp, in spite of the time saved computing the interpolation weights (which is why we have griddedInterpolant).
Spline interpolation is being supported in a future MATLAB, although I'm not sure if extrapolation will be. You can find another way to do extrapolation, perhaps by padding your input.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 GPU Computing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by