Address review comments.

This commit is contained in:
ag.ramesh 2020-10-19 17:00:28 -07:00
parent d0c5103757
commit c2e3dbf8c8
4 changed files with 23 additions and 19 deletions

View File

@ -74,7 +74,7 @@ void MklQuantizationRangeForMultiplication(float min_a, float max_a,
#pragma omp parallel for
#endif // !ENABLE_MKLDNN_THREADPOOL
// 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 =
MklFloatForOneQuantizedLevel<T1>(min_a, max_a);
float b_float_for_one_quant_level =

View File

@ -1,7 +1,5 @@
# Build file for OpenMP library that is part of llvm
exports_files(["LICENSE.txt"])
load(
"@org_tensorflow//third_party/llvm:llvm.bzl",
"cmake_var_string",
@ -16,6 +14,8 @@ load(
"dict_add",
)
exports_files(["LICENSE.txt"])
genrule(
name = "kmp_i18n_id",
srcs = [
@ -164,12 +164,12 @@ common_includes = [
cc_binary(
name = "libiomp5.so",
srcs = glob(cppsources + [
srcs = cppsources + [
#linux specific files
"runtime/src/z_Linux_util.cpp",
"runtime/src/kmp_gsupport.cpp",
"runtime/src/z_Linux_asm.S",
]) + srcdeps,
] + srcdeps,
copts = ["-Domp_EXPORTS -D_GNU_SOURCE -D_REENTRANT"],
includes = common_includes,
linkopts = ["-lpthread -ldl -Wl,--version-script=$(location :ldscript)"],
@ -179,11 +179,11 @@ cc_binary(
cc_binary(
name = "libiomp5md.dll",
srcs = glob(cppsources + [
srcs = cppsources + [
#window specific files
"runtime/src/z_Windows_NT_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"],
includes = common_includes,
linkopts = ["/MACHINE:X64"],
@ -192,15 +192,15 @@ cc_binary(
)
# 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(
name = "libiomp5.dylib",
srcs = glob(cppsources + [
srcs = cppsources + [
#linux/MacOS specific files
"runtime/src/z_Linux_util.cpp",
"runtime/src/kmp_gsupport.cpp",
"runtime/src/z_Linux_asm.S",
]) + srcdeps,
] + srcdeps,
copts = ["-Domp_EXPORTS -D_GNU_SOURCE -D_REENTRANT"],
includes = common_includes,
linkopts = ["-lpthread -ldl -Wl,--version-script=$(location :ldscript)"],

View File

@ -1,5 +1,6 @@
# 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):
"""Returns a new `dict` that has all the entries of the given dictionaries.

17
third_party/mkl/BUILD vendored
View File

@ -23,25 +23,25 @@ config_setting(
config_setting(
name = "build_with_mkl_lnx_openmp",
constraint_values = [
"@platforms//os:linux",
],
define_values = {
"build_with_mkl": "true",
"build_with_openmp": "true",
},
constraint_values = [
"@platforms//os:linux"
],
visibility = ["//visibility:public"],
)
config_setting(
name = "build_with_mkl_windows_openmp",
constraint_values = [
"@platforms//os:windows",
],
define_values = {
"build_with_mkl": "true",
"build_with_openmp": "true",
},
constraint_values = [
"@platforms//os:windows"
],
visibility = ["//visibility:public"],
)
@ -64,7 +64,10 @@ config_setting(
filegroup(
name = "LICENSE",
srcs = ["MKL_LICENSE"] + ["@llvm_openmp//:LICENSE.txt"],
srcs = [
"MKL_LICENSE",
"@llvm_openmp//:LICENSE.txt",
],
visibility = ["//visibility:public"],
)