cupy.cuda.set_pinned_memory_allocator#
- cupy.cuda.set_pinned_memory_allocator(allocator=None)#
设置固定内存的当前分配器。
- 参数:
allocator (function) – CuPy 固定内存分配器。它必须具有与
cupy.cuda.alloc_pinned_memory()
函数相同的接口,该函数接受缓冲区大小作为参数并返回该大小的设备缓冲区。当指定为None
时,将使用原始内存分配器(即禁用内存池)。