类型定义 | |
using | rmm::mr::allocate_callback_t = std::function< void *(std::size_t, cuda_stream_view, void *)> |
由回调内存资源用于分配的回调函数类型。 更多... | |
using | rmm::mr::deallocate_callback_t = std::function< void(void *, std::size_t, cuda_stream_view, void *)> |
由 callback_memory_resource 用于释放的回调函数类型。 更多... | |
函数 | |
template<typename T , typename U > | |
bool | rmm::mr::operator== (polymorphic_allocator< T > const &lhs, polymorphic_allocator< U > const &rhs) |
比较两个 polymorphic_allocator 的相等性。 更多... | |
template<typename T , typename U > | |
bool | rmm::mr::operator!= (polymorphic_allocator< T > const &lhs, polymorphic_allocator< U > const &rhs) |
比较两个 polymorphic_allocator 的不等性。 更多... | |
template<typename A , typename O > | |
bool | rmm::mr::operator== (stream_allocator_adaptor< A > const &lhs, stream_allocator_adaptor< O > const &rhs) |
比较两个 stream_allocator_adaptor 的相等性。 更多... | |
template<typename A , typename O > | |
bool | rmm::mr::operator!= (stream_allocator_adaptor< A > const &lhs, stream_allocator_adaptor< O > const &rhs) |
比较两个 stream_allocator_adaptor 的不等性。 更多... | |
using rmm::mr::allocate_callback_t = typedef std::function<void*(std::size_t, cuda_stream_view, void*)> |
由回调内存资源用于分配的回调函数类型。
回调函数的签名为: `void* allocate_callback_t(std::size_t bytes, cuda_stream_view stream, void* arg);
bytes
大小的分配的指针,该分配可在 stream
上立即使用。流有序行为要求与 device_memory_resource::allocate
完全相同。do_allocate
兼容,但添加了额外的函数参数 arg
。arg
提供给 callback_memory_resource
的构造函数,并将转发给每次回调函数调用。using rmm::mr::deallocate_callback_t = typedef std::function<void(void*, std::size_t, cuda_stream_view, void*)> |
由 callback_memory_resource 用于释放的回调函数类型。
回调函数的签名为: `void deallocate_callback_t(void* ptr, std::size_t bytes, cuda_stream_view stream, void* arg);
ptr
指向的内存。bytes
指定分配的大小(字节),且必须等于传递给分配回调函数时的 bytes
值。流有序行为要求与 device_memory_resource::deallocate
完全相同。do_deallocate
兼容,但添加了额外的函数参数 arg
。arg
提供给 callback_memory_resource
的构造函数,并将转发给每次回调函数调用。bool rmm::mr::operator!= | ( | polymorphic_allocator< T > const & | lhs, |
polymorphic_allocator< U > const & | rhs | ||
) |
比较两个 polymorphic_allocator
的不等性。
如果两个 polymorphic_allocator
的底层内存资源比较不等,则它们不等。
T | 第一个分配器的类型 |
U | 第二个分配器的类型 |
lhs | 要比较的第一个分配器 |
rhs | 要比较的第二个分配器 |
bool rmm::mr::operator!= | ( | stream_allocator_adaptor< A > const & | lhs, |
stream_allocator_adaptor< O > const & | rhs | ||
) |
比较两个 stream_allocator_adaptor
的不等性。
如果两个 stream_allocator_adaptor
的底层分配器比较不等,则它们不等。
A | 第一个分配器的类型 |
O | 第二个分配器的类型 |
lhs | 要比较的第一个分配器 |
rhs | 要比较的第二个分配器 |
bool rmm::mr::operator== | ( | polymorphic_allocator< T > const & | lhs, |
polymorphic_allocator< U > const & | rhs | ||
) |
比较两个 polymorphic_allocator
的相等性。
如果两个 polymorphic_allocator
的底层内存资源比较相等,则它们相等。
T | 第一个分配器的类型 |
U | 第二个分配器的类型 |
lhs | 要比较的第一个分配器 |
rhs | 要比较的第二个分配器 |
bool rmm::mr::operator== | ( | stream_allocator_adaptor< A > const & | lhs, |
stream_allocator_adaptor< O > const & | rhs | ||
) |
比较两个 stream_allocator_adaptor
的相等性。
如果两个 stream_allocator_adaptor
的底层分配器比较相等,则它们相等。
A | 第一个分配器的类型 |
O | 第二个分配器的类型 |
lhs | 要比较的第一个分配器 |
rhs | 要比较的第二个分配器 |