From dc4b0d9224f890757c08462cfe825684183b238b Mon Sep 17 00:00:00 2001 From: Eyal Rozenberg Date: Mon, 18 Nov 2024 22:09:38 +0200 Subject: [PATCH] Fixes #698: Added a `device::default_()` function for obtaining the default CUDA device --- src/cuda/api/device.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cuda/api/device.hpp b/src/cuda/api/device.hpp index 90195d56..4ff07c21 100644 --- a/src/cuda/api/device.hpp +++ b/src/cuda/api/device.hpp @@ -845,6 +845,11 @@ inline device_t get(id_t id) return wrap(id); } +inline device_t default_() +{ + return get(cuda::device::default_device_id); +} + /** * A named constructor idiom for a "dummy" CUDA device representing the CPU. *