Skip to content

Commit a947bef

Browse files
committed
Add maximum version parameter
1 parent ffb153d commit a947bef

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/dlpack/dlpack.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,16 @@ typedef int (*DLPackManagedTensorAllocator)( //
407407
*
408408
* \param py_object The Python object to convert; this should be PyObject*.
409409
* We use void* to avoid dependency on Python.h.
410+
*
411+
* \param max_version The maximum version of DLPack support that consumer supports.
412+
* Consumer should fill in their own version here, this parameter is not null.
413+
* Producer can use this information to produce the appropriate
414+
* DLManagedTensorVersioned for maximum compatibility if needed.
415+
* This field is primarily used for future compatibility in case
416+
* of major version bump and ABI-breaking changes.
417+
*
410418
* \param out The output DLManagedTensorVersioned.
419+
*
411420
* \param optional_out_env_stream Outputs the current context stream of the device provided
412421
* by the tensor; it can be NULL, in which case the stream will not be queried.
413422
* optional_out_env_stream should points to cudaStream_t in the case of CUDA.
@@ -420,6 +429,7 @@ typedef int (*DLPackManagedTensorAllocator)( //
420429
*/
421430
typedef int (*DLPackManagedTensorFromPyObject)( //
422431
void* py_object, //
432+
const DLPackVersion* max_version, //
423433
DLManagedTensorVersioned** out, //
424434
void** optional_out_env_stream //
425435
);

0 commit comments

Comments
 (0)