Skip to content

Commit

Permalink
Add additional implicit casts for dim3
Browse files Browse the repository at this point in the history
  • Loading branch information
pvelesko committed Jul 27, 2024
1 parent 142496a commit 32a6426
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion include/hip/hip_runtime_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,13 @@ typedef struct dim3 {
uint32_t y; ///< y
uint32_t z; ///< z
#ifdef __cplusplus
constexpr __host__ __device__ dim3(uint32_t _x = 1, uint32_t _y = 1, uint32_t _z = 1) : x(_x), y(_y), z(_z){};
constexpr __host__ __device__ dim3(uint32_t _x = 1, uint32_t _y = 1, uint32_t _z = 1) : x(_x), y(_y), z(_z) {}
#endif
#if defined(__clang__) && defined(__HIP__)
__host__ __device__ dim3(const __hip_builtin_threadIdx_t& idx) : x(idx.x), y(idx.y), z(idx.z) {}
__host__ __device__ dim3(const __hip_builtin_blockIdx_t& idx) : x(idx.x), y(idx.y), z(idx.z) {}
__host__ __device__ dim3(const __hip_builtin_blockDim_t& dim) : x(dim.x), y(dim.y), z(dim.z) {}
__host__ __device__ dim3(const __hip_builtin_gridDim_t& dim) : x(dim.x), y(dim.y), z(dim.z) {}
#endif
} dim3;
/**
Expand Down

0 comments on commit 32a6426

Please sign in to comment.