aboutsummaryrefslogtreecommitdiff
path: root/libgomp/plugin
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2024-03-07 13:18:23 +0100
committerThomas Schwinge <tschwinge@baylibre.com>2024-03-08 16:35:28 +0100
commit37078f241a22c45db6380c5e9a79b4d08054bb3d (patch)
treea7be05757c13fdb30cc466e7c0fc318d4f59e2d9 /libgomp/plugin
parentab70addf560e18210d238edfd605fc91fcce9df1 (diff)
nvptx: 'cuDeviceGetCount' failure is fatal
Per commit 683f11843974f0bdf42f79cdcbb0c2b43c7b81b0 "OpenMP: Move omp requires checks to libgomp", we're now using 'return -1' from 'GOMP_OFFLOAD_get_num_devices' for 'omp_requires_mask' purposes. This missed that via 'nvptx_get_num_devices', we could also 'return -1' for 'cuDeviceGetCount' failure. Before, this meant (in 'gomp_target_init') to silently ignore the plugin/device -- which also has been doubtful behavior. Let's instead turn 'cuDeviceGetCount' failure into a fatal error, similar to other errors during device initialization. libgomp/ * plugin/plugin-nvptx.c (nvptx_get_num_devices): 'cuDeviceGetCount' failure is fatal.
Diffstat (limited to 'libgomp/plugin')
-rw-r--r--libgomp/plugin/plugin-nvptx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c
index 2bc7b850671..ced6e014ece 100644
--- a/libgomp/plugin/plugin-nvptx.c
+++ b/libgomp/plugin/plugin-nvptx.c
@@ -612,7 +612,7 @@ nvptx_get_num_devices (void)
}
}
- CUDA_CALL_ERET (-1, cuDeviceGetCount, &n);
+ CUDA_CALL_ASSERT (cuDeviceGetCount, &n);
return n;
}