forked from OSchip/llvm-project
Add CMakeLists.txt for Quantization and FxpMathOps dialects (and misc fixes to build with OSS setup).
Tested: cmake -G Ninja ../llvm/ -DLLVM_BUILD_EXAMPLES=ON ninja check-mlir -- PiperOrigin-RevId: 241841296
This commit is contained in:
parent
3a2955fa1f
commit
7ce55ff7c2
|
@ -1,3 +1,5 @@
|
|||
add_subdirectory(FxpMathOps)
|
||||
add_subdirectory(LLVMIR)
|
||||
add_subdirectory(Quantization)
|
||||
add_subdirectory(StandardOps)
|
||||
add_subdirectory(EDSC)
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
set(LLVM_TARGET_DEFINITIONS FxpMathOps.td)
|
||||
mlir_tablegen(FxpMathOps.h.inc -gen-op-decls)
|
||||
mlir_tablegen(FxpMathOps.cpp.inc -gen-op-defs)
|
||||
add_public_tablegen_target(MLIRFxpMathOpsIncGen)
|
|
@ -0,0 +1,4 @@
|
|||
set(LLVM_TARGET_DEFINITIONS QuantOps.td)
|
||||
mlir_tablegen(QuantOps.h.inc -gen-op-decls)
|
||||
mlir_tablegen(QuantOps.cpp.inc -gen-op-defs)
|
||||
add_public_tablegen_target(MLIRQuantizationOpsIncGen)
|
|
@ -3,10 +3,12 @@ add_subdirectory(Analysis)
|
|||
add_subdirectory(Dialect)
|
||||
add_subdirectory(EDSC)
|
||||
add_subdirectory(ExecutionEngine)
|
||||
add_subdirectory(FxpMathOps)
|
||||
add_subdirectory(IR)
|
||||
add_subdirectory(LLVMIR)
|
||||
add_subdirectory(Parser)
|
||||
add_subdirectory(Pass)
|
||||
add_subdirectory(Quantization)
|
||||
add_subdirectory(StandardOps)
|
||||
add_subdirectory(Support)
|
||||
add_subdirectory(TableGen)
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
add_llvm_library(MLIRFxpMathOps
|
||||
IR/FxpMathOps.cpp
|
||||
IR/DialectRegistration.cpp
|
||||
Transforms/LowerUniformRealMath.cpp
|
||||
|
||||
ADDITIONAL_HEADER_DIRS
|
||||
${MLIR_MAIN_INCLUDE_DIR}/mlir/FxpMathOps
|
||||
)
|
||||
add_dependencies(MLIRFxpMathOps
|
||||
MLIRFxpMathOpsIncGen
|
||||
MLIRQuantization
|
||||
MLIRIR
|
||||
MLIRPass
|
||||
MLIRSupport
|
||||
MLIRStandardOps)
|
|
@ -0,0 +1,20 @@
|
|||
add_llvm_library(MLIRQuantization
|
||||
IR/DialectRegistration.cpp
|
||||
IR/FakeQuantSupport.cpp
|
||||
IR/QuantOps.cpp
|
||||
IR/TypeDetail.h
|
||||
IR/TypeParser.cpp
|
||||
IR/UniformSupport.cpp
|
||||
Transforms/ConvertConst.cpp
|
||||
Transforms/ConvertSimQuant.cpp
|
||||
Utils/QuantizeUtils.cpp
|
||||
|
||||
ADDITIONAL_HEADER_DIRS
|
||||
${MLIR_MAIN_INCLUDE_DIR}/mlir/Quantization
|
||||
)
|
||||
add_dependencies(MLIRQuantization
|
||||
MLIRQuantizationOpsIncGen
|
||||
MLIRIR
|
||||
MLIRPass
|
||||
MLIRSupport
|
||||
MLIRStandardOps)
|
|
@ -261,7 +261,7 @@ LogicalResult UniformQuantizedType::verifyConstructionInvariants(
|
|||
}
|
||||
|
||||
// Verify scale.
|
||||
if (scale <= 0.0 || isinf(scale) || isnan(scale)) {
|
||||
if (scale <= 0.0 || std::isinf(scale) || std::isnan(scale)) {
|
||||
if (loc) {
|
||||
context->emitError(*loc,
|
||||
"illegal scale: " + Twine(std::to_string(scale)));
|
||||
|
@ -323,7 +323,7 @@ LogicalResult UniformQuantizedPerAxisType::verifyConstructionInvariants(
|
|||
|
||||
// Verify scale.
|
||||
for (double scale : scales) {
|
||||
if (scale <= 0.0 || isinf(scale) || isnan(scale)) {
|
||||
if (scale <= 0.0 || std::isinf(scale) || std::isnan(scale)) {
|
||||
if (loc) {
|
||||
context->emitError(*loc,
|
||||
"illegal scale: " + Twine(std::to_string(scale)));
|
||||
|
|
|
@ -2,9 +2,11 @@ set(LIBS
|
|||
MLIRAffineOps
|
||||
MLIRAnalysis
|
||||
MLIREDSC
|
||||
MLIRFxpMathOps
|
||||
MLIRLLVMIR
|
||||
MLIRParser
|
||||
MLIRPass
|
||||
MLIRQuantization
|
||||
MLIRStandardOps
|
||||
MLIRTransforms
|
||||
MLIRSupport
|
||||
|
|
Loading…
Reference in New Issue