Hacks into googletest to provide the possibility to test small code fragments in CUDA kernels (and in host code).
Suppose you want to test a class that uses different code on host and device. With this plugin you need to write only a single test. In the test summary two tests will appear, the one with suffix "_CUDA" is run in a kernel.
Googletest uses preprocessor macros for defining TESTs. We define a new macro CUDA_TEST. The body of the test is duplicated into original TESTs and, the one for CUDA, is surrounded with CUDA code. The ASSERTs are manipulated as well, to work in CUDA kernels. The result of a CUDA_ASSERT is copied back to host and evaluated there with the original ASSERT.
- Only
ASSERT_EQandASSERT_FLOAT_EQis supported. - The number of
ASSERTs in one test is limited to 10 for each type.