Sharing of memory segment #485
Replies: 1 comment 3 replies
-
Hi @andrii0lomakin , can you expand on this? Not sure if I follow. Some questions I have but I think we mean different things:
Dynamic memory allocations are not allowed on GPUs.
Mixing types per buffer can be a challenge, or impossible for some drivers (e.g., NVIDIA). We tried to do something similar when we integrated Apache Flink with TornadoVM and we need to have separate buffers. It could be a solution to this by building a buffer of structs types. Each struct member has a different type. Do you mean this? If you have a test case in mind feel free to share it, so it will help us to better understand the proposal. |
Beta Was this translation helpful? Give feedback.
-
Good day.
I am curious what you think about adding the wrap(MemorySegment) method into TornadoNativeArray. There is already a slice method there. But imagine that we may use a memory segment to manage memory allocations inside GPU per task and keep different types of data in continuous memory chunks provided by such an allocator. That can be useful.
There are also possible other use cases when a single memory chunk can be sliced to keep different types of data.
If you do not mind, I can provide PR for that, especially considering that it will be small.
Beta Was this translation helpful? Give feedback.
All reactions