-
Notifications
You must be signed in to change notification settings - Fork 825
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xtensa: Add BUILD file and workspace for nnlib_hifi4 (#2239)
The optimized kernel selection expects a lib target to be present in third_party/xtensa/nnlib_hifi4 so provide an alias there that maps to an external repository. Provide a build file to be used as the root of the nnlib_hifi4 repository and add to WORKSPACE. No build is done using this lib yet as there is no xtensa toolchain available in bazel just yet. BUG=None
- Loading branch information
Showing
3 changed files
with
79 additions
and
12 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,7 @@ | ||
alias( | ||
name = "nnlib_hifi4_lib", | ||
actual = "@nnlib_hifi4//:lib", | ||
visibility = [ | ||
"//visibility:public", | ||
], | ||
) |
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,43 @@ | ||
constraint_setting( | ||
name = "compatible_constraint", | ||
) | ||
|
||
# Set this constraint_value on your platform to indicate compatiblity with this | ||
# library. | ||
constraint_value( | ||
name = "compatible", | ||
constraint_setting = ":compatible_constraint", | ||
visibility = [ | ||
"//visibility:public", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "lib", | ||
srcs = glob(["xa_nnlib/algo/**/*.c"]), | ||
hdrs = glob([ | ||
"xa_nnlib/algo/**/*.h", | ||
"xa_nnlib/include/**/*.h", | ||
]), | ||
copts = ["-Wno-unused-parameter"], | ||
defines = [ | ||
"NNLIB_V2=1", | ||
"MODEL_INT16=1", | ||
"EIGEN_NO_MALLOC=1", | ||
"hifi4=1", | ||
], | ||
includes = [ | ||
"xa_nnlib", | ||
"xa_nnlib/algo/common/include", | ||
"xa_nnlib/algo/kernels", | ||
"xa_nnlib/algo/ndsp/hifi4/include", | ||
"xa_nnlib/include", | ||
"xa_nnlib/include/nnlib", | ||
], | ||
target_compatible_with = [ | ||
":compatible", | ||
], | ||
visibility = [ | ||
"//visibility:public", | ||
], | ||
) |