Will OpenMP be faster than Matlab basic commands?

1 回表示 (過去 30 日間)
Moein Mozaffarzadeh
Moein Mozaffarzadeh 2021 年 7 月 28 日
Hi,
I've written a MEX-CUDA function which takes an 1D-array as input. The data that I want to use as the input is actutally a 3D matrix (with a size of 801*96*96, and called SIG in the following code) and also not properly ordered; this is because it is the output of another device. So, I need to re-order the SIG and vectorize it before i pass to the MEX-CUDA function. I have the following code in Matlab for this purpose:
NumberOfSamplesPerTransmission=77856;
FilteredRF_Rearranged=int32(zeros(NumberOfSamplesPerTransmission*96,1));
for Tx = 1:96
NStart_Transmit = (Tx-1) * NumberOfSamplesPerTransmission;
tmp = SIG(:,:,Tx);
FilteredRF_Rearranged((1:NumberOfSamplesPerTransmission)+NStart_Transmit,1) = int32(tmp(:)); % convert the double RF data to a int32 (i.e., integer in CUDA code)
end
In my laptop, it takes about 0.1s (in average) to process the above code. This processing time is not acceptable for my application and I need to reduce it. Would OpenMP or GPU work faster than 0.1s for my porpuse? I'm asking this since I I've ran this code in Matlab parpool, but the processing time incrased. So, I'm wondering if OpenMP or GPU would be a waste of time or not?
Thanks in advacne,
Moein.

回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics and Optimization についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by