File tree Expand file tree Collapse file tree 5 files changed +81
-0
lines changed
utils/bazel/llvm-project-overlay/mlir/python Expand file tree Collapse file tree 5 files changed +81
-0
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,15 @@ declare_mlir_dialect_extension_python_bindings(
200
200
DIALECT_NAME transform
201
201
EXTENSION_NAME memref_transform )
202
202
203
+ declare_mlir_dialect_extension_python_bindings (
204
+ ADD_TO_PARENT MLIRPythonSources.Dialects
205
+ ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR} /mlir"
206
+ TD_FILE dialects/NVGPUTransformOps.td
207
+ SOURCES
208
+ dialects/transform/nvgpu.py
209
+ DIALECT_NAME transform
210
+ EXTENSION_NAME nvgpu_transform )
211
+
203
212
declare_mlir_dialect_extension_python_bindings (
204
213
ADD_TO_PARENT MLIRPythonSources.Dialects
205
214
ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR} /mlir"
Original file line number Diff line number Diff line change
1
+ //===-- NVGPUTransformOps.td -------------------------------*- tablegen -*-===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+ //
9
+ // Entry point of the Python bindings generator for the transform ops provided
10
+ // by the NVGPU dialect.
11
+ //
12
+ //===----------------------------------------------------------------------===//
13
+
14
+
15
+ #ifndef PYTHON_BINDINGS_NVGPU_TRANSFORM_OPS
16
+ #define PYTHON_BINDINGS_NVGPU_TRANSFORM_OPS
17
+
18
+ include "mlir/Dialect/NVGPU/TransformOps/NVGPUTransformOps.td"
19
+
20
+ #endif // PYTHON_BINDINGS_NVGPU_TRANSFORM_OPS
Original file line number Diff line number Diff line change
1
+ # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2
+ # See https://llvm.org/LICENSE.txt for license information.
3
+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
+
5
+ from .._nvgpu_transform_ops_gen import *
Original file line number Diff line number Diff line change
1
+ # RUN: %PYTHON %s | FileCheck %s
2
+
3
+ from mlir .ir import *
4
+ from mlir .dialects import transform
5
+ from mlir .dialects .transform import nvgpu
6
+
7
+
8
+ def run (f ):
9
+ with Context (), Location .unknown ():
10
+ module = Module .create ()
11
+ with InsertionPoint (module .body ):
12
+ print ("\n TEST:" , f .__name__ )
13
+ f ()
14
+ print (module )
15
+ return f
16
+
17
+
18
+ @run
19
+ def testCreateAsyncGroups ():
20
+ sequence = transform .SequenceOp (
21
+ transform .FailurePropagationMode .Propagate , [], transform .AnyOpType .get ()
22
+ )
23
+ with InsertionPoint (sequence .body ):
24
+ nvgpu .CreateAsyncGroupsOp (transform .AnyOpType .get (), sequence .bodyTarget )
25
+ transform .YieldOp ()
26
+ # CHECK-LABEL: TEST: testCreateAsyncGroups
27
+ # CHECK: transform.nvgpu.create_async_groups
Original file line number Diff line number Diff line change @@ -1209,6 +1209,25 @@ gentbl_filegroup(
1209
1209
],
1210
1210
)
1211
1211
1212
+ gentbl_filegroup (
1213
+ name = "NVGPUTransformOpsPyGen" ,
1214
+ tbl_outs = [
1215
+ (
1216
+ [
1217
+ "-gen-python-op-bindings" ,
1218
+ "-bind-dialect=transform" ,
1219
+ "-dialect-extension=nvgpu_transform" ,
1220
+ ],
1221
+ "mlir/dialects/_nvgpu_transform_ops_gen.py" ,
1222
+ ),
1223
+ ],
1224
+ tblgen = "//mlir:mlir-tblgen" ,
1225
+ td_file = "mlir/dialects/NVGPUTransformOps.td" ,
1226
+ deps = [
1227
+ "//mlir:NVGPUTransformOpsTdFiles" ,
1228
+ ],
1229
+ )
1230
+
1212
1231
gentbl_filegroup (
1213
1232
name = "PDLTransformOpsPyGen" ,
1214
1233
tbl_outs = [
@@ -1327,6 +1346,7 @@ filegroup(
1327
1346
":GPUTransformOpsPyGen" ,
1328
1347
":LoopTransformOpsPyGen" ,
1329
1348
":MemRefTransformOpsPyGen" ,
1349
+ ":NVGPUTransformOpsPyGen" ,
1330
1350
":PDLTransformOpsPyGen" ,
1331
1351
":SparseTensorTransformOpsPyGen" ,
1332
1352
":StructureTransformEnumPyGen" ,
You can’t perform that action at this time.
0 commit comments