You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by ec...@apache.org on 2024/01/15 06:46:53 UTC
(tvm) branch main updated: [OpenCL][CMake] Fix OpenCL tests compilation (#16394)
This is an automated email from the ASF dual-hosted git repository.
echuraev pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new fe9814c73e [OpenCL][CMake] Fix OpenCL tests compilation (#16394)
fe9814c73e is described below
commit fe9814c73e24df3ecd031b216492fb555a1ab95a
Author: Egor Churaev <eg...@gmail.com>
AuthorDate: Mon Jan 15 09:46:47 2024 +0300
[OpenCL][CMake] Fix OpenCL tests compilation (#16394)
[OpenCL] Fix OpenCL tests compilation
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.
---
cmake/modules/OpenCL.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmake/modules/OpenCL.cmake b/cmake/modules/OpenCL.cmake
index 2dc1fc18f3..ddcd1e4190 100644
--- a/cmake/modules/OpenCL.cmake
+++ b/cmake/modules/OpenCL.cmake
@@ -81,7 +81,7 @@ if(USE_OPENCL)
if(Build_OpenCL_GTests)
message(STATUS "Building OpenCL-Gtests")
tvm_file_glob(GLOB_RECURSE OPENCL_TEST_SRCS
- "${CMAKE_SOURCE_DIR}/tests/cpp-runtime/opencl/*.cc"
+ "tests/cpp-runtime/opencl/*.cc"
)
add_executable(opencl-cpptest ${OPENCL_TEST_SRCS})
target_link_libraries(opencl-cpptest PRIVATE gtest_main tvm_runtime)