Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] An empty macro MATX_ASSERT_STR_EXP is missing in matx_error.h when NDEBUG is defined #177

Closed
AtomicVar opened this issue May 4, 2022 · 4 comments · Fixed by #178
Closed

Comments

@AtomicVar
Copy link
Contributor

Describe the bug
An empty macro MATX_ASSERT_STR_EXP is missing in matx_error.h when NDEBUG is defined.

image

When building with -DNDEBUG (e.g. cmake with -DCMAKE_BUILD_TYPE=Release), this error will be thrown by the compiler:

/usr/local/include/matx_einsum.h(105): error: identifier "MATX_ASSERT_STR_EXP" is undefined

Expected behavior
An empty definition of MATX_ASSERT_STR_EXP should be added between #else and #endif, just like MATX_ASSERT and MATX_ASSERT_STR.

System details (please complete the following information):

  • OS: Ubuntu 20.04
  • CUDA version: CUDA 11.4
  • g++ version: 9.3.0
@cliffburdick
Copy link
Collaborator

Thanks for catching this @ZJUGuoShuai . This has been fixed.

@AtomicVar
Copy link
Contributor Author

@cliffburdick I suddenly realized that it's not OK to use MATX_ASSERT_* to wrap cutensornet* APIs in matx_einsum.h because if I build it in release mode (with -DNDEBUG), these APIs will be replaced by emtpy lines.

Actually I tried to compiled a einsum() program with -DNDEBUG and ran it, it really did no computation.

@cliffburdick
Copy link
Collaborator

Thanks @ZJUGuoShuai. fixing it now

@cliffburdick
Copy link
Collaborator

Hi @ZJUGuoShuai , it should be fixed. I verified the einsum tests pass in both debug and release mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants