Skip to content

Commit f68123f

Browse files
committed
Fixed warnings
1 parent 38790c8 commit f68123f

16 files changed

+33
-25
lines changed

.ci/azure/windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
displayName: 'List temp SDKs'
138138

139139
- script: |
140-
call "$(MSVS_VARS_PATH)" && $(WORK_DIR)\ninja-win\ninja user_ov_extensions
140+
call "$(MSVS_VARS_PATH)" && $(WORK_DIR)\ninja-win\ninja core_tokenizers
141141
call "$(MSVS_VARS_PATH)" && $(WORK_DIR)\ninja-win\ninja
142142
workingDirectory: $(BUILD_DIR)
143143
displayName: 'Build OpenVINO Contrib'

modules/custom_operations/user_ie_extensions/tokenizer/CMakeLists.txt

+15-7
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL ON)
1818
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$")
1919
set(c_cxx_flags "-Wno-undef")
2020
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
21+
# C4146: unary minus operator applied to unsigned type, result still unsigned
2122
# C4244: 'argument' : conversion from 'type1' to 'type2', possible loss of data
2223
# C4267: 'var' : conversion from 'size_t' to 'type', possible loss of data
23-
set(c_cxx_flags "/wd4244 /wd4267")
24-
# for fast tokenizers
25-
set(c_cxx_flags "${c_cxx_flags} /wd4146 /wd4700")
24+
# C4700: uninitialized local variable 'var' used
25+
set(c_cxx_flags "/wd4146 /wd4244 /wd4267 /wd4700")
2626
endif()
2727

2828
include(CheckCXXCompilerFlag)
@@ -34,6 +34,10 @@ endif()
3434
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${cxx_flags} ${c_cxx_flags}")
3535
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${c_cxx_flags}")
3636

37+
# Apply for 'Release' explicitly for WA '/sdl' issues
38+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${cxx_flags} ${c_cxx_flags}")
39+
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${c_cxx_flags}")
40+
3741
#
3842
# Dependencies
3943
#
@@ -61,7 +65,10 @@ if(BUILD_FAST_TOKENIZERS)
6165
fast_tokenizer
6266
)
6367
set(WITH_PYTHON OFF CACHE BOOL "Disable Python API for fast_tokenizer")
64-
add_subdirectory(${fast_tokenizer_SOURCE_DIR}/fast_tokenizer ${CMAKE_CURRENT_BINARY_DIR}/fast_tokenizer)
68+
add_subdirectory(${fast_tokenizer_SOURCE_DIR}/fast_tokenizer
69+
${CMAKE_CURRENT_BINARY_DIR}/fast_tokenizer
70+
EXCLUDE_FROM_ALL
71+
)
6572
endif()
6673

6774
# variables used later
@@ -147,9 +154,10 @@ endif()
147154
target_link_libraries(${TARGET_NAME} PRIVATE ${FAST_TOKENIZER_LIBS} sentencepiece-static)
148155

149156
# string_view is used from cxx17
150-
string(REPLACE " " ";" cxx_flags "${cxx_flags}")
151-
set_target_properties(${TARGET_NAME} PROPERTIES CXX_STANDARD 17
152-
COMPILE_OPTIONS "${cxx_flags}")
157+
set_target_properties(${TARGET_NAME} PROPERTIES CXX_STANDARD 17)
158+
159+
string(REPLACE " " ";" extra_flags "${c_cxx_flags} ${cxx_flags}")
160+
set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_OPTIONS "${extra_flags}")
153161

154162
#
155163
# Post build steps to copy core_tokenizers dependencies

