Skip to content

Commit

Permalink
Bazel build definition to use filelists from defs.bzl (pytorch#348)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#348

Add missing public headers to defs.bzl

Reviewed By: kostmo, seemethere

Differential Revision: D20955121

fbshipit-source-id: 7ee15f40c859e8699550c975c496fff5c96825a2
  • Loading branch information
malfet authored and facebook-github-bot committed Apr 10, 2020
1 parent 81b956b commit f1d3330
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 130 deletions.
135 changes: 5 additions & 130 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("@bazel_skylib//lib:paths.bzl", "paths")
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load("defs.bzl", "get_fbgemm_generic_srcs", "get_fbgemm_avx2_srcs", "get_fbgemm_avx512_srcs", "get_fbgemm_public_headers")

cc_library(
name = "fbgemm_src_headers",
Expand All @@ -12,50 +13,7 @@ cc_library(
cc_library(
name = "fbgemm",
visibility = ["//visibility:public"],
srcs = [
"src/EmbeddingSpMDM.cc",
"src/EmbeddingSpMDMNBit.cc",
"src/ExecuteKernel.cc",
"src/ExecuteKernelU8S8.cc",
"src/Fbgemm.cc",
"src/FbgemmBfloat16Convert.cc",
"src/FbgemmConv.cc",
"src/FbgemmFP16.cc",
"src/FbgemmFloat16Convert.cc",
"src/FbgemmI64.cc",
"src/FbgemmI8Spmdm.cc",
"src/GenerateKernelU8S8S32ACC16.cc",
"src/GenerateKernelU8S8S32ACC16Avx512.cc",
"src/GenerateKernelU8S8S32ACC16Avx512VNNI.cc",
"src/GenerateKernelU8S8S32ACC32.cc",
"src/GenerateKernelU8S8S32ACC32Avx512.cc",
"src/GenerateKernelU8S8S32ACC32Avx512VNNI.cc",
"src/GroupwiseConvAcc32Avx2.cc",
"src/PackAMatrix.cc",
"src/PackAWithIm2Col.cc",
"src/PackBMatrix.cc",
"src/PackMatrix.cc",
"src/PackAWithQuantRowOffset.cc",
"src/PackAWithRowOffset.cc",
"src/PackWeightMatrixForGConv.cc",
"src/PackWeightsForConv.cc",
"src/QuantUtils.cc",
"src/RefImplementations.cc",
"src/RowWiseSparseAdagradFused.cc",
"src/SparseAdagrad.cc",
"src/Utils.cc",
# Private headers
"src/CodeCache.h",
"src/CodeGenHelpers.h",
"src/ExecuteKernel.h",
"src/ExecuteKernelGeneric.h",
"src/ExecuteKernelU8S8.h",
"src/FbgemmFP16Common.h",
"src/GenerateKernel.h",
"src/GroupwiseConv.h",
"src/RefImplementations.h",
"src/TransposeUtils.h",
],
srcs = get_fbgemm_generic_srcs() + glob(["src/*.h"]),
includes = [
"src",
],
Expand All @@ -72,34 +30,7 @@ cc_library(

cc_library(
name = "fbgemm_avx2",
srcs = [
"src/EmbeddingSpMDMAvx2.cc",
"src/FbgemmBfloat16ConvertAvx2.cc",
"src/FbgemmFloat16ConvertAvx2.cc",
"src/FbgemmI8Depthwise3DAvx2.cc",
"src/FbgemmI8Depthwise3x3Avx2.cc",
"src/FbgemmI8DepthwiseAvx2.cc",
"src/FbgemmI8DepthwisePerChannelQuantAvx2.cc",
"src/GenerateI8Depthwise.cc",
"src/OptimizedKernelsAvx2.cc",
"src/PackDepthwiseConvMatrixAvx2.cc",
"src/QuantUtilsAvx2.cc",
"src/UtilsAvx2.cc",
# Inline Assembly sources
"src/FbgemmFP16UKernelsAvx2.cc",
# Private headers
"src/CodeCache.h",
"src/CodeGenHelpers.h",
"src/FbgemmFP16Common.h",
"src/FbgemmFP16UKernelsAvx2.h",
"src/FbgemmI8Depthwise2DAvx2-inl.h",
"src/FbgemmI8DepthwiseAvx2-inl.h",
"src/GenerateI8Depthwise.h",
"src/MaskAvx2.h",
"src/OptimizedKernelsAvx2.h",
"src/TransposeUtils.h",
"src/TransposeUtilsAvx2.h",
],
srcs = get_fbgemm_avx2_srcs() + glob(["src/*.h"]),
copts = [
"-m64",
"-mavx2",
Expand All @@ -114,37 +45,9 @@ cc_library(
linkstatic = 1,
)

cc_library(
name = "fbgemm_avx2_headers",
includes = [
"src",
],
hdrs = [
"src/FbgemmFP16UKernelsAvx2.h",
"src/MaskAvx2.h",
"src/OptimizedKernelsAvx2.h",
],
)

cc_library(
name = "fbgemm_avx512",
srcs = [
"src/FbgemmBfloat16ConvertAvx512.cc",
"src/FbgemmFloat16ConvertAvx512.cc",
"src/UtilsAvx512.cc",
# Inline Assembly sources
"src/FbgemmFP16UKernelsAvx512.cc",
"src/FbgemmFP16UKernelsAvx512_256.cc",
# Private headers
"src/FbgemmFP16UKernelsAvx512.h",
"src/FbgemmFP16Common.h",
"src/MaskAvx2.h",
"src/TransposeUtils.h",
"src/TransposeUtilsAvx2.h",
],
hdrs = [
"src/FbgemmFP16UKernelsAvx512_256.h",
],
srcs = get_fbgemm_avx512_srcs() + glob(["src/*.h"]),
copts = [
"-m64",
"-mfma",
Expand All @@ -160,37 +63,9 @@ cc_library(
linkstatic = 1,
)

cc_library(
name = "fbgemm_avx512_headers",
includes = [
"src",
],
hdrs = [
"src/FbgemmFP16UKernelsAvx512.h",
"src/FbgemmFP16UKernelsAvx512_256.h",
],
)

cc_library(
name = "fbgemm_headers",
hdrs = [
"include/fbgemm/ConvUtils.h",
"include/fbgemm/Fbgemm.h",
"include/fbgemm/FbgemmBuild.h",
"include/fbgemm/FbgemmConvert.h",
"include/fbgemm/FbgemmEmbedding.h",
"include/fbgemm/FbgemmFP16.h",
"include/fbgemm/FbgemmI64.h",
"include/fbgemm/FbgemmI8DepthwiseAvx2.h",
"include/fbgemm/FbgemmI8Spmdm.h",
"include/fbgemm/OutputProcessing-inl.h",
"include/fbgemm/PackingTraits-inl.h",
"include/fbgemm/QuantUtils.h",
"include/fbgemm/QuantUtilsAvx2.h",
"include/fbgemm/Types.h",
"include/fbgemm/Utils.h",
"include/fbgemm/UtilsAvx2.h",
],
hdrs = get_fbgemm_public_headers(),
includes = [
"include",
],
Expand Down
3 changes: 3 additions & 0 deletions defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def get_fbgemm_public_headers(with_fp16 = False):
"include/fbgemm/Fbgemm.h",
"include/fbgemm/FbgemmBuild.h",
"include/fbgemm/FbgemmFP16.h",
"include/fbgemm/FbgemmEmbedding.h",
"include/fbgemm/FbgemmConvert.h",
"include/fbgemm/FbgemmI64.h",
"include/fbgemm/FbgemmI8DepthwiseAvx2.h",
"include/fbgemm/OutputProcessing-inl.h",
"include/fbgemm/PackingTraits-inl.h",
Expand Down

0 comments on commit f1d3330

Please sign in to comment.