diff options
author | Brad King <brad.king@kitware.com> | 2018-02-02 12:23:15 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-02-02 12:23:38 (GMT) |
commit | 62c5fc80b1a82d677b66134e00cec44ab2e6a466 (patch) | |
tree | 249e10e47c1ef22152b587aeedc98405a6ed0da2 | |
parent | 52ed76e46e6c295c4e6bfafd86f5b16f67606581 (diff) | |
parent | 8285aa9e4e2df09b35f4faa930da6577979d4d2a (diff) | |
download | CMake-62c5fc80b1a82d677b66134e00cec44ab2e6a466.zip CMake-62c5fc80b1a82d677b66134e00cec44ab2e6a466.tar.gz CMake-62c5fc80b1a82d677b66134e00cec44ab2e6a466.tar.bz2 |
Merge topic 'test-cuda-missing-check'
8285aa9e Tests: Add missing error check in CudaOnly.GPUDebugFlag
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1739
-rw-r--r-- | Tests/CudaOnly/GPUDebugFlag/main.cu | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Tests/CudaOnly/GPUDebugFlag/main.cu b/Tests/CudaOnly/GPUDebugFlag/main.cu index 8b97a3f..1f3fc12 100644 --- a/Tests/CudaOnly/GPUDebugFlag/main.cu +++ b/Tests/CudaOnly/GPUDebugFlag/main.cu @@ -49,6 +49,11 @@ int main(int argc, char** argv) { bool* has_debug; cudaError_t err = cudaMallocManaged(&has_debug, sizeof(bool)); + if (err != cudaSuccess) { + std::cerr << "cudaMallocManaged failed:\n" + << " " << cudaGetErrorString(err) << std::endl; + return 1; + } debug_kernel<<<1, 1>>>(has_debug); err = cudaDeviceSynchronize(); |