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

Simply access-permissions-related code #639

Closed eyalroz closed 3 months ago

eyalroz commented 4 months ago

The memory::access_permissions_t structure can be much simpler. Users should not need to use it directly themselves, just pass it to functions of this library. So, let's just make it a:

struct access_permissions_t {
    bool read;
    bool write;
};

with some named constructor idioms... not as static methods. We could also probably get rid of the enum : bool type, add an access sub-namespace, and have memory::permissions::read_only(), memory::permissions::write_only(), memory::permissions::read_and_write() and memory::permissions::none().

(and maybe even shorten access_permissions() to permissions()?)