Skip to content

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
@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