File tree Expand file tree Collapse file tree 6 files changed +41
-17
lines changed Expand file tree Collapse file tree 6 files changed +41
-17
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ gpu_cpp_library(
75
75
${fbgemm_sources_include_directories}
76
76
CPU_SRCS
77
77
src/config/feature_gates.cpp
78
+ src/config/feature_gates_torch_op.cpp
78
79
DESTINATION
79
80
fbgemm_gpu)
80
81
Original file line number Diff line number Diff line change 11
11
import torch
12
12
13
13
try :
14
- torch .ops .load_library ("//deeplearning/fbgemm/fbgemm_gpu:config_cpp " )
14
+ torch .ops .load_library ("//deeplearning/fbgemm/fbgemm_gpu:config_cpp_torch_op " )
15
15
except Exception :
16
16
import fbgemm_gpu # noqa F401
17
17
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
9
+ #pragma once
10
+
11
+ /*
12
+ * We annotate the public FBGEMM functions and hide the rest. Those
13
+ * public symbols can be called via fbgemm_gpu::func() or pytorch
14
+ * operator dispatcher. We'll hide other symbols, especially CUB APIs,
15
+ * because different .so may include the same CUB CUDA kernels, which
16
+ * results in confusion and libA may end up calling libB's CUB kernel,
17
+ * causing failures when we static link libcudart_static.a
18
+ */
19
+ #define DLL_PUBLIC __attribute__((visibility("default")))
Original file line number Diff line number Diff line change @@ -29,15 +29,8 @@ __builtin_ia32_serialize(void) {
29
29
#include <ATen/core/op_registration/op_registration.h>
30
30
#include <torch/library.h>
31
31
32
- /*
33
- * We annotate the public FBGEMM functions and hide the rest. Those
34
- * public symbols can be called via fbgemm_gpu::func() or pytorch
35
- * operator dispatcher. We'll hide other symbols, especially CUB APIs,
36
- * because different .so may include the same CUB CUDA kernels, which
37
- * results in confusion and libA may end up calling libB's CUB kernel,
38
- * causing failures when we static link libcudart_static.a
39
- */
40
- #define DLL_PUBLIC __attribute__((visibility("default")))
32
+ // NOLINTNEXTLINE(misc-unused-using-decls)
33
+ #include "fbgemm_gpu/utils/function_types.h"
41
34
42
35
////////////////////////////////////////////////////////////////////////////////
43
36
/// Op Dispatch Macros
Original file line number Diff line number Diff line change 7
7
*/
8
8
9
9
#include " fbgemm_gpu/config/feature_gates.h"
10
- #include " fbgemm_gpu/utils/ops_utils .h"
10
+ #include " fbgemm_gpu/utils/function_types .h"
11
11
12
12
#ifdef FBGEMM_FBCODE
13
13
#include " fbgemm_gpu/config/feature_gates_fb.h"
14
14
#endif
15
15
16
16
#include < cstdlib>
17
17
#include < map>
18
+ #include < stdexcept>
18
19
#include < string>
19
20
20
21
namespace fbgemm_gpu ::config {
@@ -80,9 +81,3 @@ DLL_PUBLIC bool is_feature_enabled(const FbFeatureGateName& feature) {
80
81
#endif
81
82
82
83
} // namespace fbgemm_gpu::config
83
-
84
- TORCH_LIBRARY_FRAGMENT (fbgemm, m) {
85
- m.def (
86
- " check_feature_gate_key(str key) -> bool" ,
87
- fbgemm_gpu::config::check_feature_gate_key);
88
- }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
9
+ #include < torch/library.h>
10
+ #include " fbgemm_gpu/config/feature_gates.h"
11
+
12
+ TORCH_LIBRARY_FRAGMENT (fbgemm, m) {
13
+ m.def (
14
+ " check_feature_gate_key(str key) -> bool" ,
15
+ fbgemm_gpu::config::check_feature_gate_key);
16
+ }
You can’t perform that action at this time.
0 commit comments