Skip to content

Commit 6e988bd

Browse files
authored
[mlir] Forward **kwargs through gentbl_shard_rule (#144001)
This allows clients to pass additional cc_library arguments through this macro to the build rules it calls.
1 parent c403cf1 commit 6e988bd

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

utils/bazel/llvm-project-overlay/mlir/tblgen.bzl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,8 @@ def gentbl_sharded_ops(
484484
test = False,
485485
includes = [],
486486
strip_include_prefix = None,
487-
deps = []):
487+
deps = [],
488+
**kwargs):
488489
"""Generate sharded op declarations and definitions.
489490
490491
This special build rule shards op definitions in a TableGen file and generates multiple copies
@@ -524,6 +525,7 @@ def gentbl_sharded_ops(
524525
td_file = td_file,
525526
test = test,
526527
deps = deps,
528+
**kwargs,
527529
)
528530
all_files = [hdr_out, src_out]
529531
for i in range(0, shard_count):
@@ -535,9 +537,14 @@ def gentbl_sharded_ops(
535537
out = out_file,
536538
sharder = sharder,
537539
src_file = src_file,
540+
**kwargs,
538541
)
539542
all_files.append(out_file)
540-
native.filegroup(name = name, srcs = all_files)
543+
native.filegroup(
544+
name = name,
545+
srcs = all_files,
546+
**kwargs,
547+
)
541548

542549
def gentbl_sharded_op_defs(name, source_file, shard_count):
543550
"""Generates multiple copies of a source file that includes sharded op definitions.

0 commit comments

Comments
 (0)