@@ -606,63 +606,6 @@ typedef OrtStatus*(ORT_API_CALL* OrtWriteBufferFunc)(_In_ void* state,
606606 _In_ const void * buffer,
607607 _In_ size_t buffer_num_bytes);
608608
609- /* * \brief Function called to write named binary data.
610- *
611- * This callback is currently used for EPContext binary data, but its contract is intentionally generic so future APIs
612- * can reuse it for other named data payloads. The callback is called synchronously by the component that receives it.
613- * ORT does not own or retain buffer after the callback returns. ORT does not serialize invocations made by different
614- * EP instances or worker threads.
615- *
616- * Each callback invocation represents one complete write operation for name. The callback signature does not
617- * provide an offset, sequence number, or final-chunk marker, so the component invoking the callback must define any
618- * chunked ordering and completion contract with the application. Current EPContext use should prefer a single callback
619- * invocation per EPContext binary unless chunking semantics are documented by the EP.
620- *
621- * The application's implementation can process the data in any way (e.g., encrypt and store, upload to cloud storage,
622- * or compress) before persisting it.
623- *
624- * \param[in] state Opaque pointer holding the user's state. ORT does not own or manage this pointer. The application
625- * must keep it valid for the duration required by the API that accepted the callback and must provide
626- * any synchronization required if it can be used concurrently.
627- * \param[in] name The file name or logical data identifier as a null-terminated UTF-8 string.
628- * \param[in] buffer The buffer containing data to write.
629- * \param[in] buffer_num_bytes The size of the buffer in bytes.
630- *
631- * \return OrtStatus* Write status. Return nullptr on success.
632- * Use CreateStatus to provide error info with ORT_FAIL as the error code.
633- * ORT will release the OrtStatus* if not null.
634- */
635- typedef OrtStatus*(ORT_API_CALL * OrtWriteNamedBufferFunc)(_In_ void * state,
636- _In_ const char * name,
637- _In_ const void * buffer,
638- _In_ size_t buffer_num_bytes);
639-
640- /* * \brief Function called to read named binary data.
641- *
642- * This callback is currently used for EPContext binary data, but its contract is intentionally generic so future APIs
643- * can reuse it for other named data payloads. The application reads, processes (e.g., decrypts, decompresses,
644- * downloads), and returns the requested data. ORT provides an allocator so the application can allocate the output
645- * buffer directly. The callback is called synchronously by the component that receives it. ORT does not serialize
646- * invocations made by different EP instances or worker threads.
647- *
648- * \param[in] state Opaque pointer holding the user's state. ORT does not own or manage this pointer. The application
649- * must keep it valid for the duration required by the API that accepted the callback and must provide
650- * any synchronization required if it can be used concurrently.
651- * \param[in] name The file name or logical data identifier to read as a null-terminated UTF-8 string.
652- * \param[in] allocator ORT-provided allocator. The application must use this to allocate the output buffer.
653- * \param[out] buffer Set by the implementation to the allocated buffer containing the output data.
654- * \param[out] data_size Set by the implementation to the size of the output data in bytes.
655- *
656- * \return OrtStatus* Read status. Return nullptr on success.
657- * Use CreateStatus to provide error info with ORT_FAIL as the error code.
658- * ORT will release the OrtStatus* if not null.
659- */
660- typedef OrtStatus*(ORT_API_CALL * OrtReadNamedBufferFunc)(_In_ void * state,
661- _In_ const char * name,
662- _In_ OrtAllocator* allocator,
663- _Outptr_ void ** buffer,
664- _Out_ size_t * data_size);
665-
666609/* * \brief Function called by ORT to allow user to specify how an initializer should be saved, that is, either
667610 * written to an external file or stored within the model. ORT calls this function for every initializer when
668611 * generating a model.
@@ -7594,30 +7537,6 @@ struct OrtApi {
75947537 * \since Version 1.28.
75957538 */
75967539 ORT_API_T (OrtExperimentalFnPtr, GetExperimentalFunction, _In_ const char * name);
7597-
7598- /* * \brief Registers a callback to provide EPContext binary data during session load.
7599- *
7600- * When loading a compiled model with external (non-embedded) EPContext binary data, an execution provider can
7601- * retrieve this callback from OrtEpContextConfig and call it instead of reading the binary data from disk.
7602- *
7603- * Reading happens at session load, so this callback is configured on OrtSessionOptions. The corresponding write
7604- * callback runs only at compile time and is configured on OrtModelCompilationOptions via
7605- * OrtCompileApi::ModelCompilationOptions_SetEpContextDataWriteFunc.
7606- *
7607- * The state pointer is stored as-is and is not owned by ORT. It must remain valid while any session or EP created
7608- * from these options may call the callback. If the same state may be used by multiple EPs or threads, the application
7609- * is responsible for synchronization.
7610- *
7611- * \param[in] options The OrtSessionOptions instance.
7612- * \param[in] read_func The OrtReadNamedBufferFunc callback.
7613- * \param[in] state Opaque state passed to read_func. Can be NULL.
7614- *
7615- * \snippet{doc} snippets.dox OrtStatus Return Value
7616- *
7617- * \since Version 1.28.
7618- */
7619- ORT_API2_STATUS (SessionOptions_SetEpContextDataReadFunc, _Inout_ OrtSessionOptions* options,
7620- _In_ OrtReadNamedBufferFunc read_func, _In_opt_ void * state);
76217540};
76227541
76237542/*
@@ -8460,31 +8379,6 @@ struct OrtCompileApi {
84608379 ORT_API2_STATUS (ModelCompilationOptions_SetInputModel,
84618380 _In_ OrtModelCompilationOptions* model_compile_options,
84628381 _In_ const OrtModel* model);
8463-
8464- /* * \brief Sets a callback for writing EPContext binary data during compilation.
8465- *
8466- * When EPContext embed mode is disabled, execution providers can retrieve this callback from OrtEpContextConfig and
8467- * call it instead of writing EPContext binary data directly to disk.
8468- *
8469- * Writing happens only at compile time, so this callback is configured on OrtModelCompilationOptions. The
8470- * corresponding read callback runs at session load and is configured on OrtSessionOptions via
8471- * OrtApi::SessionOptions_SetEpContextDataReadFunc.
8472- *
8473- * The state pointer is stored as-is and is not owned by ORT. It must remain valid for the duration of the compile
8474- * operation that may call the callback. If the same state may be used by multiple EPs or threads, the application is
8475- * responsible for synchronization.
8476- *
8477- * \param[in] model_compile_options The OrtModelCompilationOptions instance.
8478- * \param[in] write_func The OrtWriteNamedBufferFunc callback used to write EPContext bytes.
8479- * \param[in] state Opaque state passed to write_func. Can be NULL.
8480- *
8481- * \snippet{doc} snippets.dox OrtStatus Return Value
8482- *
8483- * \since Version 1.28.
8484- */
8485- ORT_API2_STATUS (ModelCompilationOptions_SetEpContextDataWriteFunc,
8486- _In_ OrtModelCompilationOptions* model_compile_options,
8487- _In_ OrtWriteNamedBufferFunc write_func, _In_opt_ void * state);
84888382};
84898383
84908384/* *
0 commit comments