cuda::experimental::synchronous_resource_adapter#
-
template<class _Resource>
struct synchronous_resource_adapter : public cuda::mr::__copy_default_queries<_Resource># Adapter that allows a synchronous resource to be used as a resource It examines the resource for the presence of the allocate and deallocate members.
If they are present, it passes through the allocate and deallocate calls to the contained resource. Otherwise, it uses the allocate_sync and deallocate_sync members (with proper synchronization in case of deallocate).
Note
This adapter takes ownership of the contained resource.
- Template Parameters:
_Resource – The type of the resource to be adapted
Public Functions
- inline void *allocate(
- const ::cuda::stream_ref __stream,
- const size_t __bytes,
- const size_t __alignment,
- inline void *allocate_sync(
- const size_t __bytes,
- const size_t __alignment,
- inline void deallocate(
- const ::cuda::stream_ref __stream,
- void *__ptr,
- const size_t __bytes,
- const size_t __alignment,
- inline void deallocate_sync(
- void *__ptr,
- const size_t __bytes,
- const size_t __alignment,
- inline bool operator==(
- const synchronous_resource_adapter &__rhs,
Friends
-
template<class _Property>
inline friend constexpr void get_property( - const synchronous_resource_adapter &__res,
- _Property __prop,