pagefun makes an error

조회 수: 11 (최근 30일)
sungho Kang
sungho Kang 2016년 9월 27일
댓글: Joss Knight 2016년 9월 28일
The following code makes an error. How can I solve it?
b = gpuArray(repmat([1 2 ; 2 2; 4 3], 1, 1, 3));
pagefun(@norm, b)
Error using gpuArray/pagefun Function passed as first input argument contains unsupported or unknown function 'norm'.
What is the corrected code?
I am using Matlab 2014a, Parallel Computing Toolbox Version 6.4 and Gigabyte GTX750.
Thanks.

채택된 답변

Edric Ellis
Edric Ellis 2016년 9월 27일
pagefun supports only a limited set of functions. These are described in the documentation.
  댓글 수: 2
sungho Kang
sungho Kang 2016년 9월 28일
Hi and thanks Edric.
But in the doc. norm is supported fun with pagefun, right?
Joss Knight
Joss Knight 2016년 9월 28일
No. The doc says:
Currently the supported values for FUN are:
Most element-wise gpuArray functions, listed in Run Built-In Functions on a GPU, and the following:
  • @ctranspose
  • @fliplr
  • @flipud
  • @inv
  • @mldivide
  • @mrdivide
  • @mtimes
  • @rot90
  • @transpose

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

추가 답변 (1개)

Joss Knight
Joss Knight 2016년 9월 27일
The corrected code is
ans = sqrt(sum(b.*b, 1));

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by