-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CCCL C headers to be compileable by C compiler (#3885)
* Closes gh-3882 This change ensures that cccl/c/parallel headers are compilable by C compiler. 1. Corrected typedef struct and typedef enum so that C types have the same names as C++. That is `typdef struct name {...} otherName;` was changed to `typedef struct name {...} name;` 2. `noexcept` qualifier was removed from function declarations. 3. Implementation was changed to move `noexcept` implementations into a namespace, and implement publicly declared functions as thin shims calling these noexcept functions from a namespace. 4. Adds c/parallel/test/test_header.c This is a C file which includes all public headers, and contains a trivial `int main(void)` function. The file is compiled using C compiler to produce an object file. Hence it does not result in a dedicate test to run, but any non C-compliant changes to these headers would break test compilation step. N.B.: Every new header file must be included in `test_headers.c` file for it to be tested. 5. Piggy-backing on this PR, added runtime error condition checking in test_main.cpp to verify that `cudaSetDevice` call did not report an error. 6. Modified cccl/c/parallel CMake project list of languages to include C. * Revert using noexcept implementations and call them from C declared function Instead simply remove use of noexcept in C++ definitions of these functions per Bernhard's suggestion
- Loading branch information
1 parent
ca004f5
commit fd0cd24
Showing
15 changed files
with
146 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.