-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable use of TensorFlow XNNPACK delegate for accelerating infe…
…rence performance
- Loading branch information
Showing
5 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package birdnet | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
) | ||
|
||
// CheckXNNPACKLibrary checks for the presence of libXNNPACK.a in typical Debian Linux library paths | ||
func CheckXNNPACKLibrary() bool { | ||
libraryPaths := []string{ | ||
"/usr/lib", | ||
"/usr/local/lib", | ||
"/lib", | ||
"/lib/x86_64-linux-gnu", | ||
"/usr/lib/x86_64-linux-gnu", | ||
} | ||
|
||
for _, path := range libraryPaths { | ||
fullPath := filepath.Join(path, "libXNNPACK.a") | ||
if _, err := os.Stat(fullPath); err == nil { | ||
// XNNPACK library is present | ||
return true | ||
} | ||
} | ||
|
||
return false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters