Skip to content

Conversation

@ultimatile
Copy link
Contributor

Building src/linalg/Kron.cpp for GPU should be handled by nvcc (or another CUDA-family compiler).
However, under the current configuration, the LANGUAGE CUDA property does not propagate to the top-level CMake configuration, causing the file to be compiled incorrectly with a C++ compiler such as g++.
This PR corrects the issue by using TARGET_DIRECTORY, enabling Kron.cpp to be built properly with nvcc.
This fix may also resolve the ordering issue mentioned in the comment.

@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 30.19%. Comparing base (eb3e3be) to head (0efc3ab).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #710   +/-   ##
=======================================
  Coverage   30.19%   30.19%           
=======================================
  Files         215      215           
  Lines       38335    38335           
  Branches    15474    15474           
=======================================
  Hits        11576    11576           
  Misses      24858    24858           
  Partials     1901     1901           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@IvanaGyro
Copy link
Collaborator

I wonder why CMAKE_SOURCE_DIR doesn't cover the file.

@ultimatile
Copy link
Contributor Author

ultimatile commented Nov 27, 2025

Sorry for the late response. I needed some time to investigate why DIRECTORY ${CMAKE_SOURCE_DIR} does not work.

Both DIRECTORY ${CMAKE_SOURCE_DIR} and TARGET_DIRECTORY cytnx work correctly when Cytnx is built as a standalone project.
The difference appears when Cytnx is used as a subdirectory.
In that case, ${CMAKE_SOURCE_DIR} no longer refers to Cytnx's root, but to the parent project's root instead.
Therefore, DIRECTORY ${CMAKE_SOURCE_DIR} points to an incorrect path and does not work.

DIRECTORY ${PROJECT_SOURCE_DIR} also worked.

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