ヘルプ センターヘルプ センター
gpuArray
このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
入力が gpuArray であるかどうかの判別
R2020b 以降
TF = isgpuarray(X)
例
TF = isgpuarray(X) は、X が gpuArray の場合に logical 1 (true) を返し、それ以外の場合は logical 0 (false) を返します。この関数を if ステートメントと共に使用して、gpuArray 入力を必要とするコードの実行を回避することができます。
TF
X
1
true
0
false
if
すべて折りたたむ
乱数配列を作成します。
X = rand(3,3);
この配列を GPU にコピーします。
Y = gpuArray(X);
関数 isgpuArray を使用して、Y が gpuArray であることを確認します。
isgpuArray
Y
isgpuArray(Y)
ans = 1
X が gpuArray でないことを確認します。
isgpuarray(X)
ans = 0
入力変数。ワークスペース変数として指定します。X は、どのデータ型でも構いません。
この関数は GPU 配列を完全にサポートしています。詳細については、GPU での MATLAB 関数の実行を参照してください。
R2020b で導入
gpuArray | gather | existsOnGPU | canUseGPU
gather
existsOnGPU
canUseGPU
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office