File tree 1 file changed +19
-12
lines changed 1 file changed +19
-12
lines changed Original file line number Diff line number Diff line change 1
1
function is_gpuarray = finufft_isgpuarray(input )
2
- % FINUFFT_ISGPUARRAY check if an array is an gpuArray.
3
- %
4
- % Note: this is currently unused since GPU codes have distinct cufinufft*
5
- % names.
2
+ % FINUFFT_ISGPUARRAY Check if an array is a gpuArray.
3
+
4
+ try
5
+ % Try calling MATLAB's built-in isgpuarray routine. If isgpuarray does
6
+ % not exist (e.g., because we're in Octave) then this will throw an
7
+ % error, which we catch below.
8
+ is_gpuarray = isgpuarray(input );
9
+ catch
10
+ is_gpuarray = false ;
11
+ end
12
+
13
+ % % check if the isgpuarray function is available
14
+ % if exist('isgpuarray') == 0
15
+ % % return 0, since no parallel computing toolbox, can not use gpuarray
16
+ % is_gpuarray = logical(0);
17
+ % else
18
+ % % call the parallel computing toolbox isgpuarray function
19
+ % is_gpuarray = isgpuarray(input);
20
+ % end
6
21
7
- % check if the isgpuarray function is available
8
- if exist(' isgpuarray' ) == 0
9
- % return 0, since no parallel computing toolbox, can not use gpuarray
10
- is_gpuarray = logical(0 );
11
- else
12
- % call the parallel computing toolbox isgpuarray function
13
- is_gpuarray = isgpuarray(input );
14
- end
15
22
end
You can’t perform that action at this time.
0 commit comments