[問題] 將OpenCL code轉為單一C function

看板C_and_CPP作者時間9年前 (2016/03/13 14:30), 編輯推噓2(201)
留言3則, 3人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) Xcode 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) OpenCL 問題(Question): 自學OpenCL差不多一個月 最近將OpenCL的host(.c) & kernel(.cl) codes 完成 一般都是call standard C code from OpenCL C code. 想請問我如何將kernel function寫成可直接作為單一C的程式? 例如我的kernel name: square (___kernel void square( global float* input, global float* output)) 如何將其直接寫成一個square.gpu(input, output)的c function? 看網路上沒找到類似的寫法: #include "main.c" #include "kernel.cl" 謝謝 補充說明(Supplement): -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 144.82.190.69 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1457879424.A.5DC.html

03/14 07:07, , 1F
Boost. Compute
03/14 07:07, 1F

03/14 08:40, , 2F
把該包的API calls包進去你要的square.gpu阿
03/14 08:40, 2F

03/14 19:34, , 3F
可以看看 SYCL or C++AMP
03/14 19:34, 3F
文章代碼(AID): #1MvNc0NS (C_and_CPP)