How avoid memory copy GPU-CPU on imx6qp opencl?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How avoid memory copy GPU-CPU on imx6qp opencl?

603 次查看
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 回复

597 次查看
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 项奖励