mirror of
https://github.com/reactos/CMake.git
synced 2024-12-02 00:26:18 +00:00
Tests: Add missing error check in CudaOnly.GPUDebugFlag
If `cudaMallocManaged` fails then later use of `has_debug` is not valid.
This commit is contained in:
parent
5a16e762e2
commit
8285aa9e4e
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user