warp.Allocator#

class warp.Allocator(*args, **kwargs)[source]#

Protocol for custom memory allocators.

Any object with allocate and deallocate methods matching these signatures can be used as a Warp allocator.

__init__(*args, **kwargs)[source]#

Methods

__init__(*args, **kwargs)

allocate(size_in_bytes)

Allocate memory and return a device pointer as an int.

deallocate(ptr, size_in_bytes)

Free previously allocated memory.

allocate(size_in_bytes)[source]#

Allocate memory and return a device pointer as an int.

Parameters:

size_in_bytes (int)

Return type:

int

deallocate(ptr, size_in_bytes)[source]#

Free previously allocated memory.

Parameters:
  • ptr (int)

  • size_in_bytes (int)

Return type:

None