diff --git a/CMakeLists.txt b/CMakeLists.txt index 46123f56e..8e1b27826 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -473,7 +473,7 @@ install( LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) install( - DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/ctranslate2" + DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h*" ) diff --git a/include/ctranslate2/types.h b/include/ctranslate2/types.h index 025e63dff..906b3b362 100644 --- a/include/ctranslate2/types.h +++ b/include/ctranslate2/types.h @@ -3,11 +3,14 @@ #include #include +#include + #include "devices.h" namespace ctranslate2 { using dim_t = int64_t; // This type should be signed. + using float16_t = half_float::half; enum class DataType { FLOAT, diff --git a/third_party/half_float/half.hpp b/include/half_float/half.hpp similarity index 100% rename from third_party/half_float/half.hpp rename to include/half_float/half.hpp diff --git a/src/cuda/helpers.h b/src/cuda/helpers.h index d980d80fa..581fa7ef9 100644 --- a/src/cuda/helpers.h +++ b/src/cuda/helpers.h @@ -7,7 +7,6 @@ #include "ctranslate2/types.h" #include "utils.h" -#include "type_dispatch.h" #if !defined(__CUDACC__) || !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 530 # define CUDA_CAN_USE_HALF 1 diff --git a/src/ops/multinomial_cpu.cc b/src/ops/multinomial_cpu.cc index 4d0b35600..7f29c78b3 100644 --- a/src/ops/multinomial_cpu.cc +++ b/src/ops/multinomial_cpu.cc @@ -2,8 +2,6 @@ #include "ctranslate2/random.h" -#include "type_dispatch.h" - namespace ctranslate2 { namespace ops { diff --git a/src/ops/multinomial_gpu.cu b/src/ops/multinomial_gpu.cu index 3de7618e7..e01f64f35 100644 --- a/src/ops/multinomial_gpu.cu +++ b/src/ops/multinomial_gpu.cu @@ -3,7 +3,6 @@ #include #include -#include "type_dispatch.h" #include "cuda/helpers.h" #include "cuda/random.h" diff --git a/src/type_dispatch.h b/src/type_dispatch.h index 2f8d23eba..ffe1720fb 100644 --- a/src/type_dispatch.h +++ b/src/type_dispatch.h @@ -1,13 +1,9 @@ #pragma once -#include - #include "ctranslate2/types.h" namespace ctranslate2 { - using float16_t = half_float::half; - // Inspired by // https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/types.h // for matching enum values and C++ types. diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index eb4c02856..8633faf29 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -16,7 +16,6 @@ add_executable(ctranslate2_test test.cc) target_include_directories(ctranslate2_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../src - ${CMAKE_CURRENT_SOURCE_DIR}/../third_party ) target_link_libraries(ctranslate2_test ${PROJECT_NAME}