eyalroz / cuda-api-wrappers

Thin, unified, C++-flavored wrappers for the CUDA APIs
BSD 3-Clause "New" or "Revised" License
766 stars 79 forks source link

Add a device ID field to the texture_view object #629

Closed eyalroz closed 3 months ago

eyalroz commented 4 months ago

For consistency, and for reducing the number of API calls we need to make, the cuda::texture_view_t class should gain a device_id_ member alongside its context_handle_ member.

We can then return the context, when necessary, by simple wrapping of the device ID and context handle fields, with no extra API call.

In fact, we can also do this for array_t's, which we currently aren't doing.