最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

MATLAB繪制曼德勃羅Mandelbrot集,并利用GPU加速

2021-12-07 23:23 作者:磁懸浮青蛙呱呱呱  | 我要投稿

???? 本文主要參考MATLAB幫助文件,Illustrating Three approaches to GPU Computing: The Mandelbrot Set,也可在網(wǎng)頁https://ww2.mathworks.cn/help/parallel-computing/illustrating-three-approaches-to-gpu-computing-the-mandelbrot-set.html上看到同樣的內(nèi)容,代碼如下:

????? 本機配置:CPU AMD Ryzen5 3600,GPU:RTX 3060,在maxIterations = 500;gridSize = 2000;xlim = [-1.5, 0.6];ylim = [ -1.2, 1.2];的條件下,生成的圖片如下,計算耗時分別是9.89s,2.448s(4倍),0.232s(42.7倍),0.068s(144.6倍),

????? 可以用colormap函數(shù)改顏色,可選參數(shù)有parula,jet,hsv,hot,cool,spring,summer,
autumn,winter,gray,bone,copper,pink,lines,colorcube,prism,flag,white

count = log(count); 取對數(shù)運算不是必須,但能提高圖像對比度,不取對數(shù)的效果如下,可以看出周圍小分支的清晰度下降

pctdemo_processMandelbrotElement.cu、.m、.ptx···在MATLAB安裝路徑下,內(nèi)容分別如下:

????????使用GPU時容易遇到如下報錯:The CUDA driver must recompile the GPU libraries because your device is more recent than the libraries.Recompiling can take several minutes. Learn more.
????????來自MATLAB官方網(wǎng)站的解答(https://ww2.mathworks.cn/matlabcentral/answers/437756-how-can-i-recompile-the-gpu-libraries):
This is a known issue with CUDA 9.1 and the new Turing generation of GPUs. You don't need to do anything except ignore the initial warning or error.
There are multiple issues. The warning about recompiling of libraries is spurious and not relevant. The error from cublas is one-time only. And there is an equivalent error in cuDNN. A permanent workaround is to put the following into your startup.m file:

????? ?一共有兩個startup.m文件,分別是
C:\Program Files\Polyspace\R2019a\toolbox\fixedpoint\fixedpointtool\+fxptui\Startup.m,
C:\Program Files\Polyspace\R2019a\toolbox\matlab\external\interfaces\python\+python\+internal\startup.m,
????? 我在這兩個文件中都加了warning off parallel:gpu:device:DeviceLibsNeedsRecompiling ……,然而沒用,警告還是會彈出。


????? 用其它形式的迭代公式生成的圖形。



MATLAB繪制曼德勃羅Mandelbrot集,并利用GPU加速的評論 (共 條)

分享到微博請遵守國家法律
衡南县| 杭锦后旗| 兴化市| 宜宾市| 巩留县| 晋城| 石城县| 平乡县| 苍梧县| 浠水县| 松溪县| 曲松县| 肇源县| 文成县| 沭阳县| 大洼县| 门头沟区| 白河县| 阜平县| 南京市| 台中市| 无棣县| 霍城县| 双桥区| 岗巴县| 新平| 青阳县| 阿克陶县| 祥云县| 五峰| 阳高县| 包头市| 怀来县| 黔东| 南丰县| 镇赉县| 隆尧县| 娱乐| 南澳县| 新野县| 嵊州市|