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

歡迎光臨散文網(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加速的評論 (共 條)

分享到微博請遵守國家法律
呼和浩特市| 舞钢市| 内乡县| 奉新县| 浏阳市| 开平市| 陆丰市| 南雄市| 郸城县| 茌平县| 城市| 澄江县| 蛟河市| 乌鲁木齐县| 晋州市| 富民县| 桐柏县| 阜宁县| 静海县| 宜宾县| 南康市| 吴旗县| 忻城县| 临朐县| 霍林郭勒市| 桃江县| 浙江省| 石屏县| 永安市| 楚雄市| 罗城| 潜江市| 博野县| 内黄县| 宜兰县| 黎川县| 乃东县| 阿城市| 诸城市| 宝兴县| 江城|