You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As described in #1083, as a user of libcudacxx headers and features, I want to be able to use libcudacxx architecture specific features in a TU compiled for multiple architectures (-gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70) so long as I am careful to guard the code paths in which I use those features, e.g.,
This is not the case today, and this is indirectly due in part to how libcudacxx tests architecture specific features.
libcudacxx uses lit for compiling and running its tests, and it uses the UNSUPPORTED: keyword to indicate environments that the test doesn't support, including GPU architectures. For example:
The // UNSUPPORTED: pre-sm-70 means that this test file will be skipped entirely if compiling for <sm70, e.g., if compiling with -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70.
This means libcudacxx arch conditional tests are never run when compiling for multiple architectures that include one that is unsupported. This has already led to bugs being missed #664.
Solution
libcudacxx test infrastructure has been designed assuming that each test file would only be compiled for a single architecture. However, this is not reflective of how users actually compile their code.
The test infrastructure needs to be redesigned to ensure arch specific tests are still run even when compiling for multiple architectures.
How exactly we do this still needs to be determined, but effectively, what we want is instead of this:
It would be nice to avoid needing to actually rewrite tests that are currently using // UNSUPPORTED: pre-sm-70 and could somehow implicitly inject the appropriate NV_IF_TARGET logic based on the information in the UNSUPPORTED: key. Perhaps by injecting a different fake_main that bakes the appropriate NV_IF_TARGET logic in.
Summary
As described in #1083, as a user of libcudacxx headers and features, I want to be able to use libcudacxx architecture specific features in a TU compiled for multiple architectures (
-gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70
) so long as I am careful to guard the code paths in which I use those features, e.g.,This is not the case today, and this is indirectly due in part to how libcudacxx tests architecture specific features.
libcudacxx uses
lit
for compiling and running its tests, and it uses theUNSUPPORTED:
keyword to indicate environments that the test doesn't support, including GPU architectures. For example:https://github.com/NVIDIA/libcudacxx/blob/206d8f9179deda6006795865c9c61cbd24b5e6cc/.upstream-tests/test/cuda/memcpy_async_16.pass.cpp#L11-L20
The
// UNSUPPORTED: pre-sm-70
means that this test file will be skipped entirely if compiling for<sm70
, e.g., if compiling with-gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70
.This means libcudacxx arch conditional tests are never run when compiling for multiple architectures that include one that is unsupported. This has already led to bugs being missed #664.
Solution
libcudacxx test infrastructure has been designed assuming that each test file would only be compiled for a single architecture. However, this is not reflective of how users actually compile their code.
The test infrastructure needs to be redesigned to ensure arch specific tests are still run even when compiling for multiple architectures.
How exactly we do this still needs to be determined, but effectively, what we want is instead of this:
we want this:
It would be nice to avoid needing to actually rewrite tests that are currently using
// UNSUPPORTED: pre-sm-70
and could somehow implicitly inject the appropriateNV_IF_TARGET
logic based on the information in theUNSUPPORTED:
key. Perhaps by injecting a differentfake_main
that bakes the appropriateNV_IF_TARGET
logic in.Tasks
The text was updated successfully, but these errors were encountered: