Skip to content

Commit 576f62d

Browse files
authored
[CUSTOM_OP][JAVA_API] Fixed custom_ops build without OV build, updated Torch version, fixed Java build and tests (openvinotoolkit#756)
1 parent fa66500 commit 576f62d

File tree

6 files changed

+20
-11
lines changed

6 files changed

+20
-11
lines changed

modules/custom_operations/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ The C++ code implementing the custom operation is in the `user_ie_extensions` di
3434
2. Build the library:
3535

3636
```bash
37-
cd user_ie_extensions
37+
cd openvino_contrib/modules/custom_operations
3838
mkdir build && cd build
39-
cmake .. -DCMAKE_BUILD_TYPE=Release && cmake --build . --parallel 4
39+
cmake ../user_ie_extensions -DCMAKE_BUILD_TYPE=Release && cmake --build . --parallel 4
4040
```
4141

4242
If you need to build only some operations specify them with the `-DCUSTOM_OPERATIONS` option:
4343
```bash
44-
cmake .. -DCMAKE_BUILD_TYPE=Release -DCUSTOM_OPERATIONS="complex_mul;fft"
44+
cmake ../user_ie_extensions -DCMAKE_BUILD_TYPE=Release -DCUSTOM_OPERATIONS="complex_mul;fft"
4545
```
4646

4747
- Please note that [OpenCV](https://opencv.org/) installation is required to build an extension for the [fft](examples/fft) operation. Other extentions still can be built without OpenCV.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
torch==1.13.1
2-
# open3d==0.16.0 - need to update with new release
1+
torch
2+
onnx
33
tensorboard
44
pytest
5+
# open3d==0.16.0 - need to update with new release

modules/custom_operations/user_ie_extensions/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

5+
if(POLICY CMP0079)
6+
cmake_policy(SET CMP0079 NEW)
7+
endif()
8+
9+
if(POLICY CMP0057)
10+
cmake_policy(SET CMP0057 NEW)
11+
endif()
12+
513
set(TARGET_NAME "user_ov_extensions")
614

715
set(CMAKE_CXX_STANDARD 11)

modules/java_api/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${JNI_INCLUDE_DIRS})
3232
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp)
3333

3434
install(TARGETS ${PROJECT_NAME}
35-
RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT java_api
36-
ARCHIVE DESTINATION ${IE_CPACK_ARCHIVE_PATH} COMPONENT java_api
37-
LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT java_api)
35+
RUNTIME DESTINATION ${OV_CPACK_RUNTIMEDIR} COMPONENT java_api
36+
ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT java_api
37+
LIBRARY DESTINATION ${OV_CPACK_LIBRARYDIR} COMPONENT java_api)

modules/java_api/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ println 'CPU architecture: ' + arch
1111

1212

1313
def nativesCPP;
14-
def openvinoVersion = "2023.0"
14+
def openvinoVersion = "2023.2"
1515

1616
def native_resources = []
1717
def tbb_dir = System.getenv('TBB_DIR')

modules/java_api/src/test/java/org/intel/openvino/PrePostProcessorTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void testWrongElementType() {
7777
}
7878
assertTrue(
7979
exceptionMessage.contains(
80-
"[ PARAMETER_MISMATCH ] Failed to set input blob with precision: FP32, if"
81-
+ " CNNNetwork input blob precision is: U8"));
80+
"[ PARAMETER_MISMATCH ] Failed to set input tensor with precision: f32,"
81+
+ " since the model input tensor precision is: u8"));
8282
}
8383
}

0 commit comments

Comments
 (0)