Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions ffi/cmake/Utils/AddGoogleTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ FetchContent_Declare(
)
FetchContent_GetProperties(googletest)
if (NOT googletest_POPULATED)
FetchContent_Populate(googletest)
message(STATUS "Found googletest_SOURCE_DIR - ${googletest_SOURCE_DIR}")
message(STATUS "Found googletest_BINARY_DIR - ${googletest_BINARY_DIR}")
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
FetchContent_MakeAvailable(googletest)
include(GoogleTest)
set_target_properties(gtest PROPERTIES EXPORT_COMPILE_COMMANDS OFF EXCLUDE_FROM_ALL ON FOLDER 3rdparty)
set_target_properties(gtest_main PROPERTIES EXPORT_COMPILE_COMMANDS OFF EXCLUDE_FROM_ALL ON FOLDER 3rdparty)
Expand Down
9 changes: 4 additions & 5 deletions ffi/include/tvm/ffi/container/tuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ class Tuple : public ObjectRef {
typename = std::enable_if_t<(details::type_contains_v<Types, UTypes> && ...), int>>
Tuple(Tuple<UTypes...>&& other) : ObjectRef(std::move(other)) {}

template <typename... UTypes,
typename = std::enable_if_t<sizeof...(Types) == sizeof...(UTypes) &&
!(sizeof...(Types) == 1 &&
(std::is_same_v<std::remove_cv_t<UTypes>, Tuple<Types>> &&
...))>>
template <typename... UTypes, typename = std::enable_if_t<
sizeof...(Types) == sizeof...(UTypes) &&
!(sizeof...(Types) == 1 &&
(std::is_same_v<std::decay_t<UTypes>, Tuple<Types>> && ...))>>
explicit Tuple(UTypes&&... args) : ObjectRef(MakeTupleNode(std::forward<UTypes>(args)...)) {}

TVM_FFI_INLINE Tuple& operator=(const Tuple<Types...>& other) {
Expand Down
6 changes: 3 additions & 3 deletions ffi/src/ffi/extra/json_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,9 @@ class JSONParserContext {
// W2 = 110111xxxxxxxxxx // 0xDC00 + xxxxxxxxxx
//
// Range of W1 and W2:
// 0xD8000xDBFF for W1
// 0xDC000xDFFF for W2
// both W1 and W2 fit into 0xD8000xDFFF
// 0xD800 - 0xDBFF for W1
// 0xDC00 - 0xDFFF for W2
// both W1 and W2 fit into 0xD800 - 0xDFFF
// Detect if the first i16 fit into range of W1/W2
if (first_i16 >= 0xD800 && first_i16 <= 0xDFFF) {
// we are in the surrogate pair range
Expand Down
5 changes: 3 additions & 2 deletions ffi/tests/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ add_executable(
EXCLUDE_FROM_ALL
${_test_sources}
)

set_target_properties(
tvm_ffi_tests PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)

tvm_ffi_add_cxx_warning(tvm_ffi_tests)
add_sanitizer_address(tvm_ffi_tests)
tvm_ffi_add_apple_dsymutil(tvm_ffi_tests)
Expand Down
Loading