--- /dev/null
+//===- SDBMDialect.h - Dialect for striped DBMs -----------------*- C++ -*-===//
+//
+// Copyright 2019 The MLIR Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// =============================================================================
+
+#ifndef MLIR_SDBM_SDBMDIALECT_H
+#define MLIR_SDBM_SDBMDIALECT_H
+
+#include "mlir/IR/Dialect.h"
+
+namespace mlir {
+class MLIRContext;
+
+class SDBMDialect : public Dialect {
+public:
+ SDBMDialect(MLIRContext *context) : Dialect(getDialectNamespace(), context) {}
+
+ static StringRef getDialectNamespace() { return "sdbm"; }
+};
+} // namespace mlir
+
+#endif // MLIR_SDBM_SDBMDIALECT_H
add_subdirectory(Parser)
add_subdirectory(Pass)
add_subdirectory(Quantizer)
+add_subdirectory(SDBM)
add_subdirectory(StandardOps)
add_subdirectory(Support)
add_subdirectory(TableGen)
--- /dev/null
+add_llvm_library(MLIRSDBM
+ SDBM.cpp
+ SDBMExpr.cpp
+ SDBMDialect.cpp
+
+ ADDITIONAL_HEADER_DIRS
+ ${MLIR_MAIN_INCLUDE_DIR}/mlir/SDBM
+)
+add_dependencies(MLIRSDBM MLIRIR)
+target_link_libraries(MLIRSDBM MLIRIR)
//
//===----------------------------------------------------------------------===//
-#include "mlir/IR/SDBM.h"
-#include "mlir/IR/SDBMExpr.h"
+#include "mlir/SDBM/SDBM.h"
+#include "mlir/SDBM/SDBMExpr.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SetVector.h"
--- /dev/null
+//===- SDBMDialect.cpp - Dialect for striped difference-bound matrices ----===//
+//
+// Copyright 2019 The MLIR Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// =============================================================================
+
+#include "mlir/SDBM/SDBMDialect.h"
+
+static mlir::DialectRegistration<mlir::SDBMDialect> SDBMDialect;
//
//===----------------------------------------------------------------------===//
-#include "mlir/IR/SDBMExpr.h"
+#include "mlir/SDBM/SDBMExpr.h"
#include "SDBMExprDetail.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/AffineExprVisitor.h"
#define MLIR_IR_SDBMEXPRDETAIL_H
#include "mlir/IR/MLIRContext.h"
-#include "mlir/IR/SDBMExpr.h"
+#include "mlir/SDBM/SDBMExpr.h"
#include "mlir/Support/StorageUniquer.h"
namespace mlir {
-add_subdirectory(mlir-cpu-runner)
add_subdirectory(EDSC)
+add_subdirectory(mlir-cpu-runner)
+add_subdirectory(SDBM)
llvm_canonicalize_cmake_booleans(
LLVM_BUILD_EXAMPLES
MLIRUnitTests
mlir-cpu-runner
mlir-opt
+ mlir-sdbm-api-test
mlir-tblgen
mlir-translate
sdot
--- /dev/null
+add_executable(mlir-sdbm-api-test
+ sdbm-api-test.cpp
+)
+
+llvm_update_compile_flags(mlir-sdbm-api-test)
+
+target_link_libraries(mlir-sdbm-api-test
+ MLIRIR
+ MLIRSDBM
+ LLVMCore
+ LLVMSupport
+)
+
+target_include_directories(mlir-sdbm-api-test PRIVATE ..)
+
+whole_archive_link(mlir-sdbm-api-test
+ MLIRSDBM
+)
--- /dev/null
+config.suffixes.add('.cpp')
// limitations under the License.
// =============================================================================
-// RUN: %p/sdbm-api-test | FileCheck %s
+// RUN: mlir-sdbm-api-test | FileCheck %s
#include "mlir/IR/MLIRContext.h"
-#include "mlir/IR/SDBM.h"
-#include "mlir/IR/SDBMExpr.h"
+#include "mlir/SDBM/SDBM.h"
+#include "mlir/SDBM/SDBMExpr.h"
#include "llvm/Support/raw_ostream.h"
add_subdirectory(Dialect)
add_subdirectory(IR)
add_subdirectory(Pass)
+add_subdirectory(SDBM)
add_subdirectory(TableGen)
DialectTest.cpp
OperationSupportTest.cpp
OpDefinitionTest.cpp
- SDBMTest.cpp
)
target_link_libraries(MLIRIRTests
PRIVATE
--- /dev/null
+add_mlir_unittest(MLIRSDBMTests
+ SDBMTest.cpp
+)
+target_link_libraries(MLIRSDBMTests
+ PRIVATE
+ MLIRSDBM
+)
// limitations under the License.
// =============================================================================
-#include "mlir/IR/SDBM.h"
+#include "mlir/SDBM/SDBM.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/MLIRContext.h"
-#include "mlir/IR/SDBMExpr.h"
+#include "mlir/SDBM/SDBMExpr.h"
#include "gtest/gtest.h"
#include "llvm/ADT/DenseSet.h"
TEST(SDBMExpr, Dim) {
// We can create dimension expressions and query them.
auto expr = SDBMDimExpr::get(ctx(), 0);
- EXPECT_EQ(expr.getPosition(), 0);
+ EXPECT_EQ(expr.getPosition(), 0u);
// Two separately created dimensions with the same position are trivially
// equal.
TEST(SDBMExpr, Symbol) {
// We can create symbol expressions and query them.
auto expr = SDBMSymbolExpr::get(ctx(), 0);
- EXPECT_EQ(expr.getPosition(), 0);
+ EXPECT_EQ(expr.getPosition(), 0u);
// Two separately created symbols with the same position are trivially equal.
auto expr2 = SDBMSymbolExpr::get(ctx(), 0);