cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

smatovic
Adept II

Host<->Device Memory Transfer during Kernel-Run?

Heyho,

i try to transfer some data between Host and OpenCL Device during the Kernel Run,

by use of "cl_mem_use_persistent_mem_amd" i figured out that i can create an Pointer to an Buffer,

this works on my CPU but not on GPU (Programm crashes).

Is it even possible to transfer Data to the GPU during the Kernel-Run?

My System:

Ubuntu Linux 12.04 64 bit, AMD X4 CPU, AMD HD 7750, Catalyst 12.6

Thanks in advance,

Srdja

0 Likes
1 Solution
notzed
Challenger

You can't modify the data during the kernel execution, if that's what you're trying to achieve.

The API wont even allow you do to it:

e.g. you can only write to a mapped buffer when it's mapped, and you can't pass a mapped buffer to enqueuendrangekernel.

Even with zero-copy buffers there are things like caches to flush and synchronise and so forth, mmu tables, etc.

Your example is invalid api use as you cannot access Pointer after calling unmap.  unmap should be considered the same way free() is: once you've called it that pointer cannot be re-used.

So, you can transfer memory whilst another kenel is in process, but you cannot modify the memory that the executing one is using.  And this is a good thing.

View solution in original post

0 Likes
13 Replies