Replies: 3 comments 5 replies
-
They can be used and enabled just like in DPC++: For example, the following works: #define SYCL_SIMPLE_SWIZZLES
#include <sycl/sycl.hpp>
int main()
{
sycl::float3 p {1.f, 2.f, 3.f};
sycl::float3 p3 = p.xyx();
p3 *= .1031f;
std::cout << p3.x() << " " << p3.y() << " " << p3.z() << "\n";
} What is important is that the I cannot say anything more about what the problem might be based on the short snippet you have shown. Can you provide a full reproducer? |
Beta Was this translation helpful? Give feedback.
-
I've written a python script which analyzes all current swizzle definitions and prints the vector dimension constraint changes that can be made to enable some of currently impossible swizzles. These are results:
However, 4-component swizzles always require 4-component vectors now because template doesn't take |
Beta Was this translation helpful? Give feedback.
-
So, I propose to change template for SWIZZLE4 to this:
and add required dimensions as a first argument to swizzle macro definitions. These are required dimensions for SWIZZLE4:
|
Beta Was this translation helpful? Give feedback.
-
Hello,
I am currently working on a SYCL project where codebase needs to be compatible with both Intel's oneAPI and AdaptiveCpp. I have encountered an issue related to the use of simple swizzles, which are supported in oneAPI but seem to behave differently or are not supported in the same way in AdaptiveCpp.
When compiling code with oneAPI, I use the
#define SYCL_SIMPLE_SWIZZLES
preprocessor directive to enable simple swizzles. This works as expected. However, when compiling the same code with AdaptiveCpp, I run into errors. Specifically, calls to swizzles likep.xyx()
result in compilation errors, indicating a possible lack of support or different implementation standards in AdaptiveCpp.Here’s an example of the error I've encountering:
I would like to understand if there is a way to enable simple swizzles in AdaptiveCpp that is compatible with how they are handled in oneAPI.
Are simple swizzles supported in AdaptiveCpp? If so, could you provide guidance on how they can be used or enabled?
Thank you for your assistance!
Beta Was this translation helpful? Give feedback.
All reactions