cuda-api-wrappers icon indicating copy to clipboard operation
cuda-api-wrappers copied to clipboard

Do something about cudaCpuDeviceId and cudaInvalidDeviceId

Open eyalroz opened this issue 4 years ago • 1 comments

Some API calls may return cudaCpuDeviceId to indicate host memory as a location, or cudaInvalidDeviceId to indicate no single location. Right now, we are completely oblivious to these values - but we probably shouldn't. At the very least we need to be able to check against them; and in fact, it might be reasonable to have some sort of union class with three possible states: An actual device, CPU device, or none/disengaged/empty.

eyalroz avatar Jul 18 '20 21:07 eyalroz

Commit bc53844e introduced cuda::device::cpu(), which gets you a wrapped CPU "device". However, there's no special treatment for it. You can still try (and fail) to create events and streams on it, etc.

eyalroz avatar Apr 16 '22 07:04 eyalroz