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
{{ message }}
Repository navigation
[RFC] Is the purpose of *_api.cu tests in CUB to only test API examples? #9078
I had the discussion below with @gonidelis on the conventions of *_api.cu files, which in my understanding are only containing tests of API examples appearing in the documentation.
In order to make progress on some critical PRs, I will not block them on non-API examples being added to those files, but we should agree on a guideline on where to put tested API examples for the documentation, which are not intended to be functional tests. This decision should then be documented in the CUB developer guide.
doesn't have to be an example to go under the _api.cu test. It's literally what the name suggest, an API test, not an example (which the file name doesn't even suggest).
This is contrary to my understanding. _api.cu contain only API examples which are referenced from the documentation. They do not contain any functional tests.
Functional tests are always in files like catch2_test_device_algorithmname.cu (with some variations). You also added tests named catch2_test_device_algorithmname_env.cu, which test whether the handling of the execution environment works correctly, with little or no focus on algorithmic correctness.
Please elaborate why we need to break the convention now, or where it has been broken before.
This is contrary to my understanding. _api.cu contain only API examples which are referenced from the documentation. They do not contain any functional tests.
I don't see a reason for the "only" part to be true. It can have both literalinclude examples (which btw, many times we do have examples that are not included in the algorithms' docs) and single api examples that strip all defaults to see if ambiguities are created. It's two different sets of tests both under the API umbrella. One set shows how to use the api and the other one shows that the minimal api usage is non ambiguous
But with the same argument I can also add tests whether the env API functions, or a tuning is considered. There is no criterion distinguishing what belongs into which file now.
But with the same argument I can also add tests whether the env API functions, or a tuning is considered. There is no criterion distinguishing what belongs into which file now.
We are. In test_device*_env_api.cu files
No, the tests I described above are in test_device*_env.cu
test_device*_env_api.cu is for testing API documentation examples of using environment overloads.
Activity
gonidelis commentedon May 20, 2026
I don't see a reason for the "only" part to be true. It can have both literalinclude examples (which btw, many times we do have examples that are not included in the algorithms' docs) and single api examples that strip all defaults to see if ambiguities are created. It's two different sets of tests both under the API umbrella. One set shows how to use the api and the other one shows that the minimal api usage is non ambiguous
bernhardmgruber commentedon May 20, 2026
But with the same argument I can also add tests whether the env API functions, or a tuning is considered. There is no criterion distinguishing what belongs into which file now.
gonidelis commentedon May 20, 2026
We are. In
test_device*_env_api.cufilesbernhardmgruber commentedon May 21, 2026
No, the tests I described above are in
test_device*_env.cutest_device*_env_api.cuis for testing API documentation examples of using environment overloads.