Skip to content

Commit

Permalink
[PJRT C API] Move PJRT_Buffer_CopyRawToHost to end of PjRT API struct…
Browse files Browse the repository at this point in the history
…. Update struct size accordingly.

PiperOrigin-RevId: 696921394
  • Loading branch information
sizhit2 authored and Google-ML-Automation committed Nov 15, 2024
1 parent a7aff7f commit 90d59e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions xla/pjrt/c/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# PJRT C API changelog

## 0.57
* Rearranged fields in the PJRT_Api
* Update outdated struct sizes from previous changes to
``PJRT_Client_TopologyDescription`` and ``PJRT_Buffer_CopyRawToHost``.

## 0.56 (Nov 11, 2024)
* Added ``PJRT_Buffer_CopyRawToHost``

Expand Down
7 changes: 3 additions & 4 deletions xla/pjrt/c/pjrt_c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ PJRT_DEFINE_STRUCT_TRAITS(PJRT_Extension_Base, next);
// * Deleting a method or argument
// * Changing the type of an argument
// * Rearranging fields in the PJRT_Api or argument structs
#define PJRT_API_MAJOR 0
#define PJRT_API_MAJOR 1

// Incremented when the interface is updated in a way that is potentially
// ABI-compatible with older versions, if supported by the caller and/or
Expand Down Expand Up @@ -2220,7 +2220,6 @@ typedef struct PJRT_Api {
_PJRT_API_STRUCT_FIELD(PJRT_Buffer_Memory);
_PJRT_API_STRUCT_FIELD(PJRT_Buffer_Delete);
_PJRT_API_STRUCT_FIELD(PJRT_Buffer_IsDeleted);
_PJRT_API_STRUCT_FIELD(PJRT_Buffer_CopyRawToHost);
_PJRT_API_STRUCT_FIELD(PJRT_Buffer_CopyToDevice);
_PJRT_API_STRUCT_FIELD(PJRT_Buffer_ToHostBuffer);
_PJRT_API_STRUCT_FIELD(PJRT_Buffer_IsOnCpu);
Expand Down Expand Up @@ -2265,11 +2264,11 @@ typedef struct PJRT_Api {

_PJRT_API_STRUCT_FIELD(PJRT_ExecuteContext_Create);
_PJRT_API_STRUCT_FIELD(PJRT_ExecuteContext_Destroy);
_PJRT_API_STRUCT_FIELD(PJRT_Buffer_CopyRawToHost);
} PJRT_Api;

enum {
PJRT_Api_STRUCT_SIZE =
PJRT_STRUCT_SIZE(PJRT_Api, PJRT_Client_TopologyDescription)
PJRT_Api_STRUCT_SIZE = PJRT_STRUCT_SIZE(PJRT_Api, PJRT_Buffer_CopyRawToHost)
};

#undef _PJRT_API_STRUCT_FIELD
Expand Down

0 comments on commit 90d59e2

Please sign in to comment.