How avoid memory copy GPU-CPU on imx6qp opencl?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How avoid memory copy GPU-CPU on imx6qp opencl?

601件の閲覧回数
korabelnikov
Contributor III

I use gpu through opencl (pyopencl wrapper namely) and I found that necessity coping memory to gpu before calculations and from gpu after calculations.

A memory on the chip is shared, so these copying may be excess. How to do this?

 

p.s. some authors write that avoid copying.

korabelnikov_0-1627287955021.png

 

code example. I've tried with cl.enqueue_map but without succes, maybe i did something wrong.

スポイラ
res_hist = np.zeros((height, width)).astype(np.float32)
res_hist_g = cl.Buffer(ctx, mf.WRITE_ONLY | mf.USE_HOST_PTR, hostbuf=res_hist)

kernel(queue, res_hist.shape, None, input_buffer, res_hist_g)

# this copy is necessary!
cl.enqueue_copy(queue, res_hist, res_hist_g, is_blocking=True)
ラベル(1)
タグ(4)
0 件の賞賛
1 返信

595件の閲覧回数
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello koralbelnikov,

Sorry you can avoid copy GPU/CPU when using OPenCL since the driver is from Vivante corp in binary form, you have to modify the driver source code to do this task, and is not provided, however if you have the source code please enter a case in our system.

 

Regards

 

0 件の賞賛