Replies: 2 comments 3 replies
-
Hi, in short: I have no idea. Swizzles are very complicated and the specification is fairly vague with respect to how exactly they are implemented. This sort of issue typically comes up in the context of how exactly the constructor and implicit conversion operators are implemented. E.g. templates in the function signature can suppress implicit conversions. Personal note: I would not use the |
Beta Was this translation helpful? Give feedback.
-
Thank you for sharing your thoughts and suggestions. I vaguely recall reading (though I can't quite pinpoint whether it was in the context of DPC++, AdaptiveCpp, or SYCL in general) that swizzle operations may return something like a "swizzled_vector" and different SYCL implementations might handle implicit conversions to vectors differently. Regarding the use of the One issue I encountered with Given these considerations, I've decided that using internal SYCL vectors and functions is probably a better idea than to use custom/third-party libraries. Once again, thank you for your thoughts. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I recently encountered an interesting difference in behavior between AdaptiveCpp and oneAPI (DPC++) while working on a SYCL codebase.
In my code, I have a
pos
variable of typesycl::float2
, and I was performing a swizzling operation on avelocity3d
vector ofsycl::float3
type as follows:pos += velocity3d.xy() * delta_t / cell_size;
When compiling this code with AdaptiveCpp, I encountered an error related to the use of the * operator with the swizzled components, specifically stating that _data is a private member of 'hipsycl::sycl::vec<float, 2>'.
To address this, I modified the code as follows, explicitly constructing a new vector from the swizzled components:
pos += sycl::float2(velocity3d.xy()) * delta_t / cell_size;
This modification resolved the issue in AdaptiveCpp. However, when I compile the original code with oneAPI (DPC++), it compiles without any problems.
I'd like to know if this behavior in AdaptiveCpp is intended: probably there's something specific to SYCL standards that might explain this behavior?
Thank you for your time and assistance.
Beta Was this translation helpful? Give feedback.
All reactions