cuda-api-wrappers
cuda-api-wrappers copied to clipboard
Do something about cudaCpuDeviceId and cudaInvalidDeviceId
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.
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.