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, cpuGroupIdx);
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);
168 prop.maxThreadsPerBlock = 4u * 1024u;
169 prop.fnMaxThreadsPerBlock
170 = [maxThreadsPerBlockDim = prop.maxThreadsPerBlock](uint32_t*
data, uint32_t numDims)
172 for(uint32_t d = 0u; d < numDims; ++d)
173 data[d] = maxThreadsPerBlockDim;
176 prop.maxBlocksPerGrid = std::numeric_limits<uint32_t>::max();
177 prop.fnMaxBlocksPerGrid = [](uint32_t*
data, uint32_t numDims)
179 for(uint32_t d = 0u; d < numDims; ++d)
180 data[d] = std::numeric_limits<uint32_t>::max();
191 template<alpaka::concepts::DeviceKind T_DeviceKind>
196 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.
size_t getMemCapacityBytes(uint32_t cpuDomainIdx)
Return the memory capacity of a CPU domain.
uint32_t getNumCpuDomains()
Get the number of alpaka host CPU domains.
uint32_t getNumCores(uint32_t cpuDomainIdx)
Return the number of cores in a CPU domain.
constexpr uint32_t allDomains
Constant to select all CPU domains.
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.