@@ -324,6 +324,69 @@ PADDLE_CAPI_EXPORT extern void PD_ConfigSetTrtDynamicShapeInfo(
324324 size_t * shapes_num , int32_t * * min_shape , int32_t * * max_shape ,
325325 int32_t * * optim_shape , PD_Bool disable_trt_plugin_fp16 );
326326///
327+ /// \brief A boolean state telling whether the trt dynamic_shape is used.
328+ ///
329+ /// \param[in] pd_onfig config
330+ ///
331+ PADDLE_CAPI_EXPORT extern PD_Bool PD_ConfigTensorRtDynamicShapeEnabled (
332+ __pd_keep PD_Config * pd_config );
333+ ///
334+ /// \brief Enable tuned tensorrt dynamic shape.
335+ ///
336+ /// \param[in] pd_onfig config
337+ /// \param[in] shape_range_info_path the path to shape_info file got in
338+ /// CollectShapeInfo mode.
339+ /// \param[in] allow_build_at_runtime allow build trt engine at runtime.
340+ ///
341+ PADDLE_CAPI_EXPORT extern void PD_ConfigEnableTunedTensorRtDynamicShape (
342+ __pd_keep PD_Config * pd_config , const char * shape_range_info_path ,
343+ PD_Bool allow_build_at_runtime );
344+
345+ ///
346+ /// \brief A boolean state telling whether to use tuned tensorrt dynamic
347+ /// shape.
348+ ///
349+ /// \param[in] pd_onfig config
350+ ///
351+ PADDLE_CAPI_EXPORT extern PD_Bool PD_ConfigTunedTensorRtDynamicShape (
352+ __pd_keep PD_Config * pd_config );
353+
354+ ///
355+ /// \brief A boolean state telling whether to allow building trt engine at
356+ /// runtime.
357+ ///
358+ /// \param[in] pd_onfig config
359+ ///
360+ PADDLE_CAPI_EXPORT extern PD_Bool PD_ConfigTrtAllowBuildAtRuntime (
361+ __pd_keep PD_Config * pd_config );
362+
363+ ///
364+ /// \brief Collect shape info of all tensors in compute graph.
365+ ///
366+ /// \param[in] pd_onfig config
367+ /// \param[in] shape_range_info_path the path to save shape info.
368+ ///
369+ PADDLE_CAPI_EXPORT extern void PD_ConfigCollectShapeRangeInfo (
370+ __pd_keep PD_Config * pd_config , const char * shape_range_info_path );
371+
372+ ///
373+ /// \brief the shape info path in CollectShapeInfo mode.
374+ /// Attention, Please release the string manually.
375+ ///
376+ /// \param[in] pd_onfig config
377+ ///
378+ PADDLE_CAPI_EXPORT extern const char * PD_ConfigShapeRangeInfoPath (
379+ __pd_keep PD_Config * pd_config );
380+
381+ ///
382+ /// \brief A boolean state telling whether to collect shape info.
383+ ///
384+ /// \param[in] pd_onfig config
385+ ///
386+ PADDLE_CAPI_EXPORT extern PD_Bool PD_ConfigShapeRangeInfoCollected (
387+ __pd_keep PD_Config * pd_config );
388+
389+ ///
327390/// \brief Prevent ops running in Paddle-TRT
328391/// NOTE: just experimental, not an official stable API, easy to be broken.
329392///
@@ -542,7 +605,7 @@ PADDLE_CAPI_EXPORT extern PD_Bool PD_ConfigModelFromMemory(
542605/// \param[in] pd_onfig config
543606///
544607PADDLE_CAPI_EXPORT extern void PD_ConfigEnableMemoryOptim (
545- __pd_keep PD_Config * pd_config );
608+ __pd_keep PD_Config * pd_config , PD_Bool x );
546609///
547610/// \brief A boolean state telling whether the memory optimization is
548611/// activated.
0 commit comments