From 7684b91817452a605823990521cec6df7e8e6a2d Mon Sep 17 00:00:00 2001 From: Qi Li Date: Thu, 17 Dec 2020 10:31:19 +0800 Subject: [PATCH] [GO] add two cgo api, test=develop (#29659) --- go/paddle/config.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/go/paddle/config.go b/go/paddle/config.go index dcdb64008be..89f7d7e63ff 100644 --- a/go/paddle/config.go +++ b/go/paddle/config.go @@ -94,6 +94,10 @@ func (config *AnalysisConfig) MemoryPoolInitSizeMb() int { return int(C.PD_MemoryPoolInitSizeMb(config.c)) } +func (config *AnalysisConfig) FractionOfGpuMemoryForPool() float32 { + return float32(C.PD_FractionOfGpuMemoryForPool(config.c)) +} + func (config *AnalysisConfig) EnableCudnn() { C.PD_EnableCUDNN(config.c) } @@ -142,6 +146,10 @@ func (config *AnalysisConfig) EnableMkldnn() { C.PD_EnableMKLDNN(config.c) } +func (config *AnalysisConfig) MkldnnEnabled() bool { + return ConvertCBooleanToGo(C.PD_MkldnnEnabled(config.c)) +} + func (config *AnalysisConfig) SetCpuMathLibraryNumThreads(n int) { C.PD_SetCpuMathLibraryNumThreads(config.c, C.int(n)) } -- GitLab