I am using a texture reference that I declare as global in one file.
texture<float4, 2, cudaReadModeElementType> texRef;
Then I have another file, where I do all the memory managment (cudamalloc & cudafree)
at the begining I was compiling one single .so library from the two files and everything worked fine.
But now I need to split those two files into two different libraries.
When I allocate memory with the first library and then run a kernel in the second I get this error :
CUDA error: invalid texture reference
as soon as I used texRef in lib2 (which is declared as global in it).
So I don’t really understand what’s going on in there.
Is there some issues here about context ?
or should I declare my texture into lib1 and somehow get the reference back to lib2 ?
if so how can I do that ?