9 #ifndef CUDA_API_WRAPPERS_DEVICE_PROPERTIES_HPP_ 10 #define CUDA_API_WRAPPERS_DEVICE_PROPERTIES_HPP_ 17 #include <cuda_runtime_api.h> 56 const char* name()
const;
58 constexpr
bool is_valid() const noexcept;
79 constexpr
static compute_capability_t from_combined_number(
unsigned combined) noexcept;
81 constexpr
unsigned major()
const {
return architecture.
major; }
82 unsigned constexpr minor()
const {
return minor_; }
84 constexpr
unsigned as_combined_number()
const noexcept;
85 constexpr
bool is_valid()
const noexcept;
86 unsigned max_warp_schedulings_per_processor_cycle()
const;
87 unsigned max_resident_warps_per_processor()
const;
89 unsigned max_in_flight_threads_per_processor()
const;
123 properties_t(
const cudaDeviceProp& cdp) noexcept : cudaDeviceProp(cdp) { };
124 properties_t(cudaDeviceProp&& cdp) noexcept : cudaDeviceProp(cdp) { };
125 bool usable_for_compute()
const noexcept;
128 return { {
static_cast<unsigned>(
major) }, static_cast<unsigned>(minor) };
131 pci_location_t pci_id()
const noexcept {
return { pciDomainID, pciBusID, pciDeviceID, pci_location_t::unused }; }
133 unsigned long long max_in_flight_threads_on_device()
const 135 return compute_capability().max_in_flight_threads_per_processor() * multiProcessorCount;
140 size_t max_shared_memory_per_block()
const noexcept {
return sharedMemPerBlock; }
141 size_t global_memory_size()
const noexcept {
return totalGlobalMem; }
142 bool can_map_host_memory()
const noexcept {
return canMapHostMemory != 0; }
150 #endif // CUDA_API_WRAPPERS_DEVICE_PROPERTIES_HPP_ Implementation of methods and helper functions for device-property-related classes.
All definitions and functionality wrapping the CUDA Runtime API.
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:332
A numeric designator of the computational capabilities of a CUDA device.
Definition: device_properties.hpp:74
unsigned size_t
Each physical core ("Symmetric Multiprocessor") on an nVIDIA GPU has a space of shared memory (see th...
Definition: types.hpp:649
unsigned major
A compute_capability_t has a "major" and a "minor" number, with "major" indicating the architecture; ...
Definition: device_properties.hpp:54
Location "coordinates" for a CUDA device on a PCIe bus.
Definition: pci_id.hpp:24
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:48
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:120
int multiprocessor_count_t
Type of the number of mutiprocessors within a single GPU.
Definition: device_properties.hpp:40
Fundamental CUDA-related type definitions.
Definition of a wrapper class for CUDA PCI device ID information.