Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/FBGEMM.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Reed <jamesreed@fb.com>2018-12-06 22:33:39 +0300
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2018-12-06 23:03:21 +0300
commit895646cfe2b68e42a506c49217a635270d42bd09 (patch)
treeca731dd4c9cdacf3f2da76fc0ddba52beaeb679f
parent8335a1af9a438f9adff4bbe5964b914796c54fc5 (diff)
Fix duplicate symbols for thread local member variables (#43)
Summary: Build would fail on my mac because these TLS variables were being instantiated in both the regular and AVX512 compilation units of GenerateKernel*.cc. This moves them into the regular version, and just lets the AVX512 version link to those Pull Request resolved: https://github.com/pytorch/FBGEMM/pull/43 Reviewed By: jianyuh Differential Revision: D13362476 Pulled By: dskhudia fbshipit-source-id: e15ae957a38533df0565a1262267616dbd4ad88f
-rw-r--r--src/GenerateKernel.h12
-rw-r--r--src/GenerateKernelU8S8S32ACC16.cc13
-rw-r--r--src/GenerateKernelU8S8S32ACC32.cc12
3 files changed, 25 insertions, 12 deletions
diff --git a/src/GenerateKernel.h b/src/GenerateKernel.h
index 5a75c33..b24ef23 100644
--- a/src/GenerateKernel.h
+++ b/src/GenerateKernel.h
@@ -139,16 +139,4 @@ class CodeGenBase {
codeCache_; ///< JIT Code Cache for reuse.
};
-template <typename TA, typename TB, typename TC, typename accT>
-thread_local asmjit::JitRuntime CodeGenBase<TA, TB, TC, accT>::rt_;
-
-template <typename TA, typename TB, typename TC, typename accT>
-thread_local asmjit::CodeHolder CodeGenBase<TA, TB, TC, accT>::code_;
-
-template <typename TA, typename TB, typename TC, typename accT>
-thread_local std::map<
- std::tuple<bool, int, int>,
- typename CodeGenBase<TA, TB, TC, accT>::jit_micro_kernel_fp>
- CodeGenBase<TA, TB, TC, accT>::codeCache_;
-
} // namespace fbgemm
diff --git a/src/GenerateKernelU8S8S32ACC16.cc b/src/GenerateKernelU8S8S32ACC16.cc
index b9ab727..f845e44 100644
--- a/src/GenerateKernelU8S8S32ACC16.cc
+++ b/src/GenerateKernelU8S8S32ACC16.cc
@@ -9,6 +9,19 @@
namespace fbgemm {
+template <typename TA, typename TB, typename TC, typename accT>
+thread_local asmjit::JitRuntime CodeGenBase<TA, TB, TC, accT>::rt_;
+
+template <typename TA, typename TB, typename TC, typename accT>
+thread_local asmjit::CodeHolder CodeGenBase<TA, TB, TC, accT>::code_;
+
+template <typename TA, typename TB, typename TC, typename accT>
+thread_local std::map<
+ std::tuple<bool, int, int>,
+ typename CodeGenBase<TA, TB, TC, accT>::jit_micro_kernel_fp>
+ CodeGenBase<TA, TB, TC, accT>::codeCache_;
+
+
namespace x86 = asmjit::x86;
/**
diff --git a/src/GenerateKernelU8S8S32ACC32.cc b/src/GenerateKernelU8S8S32ACC32.cc
index 31c9996..f788872 100644
--- a/src/GenerateKernelU8S8S32ACC32.cc
+++ b/src/GenerateKernelU8S8S32ACC32.cc
@@ -9,6 +9,18 @@
namespace fbgemm {
+template <typename TA, typename TB, typename TC, typename accT>
+thread_local asmjit::JitRuntime CodeGenBase<TA, TB, TC, accT>::rt_;
+
+template <typename TA, typename TB, typename TC, typename accT>
+thread_local asmjit::CodeHolder CodeGenBase<TA, TB, TC, accT>::code_;
+
+template <typename TA, typename TB, typename TC, typename accT>
+thread_local std::map<
+ std::tuple<bool, int, int>,
+ typename CodeGenBase<TA, TB, TC, accT>::jit_micro_kernel_fp>
+ CodeGenBase<TA, TB, TC, accT>::codeCache_;
+
namespace x86 = asmjit::x86;
/**