KomputeProject / kompute

General purpose GPU compute framework built on Vulkan to support 1000s of cross vendor graphics cards (AMD, Qualcomm, NVIDIA & friends). Blazing fast, mobile-enabled, asynchronous and optimized for advanced GPU data processing usecases. Backed by the Linux Foundation.
http://kompute.cc/
Apache License 2.0
1.98k stars 153 forks source link

read/write operations from disk from GPU/device arrays ? #299

Closed mkandulavm closed 2 years ago

mkandulavm commented 2 years ago

Hi

I have a question or a feature request evaluation. Consider we have a text file / json that can be read into a array of a structure.

Is there a way to read/write from this file directly into/from GPU arrays ? Is this a viable request ? If this is possible, Can Kompute be developed to handle such a functionality ?

What I am asking is the ability to handle FILE IO using parallel operations into GPU/device arrays.

Kindly provide feedback.

axsaucedo commented 2 years ago

I'm not sure I fully understand the usecase, if what you mean is to load the contents of a file and load it into GPU memory, however I would assume the contents of the file would include contents that could be mapped into a respective array, so this would require parsing into an int / float array, and then a kp::Tensor can be created with that data, which can then be copied into GPU memory. Does that make sense?

mkandulavm commented 2 years ago

Ya. Sorry for not giving full details. Based on what you say, I still need CPU to load from disk to RAM before it can put to GPU array.

Either ways, thank you for the response. I will try some variations at my end and ask more relevant question.