Skip to content

Commit

Permalink
[GO] add two cgo api, test=develop (#29659)
Browse files Browse the repository at this point in the history
  • Loading branch information
qili93 authored Dec 17, 2020
1 parent af8ded7 commit 7684b91
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions go/paddle/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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))
}
Expand Down

0 comments on commit 7684b91

Please sign in to comment.