@@ -28,6 +28,17 @@ td_library(
2828 ],
2929)
3030
31+ td_library (
32+ name = "TensorKindInterfaceTdFiles" ,
33+ srcs = [
34+ "tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.td" ,
35+ ],
36+ includes = ["tensorrt/include" ],
37+ deps = [
38+ "@llvm-project//mlir:OpBaseTdFiles" ,
39+ ],
40+ )
41+
3142gentbl_cc_library (
3243 name = "TensorRTOpsIncGen" ,
3344 strip_include_prefix = "tensorrt/include" ,
@@ -159,50 +170,31 @@ gentbl_cc_library(
159170 ],
160171)
161172
162- cc_library (
163- name = "TensorRTDialect" ,
164- srcs = [
165- "tensorrt/lib/TensorRT/IR/EinsumHelper.cpp" ,
166- "tensorrt/lib/TensorRT/IR/EinsumHelper.h" ,
167- "tensorrt/lib/TensorRT/IR/TensorKindOpInterfaceImpl.cpp" ,
168- "tensorrt/lib/TensorRT/IR/TensorRT.cpp" ,
169- "tensorrt/lib/TensorRT/IR/TypeInferenceInterfaceImpls.cpp" ,
170- "tensorrt/lib/TensorRT/IR/Verification.cpp" ,
171- ],
172- hdrs = [
173- "tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.h" ,
174- "tensorrt/include/mlir-tensorrt-dialect/TensorRT/IR/TensorRTDialect.h" ,
175- ],
173+ gentbl_cc_library (
174+ name = "TensorRTTensorKindInterfacesIncGen" ,
176175 strip_include_prefix = "tensorrt/include" ,
177- deps = [
178- ":TensorRTAttrInterfacesIncGen" ,
179- ":TensorRTAttributesIncGen" ,
180- ":TensorRTCommonUtils" ,
181- ":TensorRTEnumsIncGen" ,
182- ":TensorRTInterfacesIncGen" ,
183- ":TensorRTOpsIncGen" ,
184- ":TensorRTTensorKindInterfacesIncGen" ,
185- "@llvm-project//mlir:ControlFlowInterfaces" ,
186- "@llvm-project//mlir:DestinationStyleOpInterface" ,
187- "@llvm-project//mlir:DialectUtils" ,
188- "@llvm-project//mlir:FuncDialect" ,
189- "@llvm-project//mlir:LoopLikeInterface" ,
190- "@llvm-project//mlir:QuantOps" ,
191- "@llvm-project//mlir:TensorDialect" ,
192- ],
193- )
194-
195- cc_library (
196- name = "TensorRTUtils" ,
197- srcs = [
198- "tensorrt/lib/TensorRT/Utils/Utils.cpp" ,
199- ],
200- hdrs = [
201- "tensorrt/include/mlir-tensorrt-dialect/TensorRT/Utils/Utils.h" ,
176+ tbl_outs = [
177+ (
178+ ["-gen-op-interface-decls" ],
179+ "tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.h.inc" ,
180+ ),
181+ (
182+ ["-gen-op-interface-defs" ],
183+ "tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.cpp.inc" ,
184+ ),
185+ (
186+ ["-gen-attr-interface-decls" ],
187+ "tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindAttrInterface.h.inc" ,
188+ ),
189+ (
190+ ["-gen-attr-interface-defs" ],
191+ "tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindAttrInterface.cpp.inc" ,
192+ ),
202193 ],
203- strip_include_prefix = "tensorrt/include" ,
194+ tblgen = "@llvm-project//mlir:mlir-tblgen" ,
195+ td_file = "tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.td" ,
204196 deps = [
205- ":TensorRTDialect " ,
197+ ":TensorKindInterfaceTdFiles " ,
206198 ],
207199)
208200
@@ -234,107 +226,75 @@ cc_library(
234226 ],
235227)
236228
237- td_library (
238- name = "TensorKindInterfaceTdFiles" ,
239- srcs = [
240- "tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.td" ,
241- ],
242- includes = ["tensorrt/include" ],
243- deps = [
244- "@llvm-project//mlir:OpBaseTdFiles" ,
245- ],
246- )
247-
248- gentbl_cc_library (
249- name = "TensorRTTensorKindInterfacesIncGen" ,
250- strip_include_prefix = "tensorrt/include" ,
251- tbl_outs = [
252- (
253- ["-gen-op-interface-decls" ],
254- "tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.h.inc" ,
255- ),
256- (
257- ["-gen-op-interface-defs" ],
258- "tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.cpp.inc" ,
259- ),
260- (
261- ["-gen-attr-interface-decls" ],
262- "tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindAttrInterface.h.inc" ,
263- ),
264- (
265- ["-gen-attr-interface-defs" ],
266- "tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindAttrInterface.cpp.inc" ,
267- ),
268- ],
269- tblgen = "@llvm-project//mlir:mlir-tblgen" ,
270- td_file = "tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.td" ,
271- deps = [
272- ":TensorKindInterfaceTdFiles" ,
273- ],
274- )
275-
276229cc_library (
277- name = "TensorRTTensorKindInterfaces " ,
230+ name = "TensorRTDialect " ,
278231 srcs = [
279- "tensorrt/lib/Interface/TensorKindOpInterface.cpp" ,
232+ "tensorrt/lib/TensorRT/IR/EinsumHelper.cpp" ,
233+ "tensorrt/lib/TensorRT/IR/EinsumHelper.h" ,
234+ "tensorrt/lib/TensorRT/IR/TensorKindOpInterfaceImpl.cpp" ,
235+ "tensorrt/lib/TensorRT/IR/TensorRT.cpp" ,
236+ "tensorrt/lib/TensorRT/IR/TypeInferenceInterfaceImpls.cpp" ,
237+ "tensorrt/lib/TensorRT/IR/Verification.cpp" ,
280238 ],
281239 hdrs = [
282240 "tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.h" ,
241+ "tensorrt/include/mlir-tensorrt-dialect/TensorRT/IR/TensorRTDialect.h" ,
283242 ],
284243 strip_include_prefix = "tensorrt/include" ,
285244 deps = [
245+ ":TensorRTAttrInterfacesIncGen" ,
246+ ":TensorRTAttributesIncGen" ,
247+ ":TensorRTEnumsIncGen" ,
248+ ":TensorRTInterfacesIncGen" ,
249+ ":TensorRTOpsIncGen" ,
286250 ":TensorRTTensorKindInterfacesIncGen" ,
287- "@llvm-project//mlir:Analysis" ,
251+ ":TensorRTCommonUtils" ,
252+ "@llvm-project//mlir:FuncDialect" ,
253+ "@llvm-project//mlir:QuantOps" ,
288254 ],
289255)
290256
291257cc_library (
292- name = "TensorRTAnalysis " ,
258+ name = "TensorRTUtils " ,
293259 srcs = [
294- "tensorrt/lib/Analysis/TensorKindAnalysis .cpp" ,
260+ "tensorrt/lib/TensorRT/Utils/Utils .cpp" ,
295261 ],
296262 hdrs = [
297- "tensorrt/include/mlir-tensorrt-dialect/Analysis/TensorKindAnalysis .h" ,
263+ "tensorrt/include/mlir-tensorrt-dialect/TensorRT/Utils/Utils .h" ,
298264 ],
299265 strip_include_prefix = "tensorrt/include" ,
300266 deps = [
301267 ":TensorRTDialect" ,
302- ":TensorRTTensorKindInterfaces" ,
303- "@llvm-project//mlir:BufferizationDialect" ,
304268 ],
305269)
306270
307271cc_library (
308- name = "TensorRTCompilerUtils " ,
272+ name = "TensorRTTensorKindInterfaces " ,
309273 srcs = [
310- "compiler /lib/Utils/RegionUtils .cpp" ,
274+ "tensorrt /lib/Interface/TensorKindOpInterface .cpp" ,
311275 ],
312276 hdrs = [
313- "compiler /include/mlir-tensorrt/Utils/RegionUtils .h" ,
277+ "tensorrt /include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface .h" ,
314278 ],
315- strip_include_prefix = "compiler /include" ,
279+ strip_include_prefix = "tensorrt /include" ,
316280 deps = [
317- "@llvm-project//mlir:IR " ,
318- "@llvm-project//mlir:TransformUtils " ,
281+ ":TensorRTTensorKindInterfacesIncGen " ,
282+ "@llvm-project//mlir:Analysis " ,
319283 ],
320284)
321285
322286cc_library (
323- name = "TensorRTGenericClustering " ,
287+ name = "TensorRTAnalysis " ,
324288 srcs = [
325- "compiler/lib/Transforms/Clustering/Clustering.cpp" ,
326- "compiler/lib/Transforms/Clustering/Patterns.cpp" ,
289+ "tensorrt/lib/Analysis/TensorKindAnalysis.cpp" ,
327290 ],
328291 hdrs = [
329- "compiler/include/mlir-tensorrt/Transforms/Clustering/Clustering.h" ,
330- "compiler/include/mlir-tensorrt/Transforms/Clustering/Patterns.h" ,
292+ "tensorrt/include/mlir-tensorrt-dialect/Analysis/TensorKindAnalysis.h" ,
331293 ],
332- strip_include_prefix = "compiler /include" ,
294+ strip_include_prefix = "tensorrt /include" ,
333295 deps = [
334- ":TensorRTCompilerUtils" ,
335- "@llvm-project//mlir:FuncDialect" ,
336- "@llvm-project//mlir:SCFDialect" ,
337- "@llvm-project//mlir:Transforms" ,
296+ ":TensorRTTensorKindInterfaces" ,
297+ "@llvm-project//mlir:BufferizationDialect" ,
338298 ],
339299)
340300
@@ -408,20 +368,12 @@ cc_library(
408368 hdrs = [
409369 "tensorrt/include/mlir-tensorrt-dialect/TensorRT/Transforms/Passes.h" ,
410370 ],
411- copts = [
412- "-DMLIR_TRT_TARGET_TENSORRT" ,
413- ],
414371 strip_include_prefix = "tensorrt/include" ,
415372 deps = [
416- ":TensorRTAnalysis" ,
417373 ":TensorRTDialect" ,
418- ":TensorRTGenericClustering" ,
419374 ":TensorRTTransformsActivationsPdllGen" ,
420375 ":TensorRTTransformsNormalizationsPdllGen" ,
421376 ":TensorRTTransformsPassesIncGen" ,
422- ":TensorRTUtils" ,
423- "@rules_cuda//cuda:runtime" ,
424- "@tensorrt10_x86//:tensorrt10" ,
425377 ],
426378)
427379
@@ -460,12 +412,8 @@ cc_library(
460412 deps = [
461413 ":TensorRTAnalysis" ,
462414 ":TensorRTGenericTransformPassesIncGen" ,
463- "@llvm-project//mlir:ArithDialect" ,
464- "@llvm-project//mlir:FuncDialect" ,
465- "@llvm-project//mlir:FuncTransforms" ,
466415 "@llvm-project//mlir:Pass" ,
467- "@llvm-project//mlir:SCFTransforms" ,
468- "@llvm-project//mlir:TransformDialectTransforms" ,
416+ "@llvm-project//mlir:SCFDialect" ,
469417 ],
470418)
471419
@@ -519,14 +467,11 @@ cc_library(
519467 ],
520468 strip_include_prefix = "tensorrt/include" ,
521469 deps = [
522- ":TensorRTAnalysis" ,
523- ":TensorRTCommonUtils" ,
524470 ":TensorRTDialect" ,
525471 ":TensorRTEncodingOpInterfaceIncGen" ,
526472 ":TensorRTEnumConverterGen" ,
473+ ":TensorRTTensorKindInterfaces" ,
527474 ":TensorRTUtils" ,
528- "@rules_cuda//cuda:runtime" ,
529- "@tensorrt10_x86//:tensorrt10" ,
530475 ],
531476)
532477
@@ -557,7 +502,6 @@ cc_library(
557502 ],
558503 strip_include_prefix = "tensorrt/include" ,
559504 deps = [
560- ":TensorRTDialect" ,
561505 ":TensorRTEncodingIncGen" ,
562506 ":TensorRTEncodingOpInterface" ,
563507 ],
@@ -607,14 +551,10 @@ cc_library(
607551 copts = ["-DMLIR_TRT_TARGET_TENSORRT" ],
608552 strip_include_prefix = "tensorrt/include" ,
609553 deps = [
610- ":TensorRTCommonUtils" ,
611- ":TensorRTDialect" ,
612- ":TensorRTDynamicLoader" ,
613554 ":TensorRTEncodingImpl" ,
614555 ":TensorRTEncodingOpInterface" ,
615556 ":TensorRTTranslationPassIncGen" ,
616557 "@llvm-project//llvm:BitWriter" ,
617- "@llvm-project//mlir:FuncExtensions" ,
618558 "@llvm-project//mlir:TranslateLib" ,
619559 ],
620560)
@@ -644,13 +584,10 @@ cc_library(
644584 "compiler/lib/Conversion/TensorRTCommon/ConvertToTensorRTCommon.cpp" ,
645585 ],
646586 hdrs = [
647- "compiler/include/mlir-tensorrt/Conversion/Passes.h" ,
587+ "compiler/include/mlir-tensorrt/Conversion/Passes.h" ,
648588 "compiler/include/mlir-tensorrt/Conversion/Patterns.h" ,
649589 "compiler/include/mlir-tensorrt/Conversion/TensorRTCommon/ConvertToTensorRTCommon.h" ,
650590 ],
651- copts = [
652- "-DMLIR_TRT_TARGET_TENSORRT" ,
653- ],
654591 strip_include_prefix = "compiler/include" ,
655592 deps = [
656593 ":TensorRTConversionPassIncGen" ,
@@ -670,16 +607,16 @@ cc_library(
670607 "compiler/include/mlir-tensorrt/Registration/RegisterMlirTensorRtPasses.h" ,
671608 "compiler/include/mlir-tensorrt/Registration/RegisterMlirTensorRtTranslations.h" ,
672609 ],
673- copts = [
674- "-DMLIR_TRT_TARGET_TENSORRT" ,
675- ],
610+ copts = ["-DMLIR_TRT_TARGET_TENSORRT" ],
676611 strip_include_prefix = "compiler/include" ,
677612 deps = [
678613 ":TensorRTConversion" ,
679614 ":TensorRTGeneralTransforms" ,
680615 ":TensorRTTarget" ,
681616 ":TensorRTTransforms" ,
682- "@llvm-project//mlir:ShapeDialect" ,
617+ "@llvm-project//mlir:FuncExtensions" ,
618+ "@llvm-project//mlir:TransformDialectTransforms" ,
619+
683620 ],
684621)
685622
@@ -694,9 +631,7 @@ cc_binary(
694631cc_binary (
695632 name = "tensorrt-opt" ,
696633 srcs = ["tensorrt/tensorrt-opt/tensorrt-opt.cpp" ],
697- copts = [
698- "-DMLIR_TRT_TARGET_TENSORRT" ,
699- ],
634+ copts = ["-DMLIR_TRT_TARGET_TENSORRT" ],
700635 linkopts = ["-Wl,-rpath,/opt/src/mlir-tensorrt/bazel-mlir-tensorrt/external/tensorrt10_x86/targets/x86_64-linux-gnu/lib" ],
701636 deps = [
702637 ":TensorRTRegistration" ,
@@ -707,9 +642,7 @@ cc_binary(
707642cc_binary (
708643 name = "mlir-tensorrt-opt" ,
709644 srcs = ["tools/MlirTensorRtOpt.cpp" ],
710- copts = [
711- "-DMLIR_TRT_TARGET_TENSORRT" ,
712- ],
645+ copts = ["-DMLIR_TRT_TARGET_TENSORRT" ],
713646 linkopts = ["-Wl,-rpath,/opt/src/mlir-tensorrt/bazel-mlir-tensorrt/external/tensorrt10_x86/targets/x86_64-linux-gnu/lib" ],
714647 deps = [
715648 ":TensorRTRegistration" ,
0 commit comments