8 #ifndef CUDA_API_WRAPPERS_DEVICE_PROPERTIES_HPP_ 9 #define CUDA_API_WRAPPERS_DEVICE_PROPERTIES_HPP_ 16 #include <cuda_runtime_api.h> 58 const char*
name()
const;
62 constexpr
bool is_valid() const noexcept;
93 constexpr
static compute_capability_t from_combined_number(
unsigned combined) noexcept;
95 constexpr
unsigned major()
const {
return architecture.
major; }
96 unsigned constexpr minor()
const {
return minor_; }
105 constexpr
unsigned as_combined_number()
const noexcept;
109 constexpr
bool is_valid()
const noexcept;
113 unsigned max_warp_schedulings_per_processor_cycle()
const;
114 unsigned max_resident_warps_per_processor()
const;
118 unsigned max_in_flight_threads_per_processor()
const;
152 properties_t(
const cudaDeviceProp& cdp) noexcept : cudaDeviceProp(cdp) { };
153 properties_t(cudaDeviceProp&& cdp) noexcept : cudaDeviceProp(cdp) { };
158 bool usable_for_compute()
const noexcept;
161 return { {
static_cast<unsigned>(
major) }, static_cast<unsigned>(minor) };
164 pci_location_t pci_id()
const noexcept {
return { pciDomainID, pciBusID, pciDeviceID, {} }; }
166 unsigned max_in_flight_threads_on_device()
const 168 return compute_capability().max_in_flight_threads_per_processor() * multiProcessorCount;
173 size_t max_shared_memory_per_block()
const noexcept {
return sharedMemPerBlock; }
174 size_t global_memory_size()
const noexcept {
return totalGlobalMem; }
175 bool can_map_host_memory()
const noexcept {
return canMapHostMemory != 0; }
182 #include "detail/device_properties.hpp" 184 #endif // CUDA_API_WRAPPERS_DEVICE_PROPERTIES_HPP_ Definitions and functionality wrapping CUDA APIs.
Definition: array.hpp:22
dimension_t block_dimension_t
CUDA kernels are launched in grids of blocks of threads, in 3 dimensions.
Definition: types.hpp:312
A numeric designator of the computational capabilities of a CUDA device.
Definition: device_properties.hpp:75
unsigned size_t
Each physical core ("Symmetric Multiprocessor") on an nVIDIA GPU has a space of shared memory (see th...
Definition: types.hpp:730
const char * name() const
unsigned major
A compute_capability_t has a "major" and a "minor" number, with "major" indicating the architecture; ...
Definition: device_properties.hpp:51
Location "coordinates" for a CUDA device on a PCIe bus.
Definition: pci_id.hpp:24
compute_architecture_t architecture
The major capability designator.
Definition: device_properties.hpp:78
Fundamental CUDA-related constants and enumerations, not dependent on any more complex abstractions...
A numeric designator of an architectural generation of CUDA devices.
Definition: device_properties.hpp:45
constexpr compute_capability_t make_compute_capability(unsigned combined) noexcept
A named constructor idiom for {compute_capability_t}.
A structure holding a collection various properties of a device.
Definition: device_properties.hpp:149
constexpr bool is_valid() const noexcept
unsigned minor_
The minor designator, indicating mostly numeric choices of capabilities (e.g.
Definition: device_properties.hpp:83
int multiprocessor_count_t
Type of the number of mutiprocessors within a single GPU.
Definition: device_properties.hpp:37
Fundamental CUDA-related type definitions.
Definition of a wrapper class for CUDA PCI device ID information.