Skip to content

Fix Windows compatibility issues - #336

Open
GagaLP wants to merge 1 commit into
masterfrom
fix/windows-build
Open

Fix Windows compatibility issues#336
GagaLP wants to merge 1 commit into
masterfrom
fix/windows-build

Conversation

@GagaLP

@GagaLP GagaLP commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

This PR addresses a collection of smaller fixes to get Celerity working on Windows.

The most notable changes are:

  • Adding and updating header files that were missing or incompatible with Windows.
  • Adding support for demangling names from pointer types.
  • Using MSVC's [[msvc::no_unique_address]] attribute.

@GagaLP
GagaLP requested a review from PeterTh July 14, 2026 15:46
@github-actions

Copy link
Copy Markdown

Check-perf-impact results: (ae6918621b46271c2f10d6eb978fe95d)

❓ No new benchmark data submitted. ❓
Please re-run the microbenchmarks and include the results if your commit could potentially affect performance.

Comment thread include/workaround.h
Comment on lines +9 to +18
#ifdef _WIN32
// Prevent Windows headers from polluting global namespace with min/max macros.
#ifndef NOMINMAX
#define NOMINMAX
#endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#endif

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is generally a good idea, but usually done right before windows.h is included. Is there a reason why it is in this particular spot?

std::vector<sycl::queue> queues;
std::optional<detail::thread_queue> submission_thread;
std::atomic_flag active_async_error_check = false;
std::atomic_flag active_async_error_check; // since c++20 atomic_flag is set to clear by default (false)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change necessary?

Comment thread src/utils.cc
std::string get_simplified_type_name_from_pointer(const std::type_info& pointer_type_info) {
#if !defined(_MSC_VER)
// This type of demangling can be done if the abi header is available. This also works for Clang on Windows, if
// compiled with Itanium ABI on Windows (e.g. MinGW/MSYS2). MSVC

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MSVC ?

Comment thread src/utils.cc
// get rid of the pointer "*"
if(!demangled_type_name.empty() && demangled_type_name.back() == '*') { demangled_type_name.pop_back(); }
#else
std::string demangled_type_name = msvc_undecorate_type_name(pointer_type_info.name());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this kind of assumes that anything not fulfilling __has_include(<cxxabi.h>) is necessarily MSVC. That's probably not unlikely in practice, but I'd prefer an additional check (and maybe error out in the final else).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants