Skip to content

Commit b52c359

Browse files
njzjz-botnjzjz
andauthored
test(api): add universal DeepPot C/C++ API tests (deepmodeling#5538)
Problem - Issue deepmodeling#3905 asks for universal C/C++ API coverage instead of one-off backend-specific DeepPot tests. - A first pass should stay focused and avoid rewriting the existing large API test suite. Change - Add shared reference data for the common DeepPot water fixture. - Add parameterized C++ API tests for metadata and atomic inference across TensorFlow, PyTorch, PT-Expt, JAX, and Paddle when those backends/artifacts are available. - Add matching C API tests using `DP_DeepPotCompute2` / `DP_DeepPotComputef2` and link torch in the C test target so PT-Expt guards are detected consistently. - After deepmodeling#5544 fixed PyTorch type-map separators, require exact type-map metadata again and tighten the remaining PyTorch DeepTensor type-map test similarly. Verification - `uvx pre-commit run --files source/api_c/tests/CMakeLists.txt source/api_c/tests/test_deeppot_universal.cc source/api_cc/tests/test_deeppot_universal.cc source/tests/infer/deeppot_universal_data.h source/api_c/tests/test_deeppot_a_ptexpt.cc source/api_cc/tests/test_deepdipole_pt.cc` - Local full CTest was not run because this workspace does not have a C++ backend dependency installed; the new tests skip unavailable backend artifacts and should be exercised by the existing C++ test job after generated models are prepared. Refs deepmodeling#3905 Authored by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.5) --------- Co-authored-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
1 parent dae86a9 commit b52c359

34 files changed

Lines changed: 3002 additions & 10099 deletions

source/api_c/tests/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ if(ENABLE_TENSORFLOW)
1616
endif()
1717
if(ENABLE_PYTORCH)
1818
target_compile_definitions(runUnitTests_c PRIVATE BUILD_PYTORCH)
19+
# Link torch so __has_include(<torch/csrc/inductor/...>) succeeds and
20+
# BUILD_PT_EXPT is set for the test binary; otherwise pt_expt tests all
21+
# GTEST_SKIP() with "PyTorch support is not enabled".
22+
target_link_libraries(runUnitTests_c PRIVATE "${TORCH_LIBRARIES}")
1923
endif()
2024
if(ENABLE_JAX)
2125
target_compile_definitions(runUnitTests_c PRIVATE BUILD_JAX)

source/api_c/tests/test_deeppot_a.cc

Lines changed: 0 additions & 355 deletions
This file was deleted.

0 commit comments

Comments
 (0)