Are there way to use windows.h in device function?

I want to use functions for allocated in header file.
but if I use functions in headers like windows.h in device function there are error

Please tell me how to solve it

In order to call a function from CUDA device code, that function must be properly decorated with __device__, and furthermore the function itself (if it exists in a library) must already be compiled for CUDA device operation.

Neither of these things would be true for functions from windows.h, so they would be unusable in CUDA device code. That is pretty much what the errors are telling you. There isn’t any straightforward way to fix this. You would need to find another library that provides similar functionality, or else write the code yourself to perform the operations you need. And attempting to use “contexts” from windows would not be possible in CUDA device code.

1 Like