Skip to content

Commit

Permalink
change _aieMlir -> _aie
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Nov 15, 2023
1 parent 33858fc commit 2ada4f8
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 67 deletions.
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,6 @@ add_subdirectory(include)
add_subdirectory(lib)
add_subdirectory(runtime_lib)
add_subdirectory(aie_runtime_lib)
add_subdirectory(reference_designs)
add_subdirectory(test)
add_subdirectory(tutorials)
add_subdirectory(tools)
add_subdirectory(data)
add_subdirectory(python)
Expand Down Expand Up @@ -211,3 +208,9 @@ if(NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
endif()

add_subdirectory(cmake/modules)

# Last because each of these has its own CMakeLists.txt which reloads/re-finds LLVM, thus resettings globals.
add_subdirectory(reference_designs)
add_subdirectory(test)
add_subdirectory(tutorials)

4 changes: 2 additions & 2 deletions python/AIEMLIRModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
namespace py = pybind11;
using namespace mlir::python::adaptors;

PYBIND11_MODULE(_aieMlir, m) {
PYBIND11_MODULE(_aie, m) {

::aieRegisterAllPasses();

m.doc() = R"pbdoc(
AIE MLIR Python bindings
--------------------------
.. currentmodule:: _aieMlir
.. currentmodule:: _aie
.. autosummary::
:toctree: _generate
Expand Down
74 changes: 19 additions & 55 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ declare_mlir_python_sources(AIEPythonSources
ROOT_DIR "${AIE_PYTHON_ROOT_DIR}"
)

declare_mlir_python_sources(AIEPythonExtensions)

declare_mlir_python_sources(AIEPythonSources.Dialects
ADD_TO_PARENT AIEPythonSources
)
Expand Down Expand Up @@ -49,43 +47,11 @@ declare_mlir_dialect_python_bindings(
# Extensions
################################################################################

set(LIBS
LLVMSupport

${MLIR_DIALECT_LIBS}
${MLIR_CONVERSION_LIBS}
${MLIR_EXTENSION_LIBS}
${MLIR_TRANSLATION_LIBS}

ADF
AIE
AIETransforms
AIEX
AIEXTransforms
AIEXUtils
MLIRAIEVec
MLIRAIEVecToLLVM
MLIRAIEVecTransformOps
MLIRAIEVecTransforms

AIECAPI

MLIRCAPIAsync
MLIRCAPIConversion
MLIRCAPIDebug
MLIRCAPIExecutionEngine
MLIRCAPIFunc
MLIRCAPIGPU
MLIRCAPIIR
MLIRCAPIInterfaces
MLIRCAPILinalg
MLIRCAPIPDL
MLIRCAPIQuant
MLIRCAPIRegisterEverything
MLIRCAPISparseTensor
MLIRCAPITransformDialect
MLIRCAPITransforms
)
get_property(MLIR_CONVERSION_LIBS GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
get_property(MLIR_DIALECT_LIBS GLOBAL PROPERTY MLIR_DIALECT_LIBS)
get_property(MLIR_EXTENSION_LIBS GLOBAL PROPERTY MLIR_EXTENSION_LIBS)
get_property(MLIR_TRANSLATION_LIBS GLOBAL PROPERTY MLIR_TRANSLATION_LIBS)
get_property(MLIR_UPSTREAM_CAPI_LIBS GLOBAL PROPERTY MLIR_UPSTREAM_CAPI_LIBS)

get_target_property(CoreSources MLIRPythonExtension.Core INTERFACE_SOURCES)

Expand All @@ -101,14 +67,8 @@ get_target_property(GPUDialectPassesSources MLIRPythonExtension.GPUDialectPasses
get_target_property(SparseTensorDialectPassesSources MLIRPythonExtension.SparseTensorDialectPasses INTERFACE_SOURCES)
get_target_property(RegisterEverythingSources MLIRPythonExtension.RegisterEverything INTERFACE_SOURCES)

get_property(MLIR_DIALECT_LIBS GLOBAL PROPERTY MLIR_DIALECT_LIBS)
get_property(MLIR_CONVERSION_LIBS GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
get_property(MLIR_EXTENSION_LIBS GLOBAL PROPERTY MLIR_EXTENSION_LIBS)
get_property(MLIR_TRANSLATION_LIBS GLOBAL PROPERTY MLIR_TRANSLATION_LIBS)

declare_mlir_python_extension(AIEPythonExtensionsOmni.MLIR
MODULE_NAME _aieMlirOmni
ADD_TO_PARENT AIEPythonExtensions
declare_mlir_python_extension(AIEPythonExtensions
MODULE_NAME _aie
ROOT_DIR "/"

SOURCES
Expand All @@ -130,7 +90,13 @@ declare_mlir_python_extension(AIEPythonExtensionsOmni.MLIR
${RegisterEverythingSources}

PRIVATE_LINK_LIBS
${LIBS}
LLVMSupport
AIECAPI
${MLIR_CONVERSION_LIBS}
${MLIR_DIALECT_LIBS}
${MLIR_EXTENSION_LIBS}
${MLIR_TRANSLATION_LIBS}
${MLIR_UPSTREAM_CAPI_LIBS}
)

_flatten_mlir_python_targets(mlir_python_sources_deps MLIRPythonSources)
Expand Down Expand Up @@ -158,8 +124,7 @@ add_mlir_python_modules(AIEPythonModules
add_subdirectory(compiler)
add_dependencies(AIEPythonModules AIECompilerPythonModules)

set(_extensions
_aieMlir
set(_other_extensions
_mlir
_mlirAsyncPasses
_mlirDialectsLinalg
Expand All @@ -177,21 +142,20 @@ set(_extensions

file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/python/aie/_mlir_libs")

foreach(ext ${_extensions})
foreach(ext ${_other_extensions})
add_custom_target("symlink_${ext}"
COMMAND ${CMAKE_COMMAND} -E create_symlink
"_aieMlirOmni${PYTHON_MODULE_EXTENSION}"
"_aie${PYTHON_MODULE_EXTENSION}"
"${ext}${PYTHON_MODULE_EXTENSION}"
DEPENDS AIEPythonExtensionsOmni.MLIR
DEPENDS AIEPythonExtensions
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/python/aie/_mlir_libs"
)
add_dependencies(AIEPythonModules "symlink_${ext}")
install(CODE "execute_process(
COMMAND ${CMAKE_COMMAND} -E create_symlink
_aieMlirOmni${PYTHON_MODULE_EXTENSION}
_aie${PYTHON_MODULE_EXTENSION}
${ext}${PYTHON_MODULE_EXTENSION}
WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/python/aie/_mlir_libs
)"
)

endforeach()
7 changes: 1 addition & 6 deletions python/dialects/aie.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@
from ._AIE_enum_gen import *
from ._AIE_ops_gen import *
from ._AIE_ops_gen import *
from .._mlir_libs._aieMlir import *
from .._mlir_libs._aieMlir import (
register_dialect,
ObjectFifoType,
ObjectFifoSubviewType,
)
from .._mlir_libs._aie import *
from ..dialects import arith
from ..dialects import memref
from ..dialects.func import *
Expand Down
2 changes: 1 addition & 1 deletion python/dialects/aiex.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

from ._AIEX_ops_gen import *
from .._mlir_libs._aieMlir import *
from .._mlir_libs._aie import *
from ..ir import *
from ..dialects import arith

Expand Down

0 comments on commit 2ada4f8

Please sign in to comment.