You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Visual Studio doesn't like TRISYCL_WEAK_ATTRIB_PREFIX a.k.a. __declspec(selectany) in front of function declarations. Apparently this is only for initialized global data. @keryell Since C++17 has been around for a while now it is maybe possible to switch to C++17 inline as mentioned by the documentation for TRISYCL_WEAK_ATTRIB_PREFIX?
After doing some research I've come to the conclusion that this will be harder than I thought.
Visual Studio officially doesn't support weak linking of functions. __declspec(selectany) only works with variables.
We could use an undocumented linker pragma (alternatename) as shown here (both files are relevant) but we'd need to come up with a Macro-way of obtaining the mangled names. And since all of this is undocumented it is probably not too future-proof.
@keryell@MathiasMagnus What do you think about this? Currently I'm in favour of ditching the Windows weak symbols for now and just annotate the functions with [[gnu::weak]]. We don't have a device compiler on Win32 anyway, right?
Thank you for the research!
There is a simpler solution: do not use this code with VisualStudio because anyway ComputeCpp and Intel DPC++ are already product-quality solutions while this is just an untested triSYCL device compiler path on Windows. :-)
So the solution would be to just #if out the device-compiler related part of the run time that would require massive work to have working on Windows anyway and just keep triSYCL as is: as a pure CPU implementation on Windows.
Any disagreement?
Visual Studio doesn't like TRISYCL_WEAK_ATTRIB_PREFIX a.k.a. __declspec(selectany) in front of function declarations. Apparently this is only for initialized global data. @keryell Since C++17 has been around for a while now it is maybe possible to switch to C++17 inline as mentioned by the documentation for TRISYCL_WEAK_ATTRIB_PREFIX?
See also #269
The text was updated successfully, but these errors were encountered: