简体   繁体   中英

How to copy none sequential data to a GPU memory buffer in OpenCL?

I know how i would copy a array from Host to GPU. But what happens if i have a column major matrix stored on host that i want to copy to a buffer on the GPU.

Are there other ways then copying one element at the time in a forloop ?

A_host [0 3 6 1 4 7 2 5 8].

GPUBuffer = [0 1 2 3 4 5 6 7 8].

在这种情况下,如果矩阵足够大,您可能希望“按原样”将其发送到GPU,并插入一个额外的转置内核(或将其合并到您的第一个内核)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM