Comments (12)
Hi, can you paste the code that triggered the error?
from polygeist.
here you go:
Thank you,
Vinod.
from polygeist.
I was trying to compile the program first without OpenMP. When I try to compile it with, here is the error:
vinodt@m2000host0:/localdata/vinod/Polygeist/Heat3DOpenMP$ mlir-clang -fopenmp -I../build/projects/openmp/runtime/src -I../llvm-project/clang/lib/Headers main.c
mlir-clang: ../llvm-project/llvm/include/llvm/Support/Casting.h:269: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = clang::CastExpr; Y = clang::Expr; typename llvm::cast_retty<X, Y*>::ret_type = clang::CastExpr*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: mlir-clang -fopenmp -I ../build/projects/openmp/runtime/src -I ../llvm-project/clang/lib/Headers main.c
- parser at end of file
#0 0x000055e199e8600a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /localdata/vinod/Polygeist/llvm-project/llvm/lib/Support/Unix/Signals.inc:565:0
#1 0x000055e199e860c1 PrintStackTraceSignalHandler(void*) /localdata/vinod/Polygeist/llvm-project/llvm/lib/Support/Unix/Signals.inc:632:0
#2 0x000055e199e83d75 llvm::sys::RunSignalHandlers() /localdata/vinod/Polygeist/llvm-project/llvm/lib/Support/Signals.cpp:97:0
#3 0x000055e199e8598b SignalHandler(int) /localdata/vinod/Polygeist/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:0
#4 0x00007fd96e3d0980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
#5 0x00007fd96d081fb7 raise /build/glibc-S9d2JN/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#6 0x00007fd96d083921 abort /build/glibc-S9d2JN/glibc-2.27/stdlib/abort.c:81:0
#7 0x00007fd96d07348a __assert_fail_base /build/glibc-S9d2JN/glibc-2.27/assert/assert.c:89:0
#8 0x00007fd96d073502 (/lib/x86_64-linux-gnu/libc.so.6+0x30502)
#9 0x000055e1983407f3 llvm::cast_retty<clang::CastExpr, clang::Expr*>::ret_type llvm::cast<clang::CastExpr, clang::Expr>(clang::Expr*) /localdata/vinod/Polygeist/build/../llvm-project/llvm/include/llvm/Support/Casting.h:269:0
#10 0x000055e198389716 MLIRScanner::VisitOMPParallelForDirective(clang::OMPParallelForDirective*) /localdata/vinod/Polygeist/tools/mlir-clang/Lib/CGStmt.cc:295:0
#11 0x000055e198317413 clang::StmtVisitorBase<std::add_pointer, MLIRScanner, ValueCategory>::Visit(clang::Stmt*) /localdata/vinod/Polygeist/build/tools/clang/include/clang/AST/StmtNodes.inc:271:0
#12 0x000055e19838c946 MLIRScanner::VisitCompoundStmt(clang::CompoundStmt*) /localdata/vinod/Polygeist/tools/mlir-clang/Lib/CGStmt.cc:707:0
#13 0x000055e19831712b clang::StmtVisitorBase<std::add_pointer, MLIRScanner, ValueCategory>::Visit(clang::Stmt*) /localdata/vinod/Polygeist/build/tools/clang/include/clang/AST/StmtNodes.inc:73:0
#14 0x000055e1982ce677 MLIRScanner::MLIRScanner(MLIRASTConsumer&, mlir::FuncOp, clang::FunctionDecl const*, mlir::OwningOpRefmlir::ModuleOp&, LowerToInfo&) /localdata/vinod/Polygeist/tools/mlir-clang/Lib/clang-mlir.cc:307:0
#15 0x000055e1982f366b MLIRASTConsumer::run() /localdata/vinod/Polygeist/tools/mlir-clang/Lib/clang-mlir.cc:5080:0
#16 0x000055e1982f44b5 MLIRASTConsumer::HandleTopLevelDecl(clang::DeclGroupRef) /localdata/vinod/Polygeist/tools/mlir-clang/Lib/clang-mlir.cc:5232:0
#17 0x000055e19ea49126 clang::ParseAST(clang::Sema&, bool, bool) /localdata/vinod/Polygeist/llvm-project/clang/lib/Parse/ParseAST.cpp:162:0
#18 0x000055e19ba1c76d clang::ASTFrontendAction::ExecuteAction() /localdata/vinod/Polygeist/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1074:0
#19 0x000055e19ba1c036 clang::FrontendAction::Execute() /localdata/vinod/Polygeist/llvm-project/clang/lib/Frontend/FrontendAction.cpp:971:0
#20 0x000055e1982f9353 parseMLIR(char const*, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > >, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > >, mlir::OwningOpRefmlir::ModuleOp&, llvm::Triple&, llvm::DataLayout&) /localdata/vinod/Polygeist/tools/mlir-clang/Lib/clang-mlir.cc:5900:0
#21 0x000055e1982fa351 main /localdata/vinod/Polygeist/tools/mlir-clang/mlir-clang.cc:404:0
#22 0x00007fd96d064bf7 __libc_start_main /build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:344:0
#23 0x000055e1982cbb4a _start (/localdata/vinod/Polygeist/build/bin/mlir-clang+0x858b4a)
Aborted (core dumped)
from polygeist.
Without openmp this should build on main. With OpenMP does indeed still trigger issues, will look into.
from polygeist.
Thanks. Could you please share how you are building it without OpenMP?
It will be very useful if it were building with OpenMP :-)
from polygeist.
Oh a large suite of fixes just landed to main, one of which fixed the issue you saw. But as for command line:
./bin/mlir-clang -resource-dir /home/wmoses/git/Polygeist/mlir-build/lib/clang/14.0.0 -o a.exe heat.c -O3
from polygeist.
Thanks. Should the OpenMP version be building error-free with the fixes that landed?
from polygeist.
Not yet, but I've added support for the requisite OMP single and related in a current PR which should enable that code to run.
from polygeist.
thanks. I look forward to your PR being merged and trying it out.
from polygeist.
Try now on the latest main.
from polygeist.
It works, thank you.
Is polymer not being used anymore?
from polygeist.
Polymer is/can still be used, but it'll be a bit before it can be used on this as the polymer codebase will need to update to the latest llvm & Polygeist commits.
We also need to add scf.parallel raising to affine.parallel for it to work in this case (and probably polymer should take in affine.parallel).
from polygeist.
Related Issues (20)
- Passing array to function using initializer syntax leads to crash
- Documentation HOT 7
- FastmathFlagsInterface: def already exists: HOT 1
- Crash when lowering to LLVM HOT 1
- polygeist.mit.edu is offline HOT 1
- If sink and buffer elimination bugs
- Does Polygeist Support AVX Instructions?
- Bumping LLVM version HOT 1
- Does polygeist support the cmath library and complex number calculation?
- Complex Arithemetic HOT 2
- `MoveLoadToAffine` in `affine-cfg` doesn't work for affine maps of indices? HOT 1
- Does Polygeist have a roadmap to illustrate the required subtasks that need to be completed
- [BUG] type-related(size_t or int) crash in simple matrix multiply example
- Add ISL support for polymer HOT 4
- Cgeist outputs something strange HOT 6
- How to run PolyBench/C benchmarks with polyhedral pluto optimization using Polygeist? HOT 3
- [Bug] Incorrect scf.for code is generated
- Sign extension not properly propagated to users HOT 2
- declared char constants emit higher bit-width MLIR constants HOT 3
- linker error with cgeist on C++ code HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polygeist.