フィルターのクリア

does gpu coder uses gpu without using gpuArray in matlab?

1 回表示 (過去 30 日間)
Sungjin Wie
Sungjin Wie 2020 年 4 月 15 日
回答済み: Infinite_king 2024 年 1 月 9 日
I'm using gpu coder with my project.
And I've found that even if I don't use gpuArray in matlab source, the output C++ source using CUDA seems to use GPU.
Does CUDA uses GPU even if I don't use gpuArray in matlab at all?
  1 件のコメント
Pravin Jagtap
Pravin Jagtap 2020 年 4 月 29 日
Hello,
There are ways through which MATLAB achieves parallelism and generates a call to GPUs. Can you share a snippet of MATLAB code for which GPU Kernel is generated?

サインインしてコメントする。

回答 (1 件)

Infinite_king
Infinite_king 2024 年 1 月 9 日
Hi Sungjin Wie,
The short answers is yes. CUDA uses GPU even if you don't use 'gpuArrays'. Infact, GPU Coder will not support 'gpuArray' data type inside the function. More detailed answer is as follows.
CUDA is a parallel computing platform and application programming interface (API) model created by NVIDIA, enabling developers to utilize GPUs for general-purpose processing.
GPU Coder is a MATLAB toolbox that automatically generates CUDA code from MATLAB algorithms, allowing for seamless deployment of computationally intensive tasks on GPUs, ideal for accelerating numerical simulations and signal processing applications.
'gpuArray' is a MATLAB data type that represents an array stored on the GPU. When we pass 'gpuArray' to any supported function, the function will use GPU to perform the operations. Whereas, GPU Coder was used to generate CUDA code for a given MATLAB function, which can then be compiled and executed independently. GPU Coder will not support 'gpuArray' data type inside the function. The reason being, GPU Coder will automatically determine which memory or variable should be transferred to GPU and when it should be transferred.
For more details, refer the following resorces
Hope this is helpful.

カテゴリ

Help Center および File ExchangeGPU Computing についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by