2
0

Use size_t datatype for global dimensions. (#2604)

Este cometimento está contido em:
Karthik Jayaprakash
2026-01-20 20:39:07 -05:00
cometido por GitHub
ascendente 50e00d1b94
cometimento 6a84a00208
+7 -6
Ver ficheiro
@@ -129,7 +129,7 @@ struct LaunchParams {
uint32_t sharedMemBytes_; //!< Shared Memory bytes
bool validConfig_; //!< Flag will be set to false when config is not correct.
LaunchParams(uint32_t globalX, uint32_t globalY, uint32_t globalZ, uint32_t localX,
LaunchParams(size_t globalX, size_t globalY, size_t globalZ, uint32_t localX,
uint32_t localY, uint32_t localZ, uint32_t sharedMemBytes)
: global_(globalX, globalY, globalZ),
local_(localX, localY, localZ),
@@ -143,11 +143,12 @@ struct LaunchParams {
struct HIPLaunchParams : public LaunchParams {
public:
HIPLaunchParams(uint32_t gridX, uint32_t gridY, uint32_t gridZ, uint32_t blockX, uint32_t blockY,
uint32_t blockZ, uint32_t sharedMemBytes,
uint32_t globalX_remainder = 0, uint32_t globalY_remainder = 0, uint32_t globalZ_remainder = 0)
: LaunchParams(static_cast<uint32_t>(gridX) * blockX + globalX_remainder, static_cast<uint32_t>(gridY) * blockY +
globalY_remainder, static_cast<uint32_t>(gridZ) * blockZ + globalZ_remainder, blockX, blockY, blockZ,
sharedMemBytes) {
uint32_t blockZ, uint32_t sharedMemBytes, uint32_t globalX_remainder = 0,
uint32_t globalY_remainder = 0, uint32_t globalZ_remainder = 0)
: LaunchParams(static_cast<size_t>(gridX) * blockX + globalX_remainder,
static_cast<size_t>(gridY) * blockY + globalY_remainder,
static_cast<size_t>(gridZ) * blockZ + globalZ_remainder, blockX, blockY,
blockZ, sharedMemBytes) {
if (global_[0] > std::numeric_limits<uint32_t>::max() ||
global_[1] > std::numeric_limits<uint32_t>::max() ||
global_[2] > std::numeric_limits<uint32_t>::max()) {