vecmem 1.21.0
Loading...
Searching...
No Matches
select_device.hpp
1/*
2 * VecMem project, part of the ACTS project (R&D line)
3 *
4 * (c) 2021-2025 CERN for the benefit of the ACTS project
5 *
6 * Mozilla Public License Version 2.0
7 */
8
9#pragma once
10
11namespace vecmem::cuda::details {
27public:
34 explicit select_device(int device);
35
37 select_device(const select_device&) = delete;
40
46
51
55 int device() const;
56
57private:
62 int m_device;
63};
64} // namespace vecmem::cuda::details
Class with RAII mechanism for selecting a CUDA device.
Definition select_device.hpp:26
select_device(select_device &&)=delete
Don't allow moving the class.
select_device & operator=(select_device &&)=delete
Don't allow move assigning the class.
select_device & operator=(const select_device &)=delete
Don't allow copy assigning the class.
select_device(const select_device &)=delete
Don't allow copying the class.
~select_device()
Deconstructs the object, returning to the device that was selected before constructing this object.
Definition select_device.cpp:24
int device() const
Identifier for the device being seleced.
Definition select_device.cpp:32