- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is the clause __assume_aligned(x, y) deprecated in oneAPI? This causes the error above, but seemed to be a valid statement in XE Compiler 19.2.
If it is still a valid clause, which section of the documention describes the correct usage?
Thanks, Greg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apparently I should have been using __declspec(align(x)).
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Greg,
Thanks for reaching out to us.
assume_aligned(x,y) is not deprecated.
You can check the below link for further assistance
Function Annotations and the SIMD Directive for Vectorization (intel.com)
Can you please let us know by oneAPI which compiler are you referring?
The assume_aligned(x,y) works perfectly fine with icpc.
With icpx/dpcpp you can use __builtin_assume_aligned (ptr, offset)
Eg : float* ax = (float*)__builtin_assume_aligned(x, 64);
or you can use __attribute__((assume_aligned(<alignment>[,<offset>])) on a function declaration to specify that the return value of the function (which must be a pointer type) has the specified offset, in bytes, from an address with the specified alignment. The offset is considered to be zero if omitted.
Regards,
Arpita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using icpc, and only seeing this error message when compiling within the Visual Studio 2019 environment. Is there a declaration required for the Visual Studio environment to use this directive?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Greg,
Basically, we do not need any directives included to use __assume_aligned(x, 64). You can try using __builtin_assume_aligned(x, 64) instead, because it does the same work.
May I know if you are using command line or the Visual Studio 2019 IDE . And also let me know if you have Intel oneAPI Base Toolkit or Intel oneAPI HPC Toolkit installed in your system? These inputs might help us in resolving the issue faster.
Regards,
Arpita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apparently I should have been using __declspec(align(x)).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Greg,
When we are compiling codes using Intel oneAPI DPC++ compiler, we can use __declspec(align(n)) prior to __assume_aligned(x,n).
There are various other ways to align data, you can follow the below link
While using __assume_aligned for C++ in Visual studio 2019 try switching to intel compiler i.e. Intel C++ compiler 19.2 .
You can do that by Right click on solution of project->Properties->General->Platform Toolset.
In the above case we can simply use __assume_align(a,n).
Please let us know if you require any other assistance from our side.
Regards,
Arpita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Hope we were able to resolve your issue. If you need any additional information, please submit a new query as this thread will no longer be monitored.
Regards,
Arpita

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page