I have a gtest unit test for some code that should error:
EXPECT_THROW(
{
auto constexpr capacity = 0U;
auto buf = PinnedHostBuffer<char>(capacity);
},
thrust::system_error);
This test fails. The actual exception thrown is thrust::THRUST_200500___CUDA_ARCH_LIST___NS::system::system_error
It doesn’t bother me that the types are different (I’ve dug into the headers and kind of follow the namespace philosophy), but I don’t understand why, if I throw thrust::system_error I can’t catch thrust::system_error
Am I doing something foolish? Is there a better way?
The general mechanism seems to work fine for me, without google test framework (and without whatever PinnedHostBuffer<> is). Here is an example on CUDA 12.2:
You mentioned 12.2; This test was working in earlier versions of CUDA. I recently revved my tools to 12.6 and this test started failing. I should have specified that in the original message.
if the cudaCheck() macro and function are defined in the current compilation unit, it works as desired. However, I have a library that uses the header in multiple places.