Skip to content

Commit 0ca830e

Browse files
authored
[Bazel] Add Bazel build files for Python bindings of the GPU dialect (#73256)
1 parent 002d471 commit 0ca830e

File tree

1 file changed

+56
-0
lines changed
  • utils/bazel/llvm-project-overlay/mlir/python

1 file changed

+56
-0
lines changed

utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,62 @@ filegroup(
699699
],
700700
)
701701

702+
##---------------------------------------------------------------------------##
703+
# GPU dialect.
704+
##---------------------------------------------------------------------------##
705+
706+
td_library(
707+
name = "GPUOpsPyTdFiles",
708+
srcs = [],
709+
includes = ["../include"],
710+
deps = [
711+
"//mlir:GPUOpsTdFiles",
712+
"//mlir:OpBaseTdFiles",
713+
],
714+
)
715+
716+
gentbl_filegroup(
717+
name = "GPUOpsPyGen",
718+
tbl_outs = [
719+
(
720+
[
721+
"-gen-python-enum-bindings",
722+
"-bind-dialect=gpu",
723+
],
724+
"mlir/dialects/_gpu_enum_gen.py",
725+
),
726+
(
727+
[
728+
"-gen-python-op-bindings",
729+
"-bind-dialect=gpu",
730+
],
731+
"mlir/dialects/_gpu_ops_gen.py",
732+
),
733+
],
734+
tblgen = "//mlir:mlir-tblgen",
735+
td_file = "mlir/dialects/GPUOps.td",
736+
deps = [
737+
":GPUOpsPyTdFiles",
738+
],
739+
)
740+
741+
filegroup(
742+
name = "GPUOpsPyFiles",
743+
srcs = [
744+
":GPUOpsPyGen",
745+
],
746+
)
747+
748+
filegroup(
749+
name = "GPUOpsPackagePyFiles",
750+
srcs = glob(["mlir/dialects/gpu/*.py"]),
751+
)
752+
753+
filegroup(
754+
name = "GPUOpsPackagePassesPyFiles",
755+
srcs = glob(["mlir/dialects/gpu/passes/*.py"]),
756+
)
757+
702758
##---------------------------------------------------------------------------##
703759
# NVGPU dialect.
704760
##---------------------------------------------------------------------------##

0 commit comments

Comments
 (0)