Skip to content

Commit

Permalink
[CUSTOM_OP][JAVA_API] Fixed custom_ops build without OV build, update…
Browse files Browse the repository at this point in the history
…d Torch version, fixed Java build and tests
  • Loading branch information
likholat committed Nov 8, 2023
1 parent fa66500 commit 053fe6e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
6 changes: 3 additions & 3 deletions modules/custom_operations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ The C++ code implementing the custom operation is in the `user_ie_extensions` di
2. Build the library:

```bash
cd user_ie_extensions
cd openvino_contrib/modules/custom_operations
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release && cmake --build . --parallel 4
cmake ../user_ie_extensions -DCMAKE_BUILD_TYPE=Release && cmake --build . --parallel 4
```

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

- 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.
Expand Down
5 changes: 3 additions & 2 deletions modules/custom_operations/tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
torch==1.13.1
# open3d==0.16.0 - need to update with new release
torch
onnx
tensorboard
pytest
# open3d==0.16.0 - need to update with new release
8 changes: 8 additions & 0 deletions modules/custom_operations/user_ie_extensions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
# SPDX-License-Identifier: Apache-2.0
#

if(POLICY CMP0079)
cmake_policy(SET CMP0079 NEW)
endif()

if(POLICY CMP0057)
cmake_policy(SET CMP0057 NEW)
endif()

set(TARGET_NAME "user_ov_extensions")

set(CMAKE_CXX_STANDARD 11)
Expand Down
6 changes: 3 additions & 3 deletions modules/java_api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${JNI_INCLUDE_DIRS})
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp)

install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT java_api
ARCHIVE DESTINATION ${IE_CPACK_ARCHIVE_PATH} COMPONENT java_api
LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT java_api)
RUNTIME DESTINATION ${OV_CPACK_RUNTIMEDIR} COMPONENT java_api
ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT java_api
LIBRARY DESTINATION ${OV_CPACK_LIBRARYDIR} COMPONENT java_api)
2 changes: 1 addition & 1 deletion modules/java_api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ println 'CPU architecture: ' + arch


def nativesCPP;
def openvinoVersion = "2023.0"
def openvinoVersion = "2023.2"

def native_resources = []
def tbb_dir = System.getenv('TBB_DIR')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void testWrongElementType() {
}
assertTrue(
exceptionMessage.contains(
"[ PARAMETER_MISMATCH ] Failed to set input blob with precision: FP32, if"
+ " CNNNetwork input blob precision is: U8"));
"[ PARAMETER_MISMATCH ] Failed to set input tensor with precision: f32,"
+ " since the model input tensor precision is: u8"));
}
}

0 comments on commit 053fe6e

Please sign in to comment.