store a file in GPU?


I have one problem. I need to use one xls file continuously in GPU for all the kernel calls. In each call, other xls files are loaded to GPU and I need to do subtraction with this file.

But now since I do not know how to save that xls file in GPU, I am loading this xls file every time in kernel which is taking much time.

How can I manage to load that one xls file only once for all kernel calls? Can I use it as a global array? Please help…


Allocate memory on GPU (cudaMalloc), upload your xls file into this memory (cudaMemcpy) and pass this pointer to your kernel.

Did I get you right? Is xls file Microsoft Excel spreadsheet?

I’ve done exactly that but every time I call a kernel I need to pass the pointer. I need this pointer to be stored in GPU till the whole code compiles so that i won’t have to pass it again and again. Can you plz suggest me some ways??
And yes xls file is Microsoft Excel Spreadsheet file.

I use a const struct which holds parameters which are used by multiple kernels.
You could put your pointer in that parameter struct(CPU), memcpy it once to const mem, and then access the pointer in every kernel run afterwards.

(Wondering why to process an xls instead of raw data on the GPU :rolleyes: )

Thank you for your suggestion. I’ll definitely try what you’ve suggested and let you know if it works for me or not.

Well the raw data I obtain is in xls format, I read that from CPU and send it to GPU for arithematic operation. There are 501 xls files and I need to subtract 500 files in GPU by 1 file parallely and as fast as possible. But I could not store that 1 file in GPU and had to load it every time the kernel is called. I hope your suggestion works for me this time. I’ll let you know. :thanks: