25 template<alpaka::concepts::DeviceKind T_DeviceKind>
26 struct Platform : std::enable_shared_from_this<Platform<T_DeviceKind>>
43 std::vector<std::weak_ptr<cpu::Device<Platform>>>
devices;
48 return this->shared_from_this();
55 return "host::Platform";
62 uint32_t devCount = 0u;
65 if constexpr(isSupportedDev)
74 if(
devices.size() <
static_cast<size_t>(devCount))
91 std::stringstream ssErr;
92 ssErr <<
"Unable to return device handle with index " << idx <<
" because there are only "
95 throw std::runtime_error(ssErr.str());
99 if(
auto sharedPtr =
devices[idx].lock())
109 auto newDevice = std::make_shared<cpu::Device<Platform>>(std::move(thisHandle), idx, numaIdx);
120 return T_DeviceKind{};
127 template<alpaka::concepts::DeviceKind T_DeviceKind>
136 template<alpaka::concepts::DeviceKind T_DeviceKind>
141 alpaka::unused(platform);
157 alpaka::unused(deviceIdx);
159 prop.maxThreadsPerBlock = std::numeric_limits<uint32_t>::max();
160 prop.fnMaxThreadsPerBlock = [](uint32_t*
data, uint32_t numDims)
162 for(uint32_t d = 0u; d < numDims; ++d)
163 data[d] = std::numeric_limits<uint32_t>::max();
166 prop.maxBlocksPerGrid = std::numeric_limits<uint32_t>::max();
167 prop.fnMaxBlocksPerGrid = [](uint32_t*
data, uint32_t numDims)
169 for(uint32_t d = 0u; d < numDims; ++d)
170 data[d] = std::numeric_limits<uint32_t>::max();
181 template<alpaka::concepts::DeviceKind T_DeviceKind>
186 alpaka::unused(platform);
#define ALPAKA_BLOCK_SHARED_DYN_MEMBER_ALLOC_KIB
#define ALPAKA_LOG_FUNCTION(logLvl)
Log the entry and exit of a scope.
alpaka internal implementations.
uint32_t getNumNumaDomains()
Get the number of NUMA domains.
constexpr uint32_t allNumaDomains
Constant to select all NUMA domains.
uint32_t getNumCores(uint32_t numaIdx)
Return the number of cores which has direct access to the numa domain.
size_t getMemCapacityBytes(uint32_t numaIdx)
Return the number of bytes of the numa domain.
Functionality which is usable on the host CPU controller thread.
std::shared_ptr< T > Handle
decltype(auto) data(auto &&any)
pointer to data of an object
auto make_sharedSingleton(T_Args &&... args)
auto getCpuName() -> std::string
std::convertible_to< std::string > auto getStaticName(auto const &any)
Compile‑time available name for a given object.
std::string name
The name of the device.