Skip to content

Fix Windows build support for xpupti tests and #1394

Open
tsocha wants to merge 1 commit into
pytorch:mainfrom
intel-staging:dev/tsocha/oneccl-1
Open

Fix Windows build support for xpupti tests and #1394
tsocha wants to merge 1 commit into
pytorch:mainfrom
intel-staging:dev/tsocha/oneccl-1

Conversation

@tsocha
Copy link
Copy Markdown

@tsocha tsocha commented May 11, 2026

It's a part of #1335 1/3

  • Refactor test/xpupti/CMakeLists.txt to handle Windows and multi-config generators (VS, Ninja Multi-Config):

    • Force Ninja as the inner ExternalProject generator on Windows and propagate $ via CONFIGURE_COMMAND for multi-config
    • Use WINDOWS_EXPORT_ALL_SYMBOLS and /FORCE:UNRESOLVED so the shared test library can build against ComputeOnXpu defined in the compute executable
    • Pass LINK_LIBRARY_NAME/LINK_LIBRARY_DIR instead of a hardcoded lib.so path; inner project resolves via find_library with config-aware PATH_SUFFIXES
    • Forward SYCL lib path to the inner linker on Windows
    • Skip -Wl,--export-dynamic on Windows in compute/CMakeLists.txt
  • Rename make_test to make_sycl_test to reflect SYCL-based tests.

  • Fix XPUPTI_BUILD_FLAG so -DHAS_XPUPTI is visible in both the current and parent scopes (was only set in PARENT_SCOPE).

  • Reorder id/linked/metadata assignments in XpuptiActivityProfilerSession::handleRuntimeKernelMemcpyMemsetActivities and inline the linkedActivity lookup — no behavior change.

  • Include src/ActivityBuffers.h in XpuptiTestUtilities.cpp and hoist iterator declarations out of the for-init to satisfy MSVC.

* Refactor test/xpupti/CMakeLists.txt to handle Windows and
  multi-config generators (VS, Ninja Multi-Config):
  - Force Ninja as the inner ExternalProject generator on Windows
    and propagate $<CONFIG> via CONFIGURE_COMMAND for multi-config
  - Use WINDOWS_EXPORT_ALL_SYMBOLS and /FORCE:UNRESOLVED so the
    shared test library can build against ComputeOnXpu defined in
    the compute executable
  - Pass LINK_LIBRARY_NAME/LINK_LIBRARY_DIR instead of a hardcoded
    lib<name>.so path; inner project resolves via find_library with
    config-aware PATH_SUFFIXES
  - Forward SYCL lib path to the inner linker on Windows
  - Skip -Wl,--export-dynamic on Windows in compute/CMakeLists.txt

* Add XpuptiActivityHandlersTest executable (unit test that does
  not require the SYCL compute ExternalProject); rename make_test
  to make_sycl_test to reflect the remaining SYCL-based tests.

* Fix XPUPTI_BUILD_FLAG so -DHAS_XPUPTI is visible in both the
  current and parent scopes (was only set in PARENT_SCOPE).

* Reorder id/linked/metadata assignments in
  XpuptiActivityProfilerSession::handleRuntimeKernelMemcpyMemsetActivities
  and inline the linkedActivity lookup — no behavior change.

* Include src/ActivityBuffers.h in XpuptiTestUtilities.cpp and
  hoist iterator declarations out of the for-init to satisfy MSVC.
@meta-cla meta-cla Bot added the cla signed label May 11, 2026
@tsocha
Copy link
Copy Markdown
Author

tsocha commented May 11, 2026

@gujinghui please review it.

@gujinghui
Copy link
Copy Markdown

@tsocha
can we merge the changes of #1337 into this PR?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants