Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create ttmlir-lsp-server (#1383) #1462

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Conversion/TTKernelToEmitC/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_mlir_library(TTMLIRTTKernelToEmitC
add_mlir_conversion_library(TTMLIRTTKernelToEmitC
TTKernelToEmitC.cpp

ADDITIONAL_HEADER_DIRS
Expand Down
1 change: 1 addition & 0 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
add_subdirectory(ttmlir-opt)
add_subdirectory(ttmlir-lsp-server)
add_subdirectory(ttmlir-translate)
add_subdirectory(explorer)
18 changes: 18 additions & 0 deletions tools/ttmlir-lsp-server/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
get_property(extension_libs GLOBAL PROPERTY MLIR_EXTENSION_LIBS)

set(LIBS ${dialect_libs} ${conversion_libs} ${extension_libs}
MLIROptLib
MLIRTargetCpp
TTMLIRStatic
MLIRLspServerLib
)

add_llvm_executable(ttmlir-lsp-server ttmlir-lsp-server.cpp DISABLE_LLVM_LINK_LLVM_DYLIB)
llvm_update_compile_flags(ttmlir-lsp-server)
target_link_libraries(ttmlir-lsp-server PRIVATE ${LIBS})

mlir_check_all_link_libraries(ttmlir-lsp-server)

install(TARGETS ttmlir-lsp-server DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Test EXCLUDE_FROM_ALL)
15 changes: 15 additions & 0 deletions tools/ttmlir-lsp-server/ttmlir-lsp-server.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-FileCopyrightText: (c) 2024 Tenstorrent AI ULC
//
// SPDX-License-Identifier: Apache-2.0

#include "mlir/InitAllDialects.h"
#include "ttmlir/RegisterAll.h"

#include "mlir/Tools/mlir-lsp-server/MlirLspServerMain.h"

int main(int argc, char **argv) {
mlir::DialectRegistry registry;
mlir::tt::registerAllDialects(registry);

return mlir::failed(mlir::MlirLspServerMain(argc, argv, registry));
}
Loading