<commit_before># project(EIGEN_TESTS)

# cmake_minimum_required(VERSION 3.0)

# set(CLANG_HOME "/usr/local/opt/llvm-4.0" CACHE STRING "the clang-4.0.0 folder, containing lib, bin etc")
set(EIGEN_HOME "UNKNOWN" CACHE STRING "eigen folder")

set(EIGEN_TESTS test_cuda_elementwise_small test_cuda_elementwise test_cuda_nullary reduction_tiny reduction_sum reduction reduction_prod reduction_mean
  argmax test_cuda_elementwise_equal test_equal_int32 test_equal_int64 test_cuda_elementwise_abs reduction_sum_axisall
)

# set(EIGEN_HOME ${CMAKE_CURRENT_SOURCE_DIR}/../../..)

if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h)  
  file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h "")
  foreach(i RANGE 1 999)
    file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h
      "#ifdef EIGEN_TEST_PART_${i}\n"
      "#define CALL_SUBTEST_${i}(FUNC) CALL_SUBTEST(FUNC)\n"
      "#else\n"
      "#define CALL_SUBTEST_${i}(FUNC)\n"
      "#endif\n\n"
    )
  endforeach()
endif()

include_directories(${EIGEN_HOME})
include_directories(${EIGEN_HOME}/test)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_definitions(-DEIGEN_TEST_NO_FP16)
if(INDEXES_32BIT)
    add_definitions(-DEIGEN_DEFAULT_DENSE_INDEX_TYPE=int32_t)
endif()

# include(/usr/local/share/cocl/cocl.cmake)

foreach(EIGEN_TEST ${EIGEN_TESTS})
    cocl_add_executable(${EIGEN_TEST} ${TESTS_EXCLUDE} ${EIGEN_TEST}.cu)
    target_link_libraries(${EIGEN_TEST} ${Coriander_LIBRARIES})
    target_include_directories(${EIGEN_TEST} PRIVATE ${EIGEN_HOME}/test)
    add_custom_target(run-${EIGEN_TEST}
        COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${EIGEN_TEST}
        DEPENDS ${EIGEN_TEST} ${CMAKE_CURRENT_SOURCE_DIR}/${EIGEN_TEST}.cu
    )
    set(BUILD_EIGEN_TEST_TARGETS ${BUILD_EIGEN_TEST_TARGETS} ${EIGEN_TEST})
    set(RUN_EIGEN_TEST_TARGETS ${RUN_EIGEN_TEST_TARGETS} run-${EIGEN_TEST})
endforeach()<commit_msg>fix eigen test linking<commit_after># project(EIGEN_TESTS)

# cmake_minimum_required(VERSION 3.0)

# set(CLANG_HOME "/usr/local/opt/llvm-4.0" CACHE STRING "the clang-4.0.0 folder, containing lib, bin etc")
set(EIGEN_HOME "UNKNOWN" CACHE STRING "eigen folder")

set(EIGEN_TESTS test_cuda_elementwise_small test_cuda_elementwise test_cuda_nullary reduction_tiny reduction_sum reduction reduction_prod reduction_mean
  argmax test_cuda_elementwise_equal test_equal_int32 test_equal_int64 test_cuda_elementwise_abs reduction_sum_axisall
)

# set(EIGEN_HOME ${CMAKE_CURRENT_SOURCE_DIR}/../../..)

if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h)  
  file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h "")
  foreach(i RANGE 1 999)
    file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h
      "#ifdef EIGEN_TEST_PART_${i}\n"
      "#define CALL_SUBTEST_${i}(FUNC) CALL_SUBTEST(FUNC)\n"
      "#else\n"
      "#define CALL_SUBTEST_${i}(FUNC)\n"
      "#endif\n\n"
    )
  endforeach()
endif()

include_directories(${EIGEN_HOME})
include_directories(${EIGEN_HOME}/test)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_definitions(-DEIGEN_TEST_NO_FP16)
if(INDEXES_32BIT)
    add_definitions(-DEIGEN_DEFAULT_DENSE_INDEX_TYPE=int32_t)
endif()

# include(/usr/local/share/cocl/cocl.cmake)

foreach(EIGEN_TEST ${EIGEN_TESTS})
    cocl_add_executable(${EIGEN_TEST} ${TESTS_EXCLUDE} ${EIGEN_TEST}.cu)
    target_link_libraries(${EIGEN_TEST} cocl clblast clew easycl)
    target_include_directories(${EIGEN_TEST} PRIVATE ${EIGEN_HOME}/test)
    add_custom_target(run-${EIGEN_TEST}
        COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${EIGEN_TEST}
        DEPENDS ${EIGEN_TEST} ${CMAKE_CURRENT_SOURCE_DIR}/${EIGEN_TEST}.cu
    )
    set(BUILD_EIGEN_TEST_TARGETS ${BUILD_EIGEN_TEST_TARGETS} ${EIGEN_TEST})
    set(RUN_EIGEN_TEST_TARGETS ${RUN_EIGEN_TEST_TARGETS} run-${EIGEN_TEST})
endforeach()
{'fraction_non_alphanumeric': 0.11983144587832499, 'fraction_numerical': 0.011061364234922308, 'mean_word_length': 6.491124260355029, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6581079', 'n_tokens_mistral': 1549, 'n_tokens_neox': 1447, 'n_words': 187}