|
19 | 19 | #define DLPACK_MAJOR_VERSION 1 |
20 | 20 |
|
21 | 21 | /*! \brief The current minor version of dlpack */ |
22 | | -#define DLPACK_MINOR_VERSION 2 |
| 22 | +#define DLPACK_MINOR_VERSION 3 |
23 | 23 |
|
24 | 24 | /*! \brief DLPACK_DLL prefix for windows */ |
25 | 25 | #ifdef _WIN32 |
@@ -375,7 +375,7 @@ typedef struct DLManagedTensorVersioned { |
375 | 375 | } DLManagedTensorVersioned; |
376 | 376 |
|
377 | 377 | //---------------------------------------------------------------------- |
378 | | -// DLPack `__c_dlpack_exchange_api__` fast exchange protocol definitions |
| 378 | +// DLPack `__dlpack_c_exchange_api__` fast exchange protocol definitions |
379 | 379 | //---------------------------------------------------------------------- |
380 | 380 | /*! |
381 | 381 | * \brief Request a producer library to create a new tensor. |
@@ -531,16 +531,17 @@ typedef struct DLPackExchangeAPIHeader { |
531 | 531 | * \brief Framework-specific function pointers table for DLPack exchange. |
532 | 532 | * |
533 | 533 | * Additionally to `__dlpack__()` we define a C function table sharable by |
534 | | - * Python implementations via `__c_dlpack_exchange_api__`. |
535 | | - * This attribute must be set on the type as a Python integer compatible |
536 | | - * with `PyLong_FromVoidPtr`/`PyLong_AsVoidPtr`. |
| 534 | + * |
| 535 | + * Python implementations via `__dlpack_c_exchange_api__`. |
| 536 | + * This attribute must be set on the type as a Python PyCapsule |
| 537 | + * with name "dlpack_exchange_api". |
537 | 538 | * |
538 | 539 | * A consumer library may use a pattern such as: |
539 | 540 | * |
540 | 541 | * \code |
541 | 542 | * |
542 | | - * PyObject *api_obj = type(tensor_obj).__c_dlpack_exchange_api__; // as C-code |
543 | | - * MyDLPackExchangeAPI *api = PyLong_AsVoidPtr(api_obj); |
| 543 | + * PyObject *api_obj = type(tensor_obj).__dlpack_c_exchange_api__; // as C-code |
| 544 | + * MyDLPackExchangeAPI *api = PyCapsule_GetPointer(api_obj, "dlpack_exchange_api"); |
544 | 545 | * if (api == NULL && PyErr_Occurred()) { goto handle_error; } |
545 | 546 | * |
546 | 547 | * \endcode |
|
0 commit comments