Skip to content

Commit

Permalink
Fix the compilation error of XFORMERS_CHECK when PyTorch is not insta…
Browse files Browse the repository at this point in the history
…lled (#913)

* fix log

* fix

---------

Co-authored-by: lijiajieli <[email protected]>
  • Loading branch information
Li-Jiajie and lijiajieli authored Nov 2, 2023
1 parent 96d381c commit 6b10d18
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions xformers/csrc/attention/cuda/fmha/gemm_kernel_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,17 @@
std::cerr << #PTR " is not correctly aligned\n"; \
return false; \
}
#define XFORMERS_CHECK(COND, ERR) \
if (!(COND)) { \
std::cerr << "'" #COND "' failed: " << ERR << "\n"; \
return false; \

template <typename... Args>
void print_check_args(const Args&... args) {
(std::cerr << ... << args) << std::endl;
}

#define XFORMERS_CHECK(COND, ...) \
if (!(COND)) { \
std::cerr << "'" #COND "' failed: "; \
print_check_args(__VA_ARGS__); \
return false; \
}
#endif

Expand Down

0 comments on commit 6b10d18

Please sign in to comment.