Address review comments.
This commit is contained in:
parent
d0c5103757
commit
c2e3dbf8c8
@ -74,7 +74,7 @@ void MklQuantizationRangeForMultiplication(float min_a, float max_a,
|
|||||||
#pragma omp parallel for
|
#pragma omp parallel for
|
||||||
#endif // !ENABLE_MKLDNN_THREADPOOL
|
#endif // !ENABLE_MKLDNN_THREADPOOL
|
||||||
// TODO: Add eigen parallel_for
|
// TODO: Add eigen parallel_for
|
||||||
for (ssize_t n = 0; n < n_channel; ++n) {
|
for (int64_t n = 0; n < n_channel; ++n) {
|
||||||
float a_float_for_one_quant_level =
|
float a_float_for_one_quant_level =
|
||||||
MklFloatForOneQuantizedLevel<T1>(min_a, max_a);
|
MklFloatForOneQuantizedLevel<T1>(min_a, max_a);
|
||||||
float b_float_for_one_quant_level =
|
float b_float_for_one_quant_level =
|
||||||
|
18
third_party/llvm_openmp/BUILD
vendored
18
third_party/llvm_openmp/BUILD
vendored
@ -1,7 +1,5 @@
|
|||||||
# Build file for OpenMP library that is part of llvm
|
# Build file for OpenMP library that is part of llvm
|
||||||
|
|
||||||
exports_files(["LICENSE.txt"])
|
|
||||||
|
|
||||||
load(
|
load(
|
||||||
"@org_tensorflow//third_party/llvm:llvm.bzl",
|
"@org_tensorflow//third_party/llvm:llvm.bzl",
|
||||||
"cmake_var_string",
|
"cmake_var_string",
|
||||||
@ -16,6 +14,8 @@ load(
|
|||||||
"dict_add",
|
"dict_add",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
exports_files(["LICENSE.txt"])
|
||||||
|
|
||||||
genrule(
|
genrule(
|
||||||
name = "kmp_i18n_id",
|
name = "kmp_i18n_id",
|
||||||
srcs = [
|
srcs = [
|
||||||
@ -164,12 +164,12 @@ common_includes = [
|
|||||||
|
|
||||||
cc_binary(
|
cc_binary(
|
||||||
name = "libiomp5.so",
|
name = "libiomp5.so",
|
||||||
srcs = glob(cppsources + [
|
srcs = cppsources + [
|
||||||
#linux specific files
|
#linux specific files
|
||||||
"runtime/src/z_Linux_util.cpp",
|
"runtime/src/z_Linux_util.cpp",
|
||||||
"runtime/src/kmp_gsupport.cpp",
|
"runtime/src/kmp_gsupport.cpp",
|
||||||
"runtime/src/z_Linux_asm.S",
|
"runtime/src/z_Linux_asm.S",
|
||||||
]) + srcdeps,
|
] + srcdeps,
|
||||||
copts = ["-Domp_EXPORTS -D_GNU_SOURCE -D_REENTRANT"],
|
copts = ["-Domp_EXPORTS -D_GNU_SOURCE -D_REENTRANT"],
|
||||||
includes = common_includes,
|
includes = common_includes,
|
||||||
linkopts = ["-lpthread -ldl -Wl,--version-script=$(location :ldscript)"],
|
linkopts = ["-lpthread -ldl -Wl,--version-script=$(location :ldscript)"],
|
||||||
@ -179,11 +179,11 @@ cc_binary(
|
|||||||
|
|
||||||
cc_binary(
|
cc_binary(
|
||||||
name = "libiomp5md.dll",
|
name = "libiomp5md.dll",
|
||||||
srcs = glob(cppsources + [
|
srcs = cppsources + [
|
||||||
#window specific files
|
#window specific files
|
||||||
"runtime/src/z_Windows_NT_util.cpp",
|
"runtime/src/z_Windows_NT_util.cpp",
|
||||||
"runtime/src/z_Windows_NT-586_util.cpp",
|
"runtime/src/z_Windows_NT-586_util.cpp",
|
||||||
]) + srcdeps + [":openmp_asm"],
|
] + srcdeps + [":openmp_asm"],
|
||||||
copts = ["/Domp_EXPORTS /D_M_AMD64 /DOMPT_SUPPORT=0 /D_WINDOWS /D_WINNT /D_USRDLL"],
|
copts = ["/Domp_EXPORTS /D_M_AMD64 /DOMPT_SUPPORT=0 /D_WINDOWS /D_WINNT /D_USRDLL"],
|
||||||
includes = common_includes,
|
includes = common_includes,
|
||||||
linkopts = ["/MACHINE:X64"],
|
linkopts = ["/MACHINE:X64"],
|
||||||
@ -192,15 +192,15 @@ cc_binary(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# MacOS build has not been tested, however since the MacOS build of openmp
|
# MacOS build has not been tested, however since the MacOS build of openmp
|
||||||
# uses the same configuration as Lunix, the following should work.
|
# uses the same configuration as Linux, the following should work.
|
||||||
cc_binary(
|
cc_binary(
|
||||||
name = "libiomp5.dylib",
|
name = "libiomp5.dylib",
|
||||||
srcs = glob(cppsources + [
|
srcs = cppsources + [
|
||||||
#linux/MacOS specific files
|
#linux/MacOS specific files
|
||||||
"runtime/src/z_Linux_util.cpp",
|
"runtime/src/z_Linux_util.cpp",
|
||||||
"runtime/src/kmp_gsupport.cpp",
|
"runtime/src/kmp_gsupport.cpp",
|
||||||
"runtime/src/z_Linux_asm.S",
|
"runtime/src/z_Linux_asm.S",
|
||||||
]) + srcdeps,
|
] + srcdeps,
|
||||||
copts = ["-Domp_EXPORTS -D_GNU_SOURCE -D_REENTRANT"],
|
copts = ["-Domp_EXPORTS -D_GNU_SOURCE -D_REENTRANT"],
|
||||||
includes = common_includes,
|
includes = common_includes,
|
||||||
linkopts = ["-lpthread -ldl -Wl,--version-script=$(location :ldscript)"],
|
linkopts = ["-lpthread -ldl -Wl,--version-script=$(location :ldscript)"],
|
||||||
|
1
third_party/llvm_openmp/openmp.bzl
vendored
1
third_party/llvm_openmp/openmp.bzl
vendored
@ -1,5 +1,6 @@
|
|||||||
# This file contains BUILD extensions for building llvm_openmp.
|
# This file contains BUILD extensions for building llvm_openmp.
|
||||||
|
|
||||||
|
# TODO(Intel-tf), delete this and re-use a similar function in third_party/llvm.
|
||||||
def dict_add(*dictionaries):
|
def dict_add(*dictionaries):
|
||||||
"""Returns a new `dict` that has all the entries of the given dictionaries.
|
"""Returns a new `dict` that has all the entries of the given dictionaries.
|
||||||
|
|
||||||
|
21
third_party/mkl/BUILD
vendored
21
third_party/mkl/BUILD
vendored
@ -23,25 +23,25 @@ config_setting(
|
|||||||
|
|
||||||
config_setting(
|
config_setting(
|
||||||
name = "build_with_mkl_lnx_openmp",
|
name = "build_with_mkl_lnx_openmp",
|
||||||
|
constraint_values = [
|
||||||
|
"@platforms//os:linux",
|
||||||
|
],
|
||||||
define_values = {
|
define_values = {
|
||||||
"build_with_mkl": "true",
|
"build_with_mkl": "true",
|
||||||
"build_with_openmp": "true",
|
"build_with_openmp": "true",
|
||||||
},
|
},
|
||||||
constraint_values = [
|
|
||||||
"@platforms//os:linux"
|
|
||||||
],
|
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
config_setting(
|
config_setting(
|
||||||
name = "build_with_mkl_windows_openmp",
|
name = "build_with_mkl_windows_openmp",
|
||||||
|
constraint_values = [
|
||||||
|
"@platforms//os:windows",
|
||||||
|
],
|
||||||
define_values = {
|
define_values = {
|
||||||
"build_with_mkl": "true",
|
"build_with_mkl": "true",
|
||||||
"build_with_openmp": "true",
|
"build_with_openmp": "true",
|
||||||
},
|
},
|
||||||
constraint_values = [
|
|
||||||
"@platforms//os:windows"
|
|
||||||
],
|
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -64,7 +64,10 @@ config_setting(
|
|||||||
|
|
||||||
filegroup(
|
filegroup(
|
||||||
name = "LICENSE",
|
name = "LICENSE",
|
||||||
srcs = ["MKL_LICENSE"] + ["@llvm_openmp//:LICENSE.txt"],
|
srcs = [
|
||||||
|
"MKL_LICENSE",
|
||||||
|
"@llvm_openmp//:LICENSE.txt",
|
||||||
|
],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -104,10 +107,10 @@ cc_library(
|
|||||||
":mkl_libs_linux",
|
":mkl_libs_linux",
|
||||||
],
|
],
|
||||||
"@org_tensorflow//tensorflow:macos": [
|
"@org_tensorflow//tensorflow:macos": [
|
||||||
":mkl_libs_darwin",
|
":mkl_libs_darwin",
|
||||||
],
|
],
|
||||||
"@org_tensorflow//tensorflow:windows": [
|
"@org_tensorflow//tensorflow:windows": [
|
||||||
":mkl_libs_windows",
|
":mkl_libs_windows",
|
||||||
],
|
],
|
||||||
"//conditions:default": [],
|
"//conditions:default": [],
|
||||||
}),
|
}),
|
||||||
|
Loading…
Reference in New Issue
Block a user