Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenCL][CMake] Fix OpenCL tests compilation #16394

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

echuraev
Copy link
Contributor

Found a problem when you are in a different cmake project (not TVM) and you run TVM build with OpenCL tests, then CMAKE_SOURCE_DIR returns the path to the CMakeList.txt in the current project (not to the TVM) and in this case we will see the following error: No SOURCES given to target: opencl-cpptest.

To be consistent with code style in OpenCL.cmake, I removed the usage of CMAKE_SOURCE_DIR variable. It also fixes the issue if TVM cmake was called from directory with another cmake project.

Found a problem when you are in a different cmake project (not TVM) and you run TVM build with OpenCL tests, then `CMAKE_SOURCE_DIR` returns the path to the `CMakeList.txt` in the current project (not to the TVM) and in this case we will see the following error: `No SOURCES given to target: opencl-cpptest`.

To be consistent with code style in `OpenCL.cmake`, I removed the usage of `CMAKE_SOURCE_DIR` variable. It also fixes the issue if TVM cmake was called from directory with another cmake project.
Copy link
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

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

LGTM

@echuraev echuraev merged commit fe9814c into main Jan 15, 2024
30 checks passed
@tqchen tqchen deleted the echuraev/fix_cmake_issue_for_opencl_tests branch March 29, 2024 12:18
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