diff --git a/CMakeLists.txt b/CMakeLists.txt index d6007ad97..fe6ab94f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.10 FATAL_ERROR) if(POLICY CMP0048) cmake_policy(SET CMP0048 NEW) endif() @@ -18,7 +18,10 @@ set(TACO_FEATURE_OPENMP 0) set(TACO_FEATURE_PYTHON 0) if(CUDA) message("-- Searching for CUDA Installation") - find_package(CUDA REQUIRED) + find_package(CUDAToolkit QUIET) + if(NOT CUDAToolkit_FOUND) + find_package(CUDA REQUIRED) + endif() add_definitions(-DCUDA_BUILT) set(TACO_FEATURE_CUDA 1) endif(CUDA) diff --git a/apps/tensor_times_vector/CMakeLists.txt b/apps/tensor_times_vector/CMakeLists.txt index 6c435fe26..2f08ccefb 100644 --- a/apps/tensor_times_vector/CMakeLists.txt +++ b/apps/tensor_times_vector/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.10) if(POLICY CMP0048) cmake_policy(SET CMP0048 NEW) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7beaeb9c7..c1df5fa30 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,8 +21,12 @@ add_definitions(${TACO_DEFINITIONS}) include_directories(${TACO_SRC_DIR}) add_library(taco ${TACO_LIBRARY_TYPE} ${TACO_HEADERS} ${TACO_SOURCES}) if (CUDA) - include_directories(${CUDA_INCLUDE_DIRS}) - target_link_libraries(taco PUBLIC ${CUDA_LIBRARIES}) + if(TARGET CUDA::cudart) + target_link_libraries(taco PUBLIC CUDA::cudart) + else() + include_directories(${CUDA_INCLUDE_DIRS}) + target_link_libraries(taco PUBLIC ${CUDA_LIBRARIES}) + endif() endif (CUDA) install(TARGETS taco DESTINATION lib) diff --git a/src/lower/lowerer_impl_imperative.cpp b/src/lower/lowerer_impl_imperative.cpp index 3c8814f24..e5381fd68 100644 --- a/src/lower/lowerer_impl_imperative.cpp +++ b/src/lower/lowerer_impl_imperative.cpp @@ -497,7 +497,6 @@ Stmt LowererImplImperative::lowerAssignment(Assignment assignment) if (isAssembledByUngroupedInsertion(result)) { std::vector coords; Expr prevPos = 0; - size_t i = 0; const auto resultIterators = getIterators(assignment.getLhs()); for (const auto& it : resultIterators) { // TODO: Should only assemble levels that can be assembled together @@ -517,7 +516,6 @@ Stmt LowererImplImperative::lowerAssignment(Assignment assignment) } prevPos = pos; - ++i; } } diff --git a/test/tests-scheduling.cpp b/test/tests-scheduling.cpp index ee564577b..a122eb8ed 100644 --- a/test/tests-scheduling.cpp +++ b/test/tests-scheduling.cpp @@ -567,8 +567,6 @@ TEST(scheduling, multilevel_tiling) { vector reordering = {iX1, iX2, iY1, iY2}; sort(reordering.begin(), reordering.end()); - int countCorrect = 0; - int countIncorrect = 0; do { // TODO: Precondition (can be broken) bottom most loop must remain unchanged if sparse bool valid_reordering = reordering[3] == iY2; @@ -583,17 +581,12 @@ TEST(scheduling, multilevel_tiling) { C.compute(); if (!equals(C, expected)) { //cout << util::join(reordering) << endl; - countIncorrect++; - std::shared_ptr codegen = ir::CodeGen::init_default(cout, ir::CodeGen::ImplementationGen); ir::Stmt compute = lower(reordered, "compute", false, true); codegen->compile(compute, true); ASSERT_TENSOR_EQ(expected, C); exit(1); } - else { - countCorrect++; - } } while (next_permutation(reordering.begin(), reordering.end())); } diff --git a/test/tests-tensor_types.cpp b/test/tests-tensor_types.cpp index 39d1b30ae..d6a50169b 100644 --- a/test/tests-tensor_types.cpp +++ b/test/tests-tensor_types.cpp @@ -45,7 +45,7 @@ TYPED_TEST_P(VectorTensorTest, types) { ASSERT_EQ(t, a.getComponentType()); ASSERT_EQ(1, a.getOrder()); ASSERT_EQ(5, a.getDimension(0)); - map,TypeParam> vals = {{{0}, 1.0}, {{2}, 2.0}}; + map,TypeParam> vals = {{{0}, static_cast(1)}, {{2}, static_cast(2)}}; for (auto& val : vals) { a.insert(val.first, val.second); }