Skip to content

Commit 84bb325

Browse files
authored
feat(tensor): implement all TensorOp kernels (214/214 passing) (#40)
1 parent af67551 commit 84bb325

4 files changed

Lines changed: 1742 additions & 78 deletions

File tree

.github/workflows/conformance.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,35 @@ jobs:
608608
export VX_TEST_DATA_PATH=${{ github.workspace }}/OpenVX-cts/test_data/
609609
timeout 300 ./bin/vx_test_conformance --filter="BilateralFilter.*"
610610
611+
# Tensor ops — 226 tests (Tensor 12 + TensorOp 214), separated to keep
612+
# each CI job focused and avoid state leakage with other categories.
613+
tensor-ops:
614+
name: "tensor-ops"
615+
runs-on: ubuntu-22.04
616+
needs: build
617+
steps:
618+
- uses: actions/checkout@v4
619+
with:
620+
submodules: recursive
621+
- name: Download build artifacts
622+
uses: actions/download-artifact@v4
623+
with:
624+
name: build-artifacts
625+
- name: Run Tensor tests
626+
run: |
627+
chmod +x OpenVX-cts/build/bin/vx_test_conformance
628+
cd OpenVX-cts/build
629+
export LD_LIBRARY_PATH=${{ github.workspace }}/target/release
630+
export VX_TEST_DATA_PATH=${{ github.workspace }}/OpenVX-cts/test_data/
631+
timeout 300 ./bin/vx_test_conformance --filter="Tensor.*"
632+
- name: Run TensorOp tests
633+
run: |
634+
chmod +x OpenVX-cts/build/bin/vx_test_conformance
635+
cd OpenVX-cts/build
636+
export LD_LIBRARY_PATH=${{ github.workspace }}/target/release
637+
export VX_TEST_DATA_PATH=${{ github.workspace }}/OpenVX-cts/test_data/
638+
timeout 600 ./bin/vx_test_conformance --filter="TensorOp.*"
639+
611640
# Performance benchmark using openvx-mark, comparing rustVX against the
612641
# Khronos OpenVX sample implementation on the SAME runner so the two
613642
# numbers come from identical hardware. This job does NOT rebuild either

openvx-core/src/c_api.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,14 @@ fn register_standard_kernels(context_id: u32) {
366366
("org.khronos.openvx.weighted_average", 0x40, 4),
367367
// OpenVX 1.1 extensions
368368
("org.khronos.openvx.sobel_5x5", 0x30, 3),
369+
// Tensor operations (Enhanced Vision)
370+
("org.khronos.openvx.tensor_add", 0x41, 4),
371+
("org.khronos.openvx.tensor_subtract", 0x42, 4),
372+
("org.khronos.openvx.tensor_multiply", 0x43, 6),
373+
("org.khronos.openvx.tensor_convert_depth", 0x44, 5),
374+
("org.khronos.openvx.tensor_tablelookup", 0x45, 3),
375+
("org.khronos.openvx.tensor_transpose", 0x46, 4),
376+
("org.khronos.openvx.tensor_matrix_multiply", 0x47, 5),
369377
];
370378

371379
if let Ok(mut kernels) = KERNELS.lock() {

0 commit comments

Comments
 (0)