FBGEMM icon indicating copy to clipboard operation
FBGEMM copied to clipboard

asmjit fails to compile with bitwise and

Open gregrodgers opened this issue 3 years ago • 6 comments

I am new to fbgemm and I am trying to build with clang instead of gcc. gcc builds fine but clang gets this error when building or using asmjit. Should asmjit be fixed or should I turn off the error in clang? Thank you.

/work/grodgers/git/aomp-test/FBGEMM/third_party/asmjit/src/asmjit/core/../core/operand.h:910:79: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
  static inline bool isGp(const Operand_& op, uint32_t rId) noexcept { return isGp(op) & (op.id() == rId); }
                                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                       &&
/work/grodgers/git/aomp-test/FBGEMM/third_party/asmjit/src/asmjit/core/../core/operand.h:910:79: note: cast one or both operands to int to silence this warning

gregrodgers avatar Mar 01 '22 17:03 gregrodgers

Hi @gregrodgers , do you have more details on clang version and repro instruction? We were able to build with clang 9.

jianyuh avatar Mar 18 '22 06:03 jianyuh

I am using upstream build of clang-15. I really want to be able to use latest version of clang for latest OpenMP offloading support.

gregrodgers avatar Apr 18 '22 15:04 gregrodgers

BTW, I am getting around this now with this: export CXXFLAGS="-Wno-error=bitwise-instead-of-logical -Wno-error=unused-but-set-variable -Wno-error=unused-parameter -Wno-error=sign-compare -pthread"

So for now this is not high priority.

gregrodgers avatar Apr 18 '22 16:04 gregrodgers

I may close this issue because I have successfully built fbgemm_gpu with clang 15 and did not run into this problem. In fact I have clang cuda working nicely. In the one case I tested (fbgemm_gpu/bench/sparse_ops_benchmark.py), it ran slightly faster than nvcc :-). I did this with latest upstream clang 15.0.0 built from llvm trunk.

gregrodgers avatar Apr 26 '22 19:04 gregrodgers

I can confirm that this is still an issue (at least out of the box) with clang14.

Tectu avatar May 05 '22 17:05 Tectu

This should be already fixed by asmjit upstream.

kobalicek avatar Jul 14 '23 18:07 kobalicek