[OpenCL]OpenCL 總整理 - HackMD

文章推薦指數: 80 %
投票人數:10人

[OpenCL]OpenCL 總整理=== ## 安裝[install packets](https://askubuntu.com/a/850594/655911) ## 編譯[what is.       Published LinkedwithGitHub Like Bookmark Subscribe [OpenCL]OpenCL總整理 === ##安裝 [installpackets](https://askubuntu.com/a/850594/655911) ##編譯 [whatisneededtocompileopenclonubuntu?(andbyextension,openclperiod)](https://stackoverflow.com/questions/7542808/what-is-needed-to-compile-opencl-on-ubuntu-and-by-extension-opencl-period) ##教學 *注意事項:影片是2013年,使用上需要注意資訊是否過期 *[OpenCL1.2:High-LevelOverview](https://www.youtube.com/watch?v=8D6yhpiQVVI) *[NVIDIA-IntroductiontoOpenCL](https://www.cc.gatech.edu/~vetter/keeneland/tutorial-2011-04-14/06-intro_to_opencl.pdf) *[TheOpenCLC++WrapperAPI](https://www.khronos.org/registry/OpenCL/specs/opencl-cplusplus-1.2.pdf) *[OptimizingComputerVisionApplicationsUsingOpenCLandGPUs](https://www.embedded-vision.com/platinum-members/embedded-vision-alliance/embedded-vision-training/documents/pages/opencl-gpus) ###名詞解釋 *platform:一個特定的OpenCL實作方式,ex.AMDAPP,NVIDIA以及Intel在自家硬體上實作OpenCL *context:一個patform,它可以看到一至數個可加速裝置(device),在runtime執行的時候能夠將運算link到硬體裝置上 *device:這邊的裝置指的是真正能用來加速的硬體,exCPU、GPU 名詞解釋-參考資料 *[Inopenclwhatisthedifferencebetweenplatform,contextanddevice?[closed]](https://stackoverflow.com/questions/12988986/in-opencl-what-is-the-difference-between-platform-context-and-device) *[Tutorial:SimplestartwithOpenCLandC++](http://simpleopencl.blogspot.tw/2013/06/tutorial-simple-start-with-opencl-and-c.html) ###基本的模型解釋 ![](https://i.imgur.com/mI9FtZ3.png) Device內部的大致長相 ![](https://i.imgur.com/vN9sUwk.png) ![](https://i.imgur.com/iYBaLdf.png) ComputingUnit(CU)內部是Device內的基本處理單元 內部擁有數個ProcsessingElement(PE)以及LocalMemory 我們可以簡單的把PE看做一個非常簡單的處理器(processor) 並且,所有指令都是在PE上執行 ![](https://i.imgur.com/6IQFX7e.png) 記憶體區域 ![](https://i.imgur.com/fYj9T4V.png) *GlobalMemory *與所有PE共享 *Host也能存取(access) *MemoryMap *從GlobalMemory複製資料 *ConstantMemory *與所有PE共享 ![](https://i.imgur.com/LQe9a40.png) *LocalMemory *只有與CU內部的PE共享 *與CU內部的PE共享資料非常有效率 *不能夠跨CU存取 *PrivateMemory *只有專屬的單個PE擁有存取權 ###OpenCLGPU架構 ![](https://i.imgur.com/oTj8Urt.png) OpenCL加法示意圖 ![](https://i.imgur.com/ZPEfkbx.png) ##開始撰寫OpenCL程式 *[GettingstartedwithOpenCLandGPUComputing](https://www.eriksmistad.no/getting-started-with-opencl-and-gpu-computing/) *[20.1.3什麼是make與configure](http://linux.vbird.org/linux_basic/0520source_code_and_tarball.php#intro_make) >執行make時,make會在當時的目錄下搜尋Makefile(ormakefile)這個文字檔,而Makefile裡面則記錄了原始碼如何編譯的詳細資訊 *[OpenCL語法](https://hackmd.io/s/SJBMZEi2-) --- ##OpenCV以OpenCL加速 *[以OpenCL加速程式](https://hackmd.io/BwVmCZIRgTgWhgE2AUzgFhitAjFBDAYzn2B3wDMYYA2YABhAGYg=?both#以-opencl-加速程式) --- ##OpenCLEventModel 詳細請看下面的連結 *[OpenCL-EventModel](https://hackmd.io/s/H1Ig0873b) ######tags:`OpenCL` × Signin Email Password Forgotpassword or Byclickingbelow,youagreetoourtermsofservice. SigninviaFacebook SigninviaTwitter SigninviaGitHub SigninviaDropbox SigninviaGoogle NewtoHackMD?Signup



請為這篇文章評分?