I’m a new member in this group. Currently I’m using CUDA programming for my video codec project. I’m stuck with a problem. Here is the description…
extern “c” funcAlloc(…);
extern “c” funcCalc(…);
extern “c” funcDealloc(…);
unsigned char *d_var;
extern “c” funcAlloc(…)
extern “c” funcCalc(…)
// allocate host memory
// load host data to device
// launch kernel
extern “c” funcDealloc(…)
I get " Invalid device pointer" error .
My idea of declaring the variable ‘d_var’ as global is right???
The reason I’m doing this is because I need to allocate only once and overwrite frame data each time instead of allocating memory for every frame and deallocating each time.
Should I maintain a header .h file to declare these variables and include the header file in .cu file? I tried doing this one too. But it gives the same error.
I suppose if I allocate once n reuse the memory for every video frame data without deallocating it each time, the overall processing time will be reduced.
Can nyone help me out with this problem? Can u suggest me sme ideas for reusing the memory? It would be very helpful.