Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPIR-V portability fix for single element vectors #719

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion include/hip/spirv_hip_vector_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,12 @@ inline constexpr unsigned int next_pot(unsigned int x) {
template <typename T, unsigned int n> struct HIP_vector_base;

template <typename T> struct HIP_vector_base<T, 1> {
using Native_vec_ = __NATIVE_VECTOR__(1, T);
// SPIR-V does not support one element vector types without
// extensions and the current Clang -> SPIR-V translator tool chain
// used by CHIP-SPV does not include a legalization phase to lower
// one element vectors to scalars. Therefore, define Native_vec_ to
// be a scalar here.
using Native_vec_ = T /*__NATIVE_VECTOR__(1, T) */;

union {
Native_vec_ data;
Expand Down
Loading