FBGEMM
FBGEMM copied to clipboard
asmjit fails to compile with bitwise and
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
Hi @gregrodgers , do you have more details on clang version and repro instruction? We were able to build with clang 9.
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.
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.
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.
I can confirm that this is still an issue (at least out of the box) with clang14.
This should be already fixed by asmjit upstream.