Commit 8285aa9e authored by Brad King's avatar Brad King
Browse files

Tests: Add missing error check in CudaOnly.GPUDebugFlag

If `cudaMallocManaged` fails then later use of `has_debug` is not valid.
parent 5a16e762
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment