Here is my problem: we have a math library written in C ++ that uses SSE heavily. We need to use the same math library in our managed layer of our tools (which are written in C #).
The problem is that the classes in the math library must be aligned by 16 bytes (for SSE to work). However, when compiling managed code, I get a lot of errors because "__declspec (align (X))" is not supported.
Any ideas, is this possible somehow? I could not find useful information.
Additional Information:
A math library written in C ++ uses SSE for maximum performance. However, our tool does not require maximum performance, we can even achieve a decrease in performance compared to general C # code. It is more like being able to execute all of our code (this is a huge code base) without having people to convert back and forth between data types.
So, this is really just about usability, not about performance.
I tried this: I included all our math functions in cpp, instead of using them as built-in functions. Now they are exported from their own DLL. However, the vector class, of course, has a private member __m128 for its data.
As soon as I just put such a variable in managed code, the compiler tells me that my managed code is now internal code.
Does this mean that I should not have this type in the class definition and completely hide it behind the DLL interface? Thanks.
Jan
source share