modules/custom_operations/user_ie_extensions/tokenizer/bpe_tokenizer.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class BPETokenizer : public ov::op::Op {
5858

5959
bool evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const override;
6060

61-
bool has_evaluate() const {
61+
bool has_evaluate() const override {
6262
return true;
6363
}
6464

modules/custom_operations/user_ie_extensions/tokenizer/bytes_to_chars.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class BytesToChars : public ov::op::Op {
3232

3333
bool evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const override;
3434

35-
bool has_evaluate() const {
35+
bool has_evaluate() const override {
3636
return true;
3737
}
3838

modules/custom_operations/user_ie_extensions/tokenizer/case_fold.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CaseFold : public ov::op::Op {
2828

2929
bool evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const override;
3030

31-
bool has_evaluate() const {
31+
bool has_evaluate() const override {
3232
return true;
3333
}
3434
};

modules/custom_operations/user_ie_extensions/tokenizer/chars_to_bytes.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class CharsToBytes : public ov::op::Op {
2929

3030
bool evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const override;
3131

32-
bool has_evaluate() const {
32+
bool has_evaluate() const override {
3333
return true;
3434
}
3535

modules/custom_operations/user_ie_extensions/tokenizer/combine_segments.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class CombineSegments : public ov::op::Op {
2929

3030
bool evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const override;
3131

32-
bool has_evaluate() const {
32+
bool has_evaluate() const override {
3333
return true;
3434
}
3535
};

modules/custom_operations/user_ie_extensions/tokenizer/normalize_unicode.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class NormalizeUnicode : public ov::op::Op {
3131

3232
bool evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const override;
3333

34-
bool has_evaluate() const {
34+
bool has_evaluate() const override {
3535
return true;
3636
}
3737

modules/custom_operations/user_ie_extensions/tokenizer/ragged_tensor_pack.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class RaggedTensorPack : public ov::op::Op {
3030
return true;
3131
}
3232

33-
bool has_evaluate() const {
33+
bool has_evaluate() const override {
3434
return true;
3535
}
3636

37-
bool evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const;
37+
bool evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const override;
3838
};

modules/custom_operations/user_ie_extensions/tokenizer/ragged_to_dense.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class RaggedToDense : public ov::op::Op {
3030

3131
bool evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const override;
3232

33-
bool has_evaluate() const {
33+
bool has_evaluate() const override {
3434
return true;
3535
}
3636
};

modules/custom_operations/user_ie_extensions/tokenizer/regex_normalization.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class RegexNormalization : public ov::op::Op {
3737

3838
bool evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const override;
3939

40-
bool has_evaluate() const {
40+
bool has_evaluate() const override {
4141
return true;
4242
}
4343
private:

modules/custom_operations/user_ie_extensions/tokenizer/regex_split.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class RegexSplit : public ov::op::Op {
3939

4040
bool evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const override;
4141

42-
bool has_evaluate() const {
42+
bool has_evaluate() const override {
4343
return true;
4444
}
4545

modules/custom_operations/user_ie_extensions/tokenizer/string_tensor_pack.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ class StringTensorPack : public ov::op::Op {
3131
return true;
3232
}
3333

34-
bool has_evaluate() const {
34+
bool has_evaluate() const override {
3535
return true;
3636
}
3737

38-
bool evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const;
38+
bool evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const override;
3939

4040
private:
4141

modules/custom_operations/user_ie_extensions/tokenizer/string_tensor_unpack.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ class StringTensorUnpack : public ov::op::Op {
3737
return true;
3838
}
3939

40-
bool has_evaluate() const {
40+
bool has_evaluate() const override {
4141
return true;
4242
}
4343

44-
bool evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const;
44+
bool evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const override;
4545

4646
private:
4747

modules/custom_operations/user_ie_extensions/tokenizer/vocab_decoder.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class VocabDecoder : public ov::op::Op {
2929

3030
bool evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const override;
3131

32-
bool has_evaluate() const {
32+
bool has_evaluate() const override {
3333
return true;
3434
}
3535
};

modules/custom_operations/user_ie_extensions/tokenizer/wordpiece_tokenizer.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class WordpieceTokenizer : public ov::op::Op {
4646

4747
bool evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const override;
4848

49-
bool has_evaluate() const {
49+
bool has_evaluate() const override {
5050
return true;
5151
}
5252

0 commit comments

Comments
 (0)