├── .gitattributes ├── .gitignore ├── .gitlab-ci.yml ├── .gitmodules ├── .travis.yml ├── Android.mk ├── BUILD_DEFINES ├── Build.py ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── LICENSE ├── Makefile ├── NEWKERNEL.txt ├── README.md ├── VERSION ├── cmake_utils ├── CMakeFuncs.txt ├── CMake_android_tools.cmake ├── CMake_linux_tools.cmake ├── CMake_windows_tools.cmake └── FindOpenCL.cmake ├── concerto ├── combo.mak ├── combo_filters.mak ├── compilers │ ├── cl.mak │ ├── clang.mak │ ├── gcc.mak │ ├── java.mak │ └── rvct.mak ├── components │ ├── opencl.mak │ └── openmp.mak ├── definitions.mak ├── finale.mak ├── machine.mak ├── os.mak ├── os │ ├── posix.mak │ └── windows.mak ├── platform.mak ├── prelude.mak ├── rules.mak ├── scm.mak ├── shell.mak ├── target.mak └── tools │ ├── doxygen.mak │ ├── dpkg.mak │ ├── latex.mak │ ├── notuglydot.xsl │ └── tar.mak ├── debug ├── Android.mk ├── CMakeLists.txt ├── concerto.mak ├── vx_debug.c └── vx_debug.h ├── examples ├── Android.mk ├── CMakeLists.txt ├── concerto.mak ├── vx_arrayrange.c ├── vx_callback.c ├── vx_convolution.c ├── vx_delaygraph.c ├── vx_examples.h ├── vx_extensions.c ├── vx_eyetrack.c ├── vx_factory_corners.c ├── vx_factory_edge.c ├── vx_factory_pipeline.c ├── vx_graph_factory.c ├── vx_graph_factory.h ├── vx_imagepatch.c ├── vx_independent.c ├── vx_introspection.c ├── vx_kernels.c ├── vx_matrix_access.c ├── vx_multi_node_graph.c ├── vx_parameters.c ├── vx_single_node_graph.c ├── vx_super_res.c ├── vx_tiling_add.c ├── vx_tiling_alpha.c ├── vx_tiling_box.c ├── vx_tiling_ext.c ├── vx_tiling_ext.h ├── vx_tiling_gaussian.c ├── vx_tiling_main.c ├── vx_warps.c ├── vx_xyz_lib.c ├── vx_xyz_module.c └── xyz.def ├── helper ├── Android.mk ├── CMakeLists.txt ├── concerto.mak └── vx_helper.c ├── include ├── CMakeLists.txt ├── VX │ ├── vx_helper.h │ ├── vx_khr_dot.h │ ├── vx_khr_interp.h │ ├── vx_khr_opencl.h │ ├── vx_lib_debug.h │ ├── vx_lib_extras.h │ └── vx_lib_xyz.h ├── concerto.mak └── windows │ └── stdint.h ├── kernels ├── Android.mk ├── CMakeLists.txt ├── README ├── c_model │ ├── Android.mk │ ├── CMakeLists.txt │ ├── c_absdiff.c │ ├── c_accumulate.c │ ├── c_addsub.c │ ├── c_bilateral_filter.c │ ├── c_bitwise.c │ ├── c_channel.c │ ├── c_controlflow.c │ ├── c_conv3x3.c │ ├── c_convertcolor.c │ ├── c_convertdepth.c │ ├── c_convolve.c │ ├── c_copy.c │ ├── c_fast9.c │ ├── c_filter.c │ ├── c_histogram.c │ ├── c_hog.c │ ├── c_houghlinesp.c │ ├── c_integralimage.c │ ├── c_khr_nn.c │ ├── c_lbp.c │ ├── c_lut.c │ ├── c_magnitude.c │ ├── c_matchtemplate.c │ ├── c_minmax.c │ ├── c_model.h │ ├── c_morphology.c │ ├── c_multiply.c │ ├── c_nonlinearfilter.c │ ├── c_nonmaxsuppression.c │ ├── c_optpyrlk.c │ ├── c_phase.c │ ├── c_scale.c │ ├── c_sobel3x3.c │ ├── c_statistics.c │ ├── c_tensor_lut.c │ ├── c_tensor_multiply_matrix.c │ ├── c_tensor_op.c │ ├── c_tensor_transpose.c │ ├── c_threshold.c │ ├── c_warp.c │ ├── c_weighted_average.c │ ├── concerto.mak │ └── template ├── debug │ ├── Android.mk │ ├── CMakeLists.txt │ ├── concerto.mak │ ├── d_copy.c │ ├── d_file.c │ └── debug_k.h ├── extras │ ├── CMakeLists.txt │ ├── concerto.mak │ ├── e_filter.c │ ├── e_nonmax.c │ └── extras_k.h ├── opencl │ ├── vx_absdiff.cl │ ├── vx_and.cl │ ├── vx_box3x3.cl │ ├── vx_convolve.cl │ ├── vx_dilate3x3.cl │ ├── vx_erode3x3.cl │ ├── vx_gaussian3x3.cl │ ├── vx_median3x3.cl │ ├── vx_nonlinearfilter.cl │ ├── vx_not.cl │ ├── vx_orr.cl │ ├── vx_phase.cl │ ├── vx_sobel3x3.cl │ ├── vx_threshold.cl │ ├── vx_warp_affine.cl │ ├── vx_warp_perspective.cl │ └── vx_xor.cl ├── tiling │ ├── CMakeLists.txt │ ├── tiling.h │ ├── tiling_absdiff.c │ ├── tiling_addsub.c │ ├── tiling_bitwise.c │ ├── tiling_channel.c │ ├── tiling_convertcolor.c │ ├── tiling_convertdepth.c │ ├── tiling_convolve.c │ ├── tiling_fast9.c │ ├── tiling_filter.c │ ├── tiling_hog.c │ ├── tiling_houghlinesp.c │ ├── tiling_integralimage.c │ ├── tiling_lbp.c │ ├── tiling_lut.c │ ├── tiling_magnitude.c │ ├── tiling_minmax.c │ ├── tiling_morphology.c │ ├── tiling_multiply.c │ ├── tiling_nonlinearfilter.c │ ├── tiling_nonmaxsuppression.c │ ├── tiling_phase.c │ ├── tiling_scale.c │ ├── tiling_sobel3x3.c │ ├── tiling_threshold.c │ ├── tiling_warp.c │ └── tiling_weighted_average.c └── venum │ ├── CMakeLists.txt │ ├── venum.h │ ├── venum_absdiff.c │ ├── venum_addsub.c │ ├── venum_bilateral_filter.c │ ├── venum_bitwise.c │ ├── venum_channel.c │ ├── venum_convertcolor.c │ ├── venum_convertdepth.c │ ├── venum_convolve.c │ ├── venum_copy.c │ ├── venum_fast9.c │ ├── venum_filter.c │ ├── venum_gaussian5x5.c │ ├── venum_histogram.c │ ├── venum_hog.c │ ├── venum_houghlinesp.c │ ├── venum_integralimage.c │ ├── venum_lbp.c │ ├── venum_lut.c │ ├── venum_magnitude.c │ ├── venum_matchtemplate.c │ ├── venum_minmax.c │ ├── venum_morphology.c │ ├── venum_multiply.c │ ├── venum_nonlinearfilter.c │ ├── venum_nonmaxsuppression.c │ ├── venum_phase.c │ ├── venum_scale.c │ ├── venum_sobel3x3.c │ ├── venum_statistics.c │ ├── venum_tensor_lut.c │ ├── venum_tensor_multiply_matrix.c │ ├── venum_tensor_op.c │ ├── venum_tensor_transpose.c │ ├── venum_threshold.c │ ├── venum_warp.c │ └── venum_weighted_average.c ├── libraries ├── Android.mk ├── CMakeLists.txt ├── debug │ ├── Android.mk │ ├── CMakeLists.txt │ ├── concerto.mak │ ├── openvx-debug.def │ ├── vx_check.c │ ├── vx_compare.c │ ├── vx_copy.c │ ├── vx_debug_lib.c │ ├── vx_debug_module.c │ ├── vx_debug_module.h │ ├── vx_file.c │ └── vx_fill.c └── extras │ ├── Android.mk │ ├── CMakeLists.txt │ ├── concerto.mak │ ├── openvx-extras.def │ ├── vx_edge_trace.c │ ├── vx_extras_lib.c │ ├── vx_extras_module.c │ ├── vx_extras_module.h │ ├── vx_filter.c │ ├── vx_gradients.c │ ├── vx_harris_score.c │ ├── vx_listers.c │ ├── vx_nonmax.c │ └── vx_norm.c ├── raw ├── bikegray_640x480.pgm ├── colorbars_640x480_I444.rgb ├── lena_512x512.pgm ├── shapes.pgm ├── superresFirst_3072x2048_UYVY.yuv ├── superresSecond_3072x2048_UYVY.yuv └── test.xml ├── sample ├── Android.mk ├── CMakeLists.txt ├── application │ ├── Android.mk │ ├── AndroidManifest.xml │ ├── default.properties │ ├── procfg.txt │ ├── res │ │ ├── drawable │ │ │ └── app_logo.png │ │ ├── layout-land │ │ │ └── skeleton_activity.xml │ │ ├── layout │ │ │ └── skeleton_activity.xml │ │ ├── menu │ │ │ └── app_menu.xml │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ └── src │ │ └── org │ │ └── khronos │ │ └── openvx │ │ └── examples │ │ └── OpenVXActivity.java ├── cnn │ ├── CMakeLists.txt │ ├── cnn_convert │ │ ├── CMakeLists.txt │ │ └── cnn_convert.cpp │ ├── cnn_network │ │ ├── CMakeLists.txt │ │ ├── cnn_network.def │ │ ├── network.cpp │ │ └── network.h │ ├── cnn_test │ │ ├── CMakeLists.txt │ │ └── test.cpp │ └── resources │ │ ├── 0001.JPEG │ │ ├── 0003 │ │ ├── 0003.JPEG │ │ ├── README.txt │ │ ├── alexnet_mean_q8 │ │ ├── alexnet_weights_q8_d442mw2 │ │ ├── hummingbird_227x227.q78 │ │ ├── imagenet_classes.txt │ │ ├── imagenet_classes_alexnet.txt │ │ └── test_result.txt ├── concerto.mak ├── framework │ ├── Android.mk │ ├── CMakeLists.txt │ ├── concerto.mak │ ├── openvx.def │ ├── vx_array.c │ ├── vx_context.c │ ├── vx_convolution.c │ ├── vx_delay.c │ ├── vx_distribution.c │ ├── vx_dot.c │ ├── vx_error.c │ ├── vx_event_queue.c │ ├── vx_graph.c │ ├── vx_graph_pipeline.c │ ├── vx_graph_stream.c │ ├── vx_image.c │ ├── vx_import.c │ ├── vx_ix_export.c │ ├── vx_ix_format.txt │ ├── vx_ix_import.c │ ├── vx_kernel.c │ ├── vx_khr_import_kernel.c │ ├── vx_khr_user_data_object.c │ ├── vx_log.c │ ├── vx_lut.c │ ├── vx_matrix.c │ ├── vx_memory.c │ ├── vx_meta_format.c │ ├── vx_node.c │ ├── vx_node_api.c │ ├── vx_node_nn_api.c │ ├── vx_object_array.c │ ├── vx_osal.c │ ├── vx_parameter.c │ ├── vx_pyramid.c │ ├── vx_reference.c │ ├── vx_remap.c │ ├── vx_scalar.c │ ├── vx_target.c │ ├── vx_tensor.c │ ├── vx_threshold.c │ ├── vx_type_pairs.c │ ├── vx_xml_export.c │ └── vx_xml_import.c ├── include │ ├── CMakeLists.txt │ ├── vx_array.h │ ├── vx_context.h │ ├── vx_convolution.h │ ├── vx_delay.h │ ├── vx_distribution.h │ ├── vx_error.h │ ├── vx_graph.h │ ├── vx_image.h │ ├── vx_import.h │ ├── vx_inlines.c │ ├── vx_internal.h │ ├── vx_kernel.h │ ├── vx_log.h │ ├── vx_lut.h │ ├── vx_matrix.h │ ├── vx_memory.h │ ├── vx_meta_format.h │ ├── vx_node.h │ ├── vx_object_array.h │ ├── vx_osal.h │ ├── vx_parameter.h │ ├── vx_pyramid.h │ ├── vx_reference.h │ ├── vx_remap.h │ ├── vx_sample.h │ ├── vx_scalar.h │ ├── vx_target.h │ ├── vx_tensor.h │ ├── vx_threshold.h │ └── vx_type_pairs.h ├── package │ ├── concerto.mak │ └── control ├── targets │ ├── CMakeLists.txt │ ├── c_model │ │ ├── Android.mk │ │ ├── CMakeLists.txt │ │ ├── concerto.mak │ │ ├── openvx-target.def │ │ ├── vx_absdiff.c │ │ ├── vx_accumulate.c │ │ ├── vx_addsub.c │ │ ├── vx_bilateral_filter.c │ │ ├── vx_bitwise.c │ │ ├── vx_canny.c │ │ ├── vx_channelcombine.c │ │ ├── vx_channelextract.c │ │ ├── vx_colorconvert.c │ │ ├── vx_controlflow.c │ │ ├── vx_convertdepth.c │ │ ├── vx_convolution.c │ │ ├── vx_copy.c │ │ ├── vx_fast9.c │ │ ├── vx_filter.c │ │ ├── vx_gradients.c │ │ ├── vx_harris.c │ │ ├── vx_histogram.c │ │ ├── vx_hog.c │ │ ├── vx_houghlinesP.c │ │ ├── vx_integralimage.c │ │ ├── vx_interface.c │ │ ├── vx_interface.h │ │ ├── vx_khr_nn.c │ │ ├── vx_lbp.c │ │ ├── vx_lut.c │ │ ├── vx_magnitude.c │ │ ├── vx_matchtemplate.c │ │ ├── vx_meanstddev.c │ │ ├── vx_minmax.c │ │ ├── vx_minmaxloc.c │ │ ├── vx_morphology.c │ │ ├── vx_multiply.c │ │ ├── vx_multiply_matrix.c │ │ ├── vx_nonlinearfilter.c │ │ ├── vx_nonmaxsuppression.c │ │ ├── vx_optpyrlk.c │ │ ├── vx_phase.c │ │ ├── vx_pyramid.c │ │ ├── vx_remap.c │ │ ├── vx_scale.c │ │ ├── vx_tensor_lut.c │ │ ├── vx_tensor_op.c │ │ ├── vx_tensor_transpose.c │ │ ├── vx_threshold.c │ │ ├── vx_warp.c │ │ └── vx_weighted_average.c │ ├── opencl │ │ ├── CMakeLists.txt │ │ ├── vx_absdiff.c │ │ ├── vx_bitwise.c │ │ ├── vx_convolution.c │ │ ├── vx_filter.c │ │ ├── vx_gradients.c │ │ ├── vx_interface.c │ │ ├── vx_interface.h │ │ ├── vx_morphology.c │ │ ├── vx_nonlinearfilter.c │ │ ├── vx_phase.c │ │ ├── vx_support.c │ │ ├── vx_support.h │ │ ├── vx_threshold.c │ │ └── vx_warp.c │ ├── tiling │ │ ├── CMakeLists.txt │ │ ├── openvx-target.def │ │ ├── vx_absdiff.c │ │ ├── vx_addsub.c │ │ ├── vx_bitwise.c │ │ ├── vx_channelcombine.c │ │ ├── vx_colorconvert.c │ │ ├── vx_convertdepth.c │ │ ├── vx_convolution.c │ │ ├── vx_fast9.c │ │ ├── vx_filter.c │ │ ├── vx_gradients.c │ │ ├── vx_hog.c │ │ ├── vx_houghlinesP.c │ │ ├── vx_integralimage.c │ │ ├── vx_interface.c │ │ ├── vx_interface.h │ │ ├── vx_lbp.c │ │ ├── vx_lut.c │ │ ├── vx_magnitude.c │ │ ├── vx_minmax.c │ │ ├── vx_morphology.c │ │ ├── vx_multiply.c │ │ ├── vx_nonlinearfilter.c │ │ ├── vx_nonmaxsuppression.c │ │ ├── vx_phase.c │ │ ├── vx_remap.c │ │ ├── vx_scale.c │ │ ├── vx_threshold.c │ │ ├── vx_warp.c │ │ └── vx_weighted_average.c │ └── venum │ │ ├── CMakeLists.txt │ │ ├── vx_absdiff.c │ │ ├── vx_addsub.c │ │ ├── vx_bilateral_filter.c │ │ ├── vx_bitwise.c │ │ ├── vx_channelcombine.c │ │ ├── vx_channelextract.c │ │ ├── vx_colorconvert.c │ │ ├── vx_convertdepth.c │ │ ├── vx_convolution.c │ │ ├── vx_copy.c │ │ ├── vx_fast9.c │ │ ├── vx_filter.c │ │ ├── vx_gradients.c │ │ ├── vx_harris.c │ │ ├── vx_histogram.c │ │ ├── vx_hog.c │ │ ├── vx_houghlinesP.c │ │ ├── vx_integralimage.c │ │ ├── vx_interface.c │ │ ├── vx_interface.h │ │ ├── vx_laplacianpyramid.c │ │ ├── vx_lbp.c │ │ ├── vx_lut.c │ │ ├── vx_magnitude.c │ │ ├── vx_matchtemplate.c │ │ ├── vx_meanstddev.c │ │ ├── vx_minmax.c │ │ ├── vx_minmaxloc.c │ │ ├── vx_morphology.c │ │ ├── vx_multiply.c │ │ ├── vx_multiply_matrix.c │ │ ├── vx_nonlinearfilter.c │ │ ├── vx_nonmaxsuppression.c │ │ ├── vx_optpyrlk.c │ │ ├── vx_phase.c │ │ ├── vx_pyramid.c │ │ ├── vx_remap.c │ │ ├── vx_scale.c │ │ ├── vx_tensor_lut.c │ │ ├── vx_tensor_op.c │ │ ├── vx_tensor_transpose.c │ │ ├── vx_threshold.c │ │ ├── vx_warp.c │ │ └── vx_weighted_average.c ├── tests │ ├── Android.mk │ ├── CMakeLists.txt │ ├── concerto.mak │ ├── vx_bug13510.c │ ├── vx_bug13517.c │ ├── vx_bug13518.c │ ├── vx_cam_test.c │ └── vx_test.c └── vxu │ ├── Android.mk │ ├── CMakeLists.txt │ ├── concerto.mak │ ├── vx_utility.c │ └── vx_utility.def ├── scripts ├── openvx-sc-req-backup.py ├── openvx-sc-req-remove.py ├── openvx-sc-req-restore.py ├── openvx-sc-req-update.py └── openvx.sh ├── tools ├── Android.mk ├── CMakeLists.txt ├── gredit │ ├── gredit.py │ ├── vxCodeWriter.py │ ├── vxGraph.py │ ├── vxKernel.py │ ├── vxNodeUtils.py │ ├── vxNodes.py │ ├── vxTypes.py │ ├── vxWriteNodeHeaders.py │ ├── vxXML2C.py │ └── vx_header.h ├── pgm2hdr │ ├── CMakeLists.txt │ ├── concerto.mak │ └── pgm2hdr.c └── query │ ├── Android.mk │ ├── CMakeLists.txt │ ├── concerto.mak │ └── vx_query.c └── utils ├── CMakeLists.txt ├── concerto.mak ├── conversion_utils.c ├── conversion_utils.h ├── half ├── CMakeLists.txt ├── half.hpp ├── sip_ml_fp16.cpp └── sip_ml_fp16.hpp ├── tensor_utils.c └── tensor_utils.h /.gitattributes: -------------------------------------------------------------------------------- 1 | raw/superresSecond_3072x2048_UYVY.yuv filter=lfs diff=lfs merge=lfs 2 | sample/cnn/resources/alexnet_weights_q8_d442mw2 filter=lfs diff=lfs merge=lfs 3 | raw/superresFirst_3072x2048_UYVY.yuv filter=lfs diff=lfs merge=lfs 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /build-cts 2 | /build 3 | /install 4 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "api-docs"] 2 | path = api-docs 3 | url = https://github.com/KhronosGroup/OpenVX-api-docs.git 4 | branch = openvx_1.3 5 | [submodule "cts"] 6 | path = cts 7 | url = https://github.com/KhronosGroup/OpenVX-cts.git 8 | branch = openvx_1.3 9 | [submodule "kernels/NNEF-Tools"] 10 | path = kernels/NNEF-Tools 11 | url = https://github.com/KhronosGroup/NNEF-Tools/ 12 | -------------------------------------------------------------------------------- /Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | ifeq ($(BOARD_USES_OPENVX),1) 20 | 21 | OPENVX_TOP := $(call my-dir) 22 | OPENVX_INC := $(OPENVX_TOP)/include 23 | OPENVX_DEFS:= -D_LITTLE_ENDIAN_ \ 24 | -DEXPERIMENTAL_USE_DOT 25 | OPENVX_SRC := sample 26 | OPENVX_DIRS := $(OPENVX_SRC) examples conformance helper debug libraries kernels tools 27 | $(foreach dir,$(OPENVX_DIRS),$(eval include $(OPENVX_TOP)/$(dir)/Android.mk)) 28 | 29 | endif 30 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | A reminder that this issue tracker is managed by the Khronos Group. Interactions here should follow the Khronos Code of Conduct ([https://www.khronos.org/developers/code-of-conduct](https://www.khronos.org/developers/code-of-conduct)), which prohibits aggressive or derogatory language. Please keep the discussion friendly and civil. 2 | -------------------------------------------------------------------------------- /NEWKERNEL.txt: -------------------------------------------------------------------------------- 1 | How to Add a New Kernel To the Sample Implementation: 2 | ======================================+++++++======== 3 | 4 | 1.) Add kernel \defgroup in vx_nodes.h. Describe kernel in detail. 5 | 6 | \defgroup group_kernel_xxxxxxx Kernel: XXXXXXX 7 | \brief A brief description of one sentence. 8 | \details A much longer description. Math equations are ok, see MathJax.org. 9 | 10 | 2.) Add vx Node prototype in include/VX/vx_nodes.h 11 | a.) add all doxygen tags 12 | b.) \ingroup group_kernel_xxxxxx 13 | c.) Add to sample/framework/openvx.def symbol export 14 | 3.) Add vxu function prototype in include/VX/vxu.h 15 | a.) add all doxygen tags 16 | b.) \ingroup group_kernel_xxxxxx 17 | c.) Add to sample/vxu/vx_utility.def symbol export 18 | 4.) Add kernel enum in include/VX/vx_kernels.h 19 | a.) The kernel enums can't be in the \ingroup as the whole enum are in their own group. 20 | Use \see or \ref. 21 | 5.) Add any external types needed (enums, etc) in include/VX/vx_types.h 22 | a.) These can also be in \ingroup group_kernel_xxxxxx 23 | 6.) Create file in sample/targets/c_model/ 24 | a.) vx_.c or vx_.c or vx_.c 25 | b.) write kernel 26 | c.) write input validator 27 | d.) write output validator 28 | e.) declare vx_param_description_t array 29 | f.) declare vx_kernel_description_t structure 30 | 1.) references Kernel, enum, stringname, input/output validators, parameter array. 31 | g.) extern the kernel table entry in sample/targets/c_model/vx_interface.h 32 | h.) reference kernel table in table list in sample/targets/c_model/vx_interface.c 33 | i.) Add filename to Android.mk (concerto.mak will automatically compile all the C files). 34 | 7.) Add Node declaration in sample/framework/vx_node_api.c 35 | 8.) Add vxu function (must use Single node Graph) in sample/vxu/vx_utility.c 36 | 9.) Either modify or add new unit test in sample/tests/vx_test.c 37 | a.) Use either Graph or Immediate mode 38 | 10.) Test until working. :) 39 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 1.3 2 | 3 | -------------------------------------------------------------------------------- /concerto/components/opencl.mak: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | # @author Erik Rainey 20 | # @url http://github.com/emrainey/Concerto 21 | 22 | ifeq ($(USE_OPENCL),true) 23 | OCL_LIB ?= OpenCL 24 | ifeq ($(HOST_OS),Windows_NT) 25 | ifeq ($(OPENCL_ROOT),) 26 | $(error OPENCL_ROOT must be defined to use OPENCL_ROOT) 27 | endif 28 | IDIRS += $(OPENCL_ROOT)/include $(OPENCL_ROOT)/inc 29 | LDIRS += $(OPENCL_ROOT)/lib $(OPENCL_ROOT)/lib64 30 | ifeq ($(filter $(PLATFORM_LIBS),$(OCL_LIB)),) 31 | PLATFORM_LIBS += $(OCL_LIB) 32 | endif 33 | else ifeq ($(HOST_OS),LINUX) 34 | # User should install GLUT/Mesa via package system 35 | ifneq ($(OPENCL_ROOT),) 36 | IDIRS += $(OPENCL_ROOT)/include $(OPENCL_ROOT)/inc 37 | LDIRS += $(OPENCL_ROOT)/lib $(OPENCL_ROOT)/lib64 38 | endif 39 | ifeq ($(filter $(PLATFORM_LIBS),$(OCL_LIB)),) 40 | PLATFORM_LIBS += $(OCL_LIB) 41 | endif 42 | else ifeq ($(HOST_OS),DARWIN) 43 | # User should have XCode install OpenCL 44 | $(_MODULE)_FRAMEWORKS += -framework OpenCL 45 | endif 46 | 47 | # OpenCL-Environment Defines 48 | ifeq ($(HOST_OS),CYGWIN) 49 | DEFS += KDIR="\"$(KDIR)\"" CL_USER_DEVICE_COUNT=$(CL_USER_DEVICE_COUNT) CL_USER_DEVICE_TYPE="\"$(CL_USER_DEVICE_TYPE)\"" 50 | else ifeq ($(HOST_OS),Windows_NT) 51 | DEFS += KDIR="$(call PATH_CONV,$(KDIR))\\" CL_USER_DEVICE_COUNT=$(CL_USER_DEVICE_COUNT) CL_USER_DEVICE_TYPE="$(CL_USER_DEVICE_TYPE)" 52 | else 53 | DEFS += KDIR="$(KDIR)" CL_USER_DEVICE_COUNT=$(CL_USER_DEVICE_COUNT) CL_USER_DEVICE_TYPE="$(CL_USER_DEVICE_TYPE)" $(if $(CL_DEBUG),CL_DEBUG=1) 54 | endif 55 | endif 56 | -------------------------------------------------------------------------------- /concerto/components/openmp.mak: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | # @author Erik Rainey 20 | # @url http://github.com/emrainey/Concerto 21 | 22 | ifeq ($(USE_OPENMP),true) 23 | ifeq ($(HOST_OS),LINUX) 24 | CFLAGS += -fopenmp 25 | SYS_SHARED_LIBS += gomp 26 | else ifeq ($(HOST_OS),DARWIN) 27 | # User should have XCode install OpenMP 28 | $(_MODULE)_FRAMEWORKS += -framework OpenMP 29 | endif 30 | endif 31 | -------------------------------------------------------------------------------- /concerto/definitions.mak: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | # @author Erik Rainey 20 | # @url http://github.com/emrainey/Concerto 21 | 22 | ifeq ($(HOST_OS),Windows_NT) 23 | # Always produce list using foward slashes 24 | all-type-files-in-this-a = $(subst \,/,$(subst $(_SDIR),,$(shell cmd.exe /C dir /b $(_SDIR)$(2)$(PATH_SEP)$(1)))) 25 | all-type-files-in-this = $(foreach kern,$(call all-type-files-in-this-a,$(1),$(2)),$(2)/$(kern)) 26 | else 27 | all-type-files-in-this = $(subst $(SDIR)/,,$(shell find $(SDIR)/$(2) -maxdepth 1 -name '$(1)')) 28 | endif 29 | all-type-files-in = $(notdir $(wildcard $(2)/$(1))) 30 | all-type-files = $(call all-type-files-in,$(1),$(SDIR)) 31 | all-java-files = $(call all-type-files,*.java) 32 | all-c-files = $(call all-type-files,*.c) 33 | all-cpp-files = $(call all-type-files,*.cpp) 34 | all-h-files = $(call all-type-files,*.h) 35 | all-S-files = $(call all-type-files,*.S) 36 | all-java-files-in = $(call all-type-files-in,*.java,$(1)) 37 | all-c-files-in = $(call all-type-files-in,*.c,$(1)) 38 | all-cpp-files-in = $(call all-type-files-in,*.cpp,$(1)) 39 | all-h-files-in = $(call all-type-files-in,*.h,$(1)) 40 | all-S-files-in = $(call all-type-files-in,*.S,$(1)) 41 | -------------------------------------------------------------------------------- /concerto/machine.mak: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | # @author Erik Rainey 20 | # @url http://github.com/emrainey/Concerto 21 | 22 | define MACHINE_variables 23 | ifneq ($(filter $($(1)_CPU),x86 X86 i386 i486 i586 i686),) 24 | HOST_PLATFORM=PC 25 | $(1)_FAMILY=X86 26 | $(1)_ARCH=32 27 | $(1)_ENDIAN=LITTLE 28 | else ifneq ($(filter $($(1)_CPU),Intel64 amd64 X64),) 29 | HOST_PLATFORM=PC 30 | $(1)_FAMILY=X64 31 | $(1)_ARCH=64 32 | $(1)_ENDIAN=LITTLE 33 | else ifeq ($($(1)__CPU),Power Macintosh) 34 | HOST_PLATFORM=PC 35 | $(1)_FAMILY=PPC 36 | $(1)_ARCH=32 37 | $(1)_ENDIAN=LITTLE 38 | else ifeq ($($(1)_CPU),x86_64) 39 | HOST_PLATFORM=PC 40 | $(1)_FAMILY=x86_64 41 | $(1)_ARCH=64 42 | $(1)_ENDIAN=LITTLE 43 | else ifneq ($(filter $($(1)_CPU),ARM M3 M4 A8 A8F A9 A9F A15 A15F armv7l),) 44 | ifeq ($(HOST_CPU),$($(1)_CPU)) 45 | HOST_PLATFORM=PANDA 46 | else 47 | HOST_PLATFORM=PC 48 | endif 49 | $(1)_FAMILY=ARM 50 | $(1)_ARCH=32 51 | $(1)_ENDIAN=LITTLE 52 | else ifneq ($(filter $($(1)_CPU),ARM64 aarch64 A53 A54 A57),) 53 | $(1)_FAMILY=ARM 54 | $(1)_ARCH=64 55 | $(1)_ENDIAN=LITTLE 56 | else ifneq ($(filter $($(1)_CPU),C6XSIM C64T C64P C64 C66 C674 C67 C67P),) 57 | HOST_PLATFORM=PC 58 | $(1)_FAMILY=DSP 59 | $(1)_ARCH=32 60 | $(1)_ENDIAN=LITTLE 61 | else ifeq ($($(1)_CPU),EVE) 62 | HOST_PLATFORM=PC 63 | $(1)_FAMILY=EVE 64 | $(1)_ARCH=32 65 | $(1)_ENDIAN=LITTLE 66 | endif 67 | endef 68 | 69 | 70 | ifeq ($(HOST_OS),Windows_NT) 71 | $(info Windows Processor Architecture $(PROCESSOR_ARCHITECTURE)) 72 | $(info Windows Processor Identification $(word 1, $(PROCESSOR_IDENTIFIER))) 73 | HOST_CPU=$(word 1, $(PROCESSOR_IDENTIFIER)) 74 | else 75 | HOST_CPU=$(shell uname -m) 76 | endif 77 | 78 | $(eval $(call MACHINE_variables,HOST)) 79 | 80 | -------------------------------------------------------------------------------- /concerto/platform.mak: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | # @author Erik Rainey 20 | # @url http://github.com/emrainey/Concerto 21 | 22 | ifeq ($(TARGET_OS),LINUX) 23 | PLATFORM_LIBS := dl pthread rt 24 | else ifeq ($(TARGET_OS),DARWIN) 25 | PLATFORM_LIBS := 26 | else ifeq ($(TARGET_OS),Windows_NT) 27 | PLATFORM_LIBS := Ws2_32 user32 kernel32 Gdi32 28 | else ifeq ($(TARGET_OS),__QNX__) 29 | PLATFORM_LIBS := screen socket 30 | else ifeq ($(TARGET_OS),CYGWIN) 31 | PLATFORM_LIBS := c pthread 32 | endif 33 | 34 | -------------------------------------------------------------------------------- /concerto/scm.mak: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | # @author Erik Rainey 20 | # @url http://github.com/emrainey/Concerto 21 | 22 | ifeq ($(SCM_ROOT),) 23 | # wildcard is required for windows since realpath doesn't return NULL if not found 24 | SCM_ROOT := $(wildcard $(realpath .svn)) 25 | ifneq ($(SCM_ROOT),) 26 | ifeq ($(SHOW_MAKEDEBUG),1) 27 | $(info $(SCM_ROOT)) 28 | $(info Subversion is used) 29 | endif 30 | SCM_VERSION := r$(word 2, $(shell svn info | grep Revision)) 31 | endif 32 | endif 33 | 34 | ifeq ($(SCM_ROOT),) 35 | # wildcard is required for windows since realpath doesn't return NULL if not found 36 | SCM_ROOT := $(wildcard $(realpath .git)) 37 | ifneq ($(SCM_ROOT),) 38 | ifeq ($(SHOW_MAKEDEBUG),1) 39 | $(info $(SCM_ROOT)) 40 | $(info GIT is used) 41 | endif 42 | git_status := $(shell git status) 43 | ifneq (,$(findstring Changes,$(git_status))) 44 | SCM_VERSION := $(shell git rev-parse --short HEAD)-dirty 45 | else 46 | SCM_VERSION := $(shell git rev-parse --short HEAD) 47 | endif 48 | # The following is in case git is not executable in the shell where the build is taking place (eg. DOS) 49 | ifeq ($(SCM_VERSION),) 50 | TEMP := $(lastword $(shell $(CAT) $(call PATH_CONV,"$(SCM_ROOT)/HEAD"))) 51 | SCM_VERSION := $(shell $(CAT) $(call PATH_CONV,"$(SCM_ROOT)/$(TEMP)")) 52 | endif 53 | endif 54 | endif 55 | 56 | -------------------------------------------------------------------------------- /concerto/shell.mak: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | # @author Erik Rainey 20 | # @url http://github.com/emrainey/Concerto 21 | 22 | ifeq ($(HOST_OS),Windows_NT) # cmd.exe 23 | CLEAN := del /Q 24 | CLEANDIR := rmdir /Q /S 25 | COPY := copy /Y /Z /V 26 | PRINT := @echo 27 | SET_RW := attrib -R 28 | SET_EXEC := echo 29 | LINK := junction 30 | TOUCH := type NUL > 31 | INSTALL := copy /Y /Z /V 32 | MKDIR := mkdir 33 | CAT := type 34 | QUIET := 2>NUL 35 | else # Bash variants 36 | CLEAN := rm -f 37 | CLEANDIR := rm -rf 38 | COPY := cp -f 39 | PRINT := @echo 40 | SET_RW := chmod a+rw 41 | SET_EXEC := chmod a+x 42 | LINK := ln -s -f 43 | TOUCH := touch 44 | INSTALL := install -C -m 755 45 | MKDIR := mkdir -p 46 | CAT := cat 47 | QUIET := > /dev/null 48 | endif 49 | 50 | -------------------------------------------------------------------------------- /debug/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | LOCAL_PATH := $(call my-dir) 20 | 21 | include $(CLEAR_VARS) 22 | LOCAL_MODULE_TAGS := optional 23 | LOCAL_PRELINK_MODULE := false 24 | LOCAL_ARM_MODE := arm 25 | LOCAL_CFLAGS := $(OPENVX_DEFS) 26 | LOCAL_SRC_FILES := vx_debug.c 27 | LOCAL_C_INCLUDES := $(OPENVX_INC) $(OPENVX_TOP)/debug 28 | LOCAL_MODULE := libopenvx-debug 29 | include $(BUILD_STATIC_LIBRARY) -------------------------------------------------------------------------------- /debug/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2011-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | # set target name 20 | set( TARGET_NAME vx_debug ) 21 | 22 | include_directories( BEFORE 23 | ${CMAKE_CURRENT_SOURCE_DIR} 24 | ${VX_HEADER_DIR} 25 | ) 26 | 27 | FIND_SOURCES() 28 | 29 | # add a target named ${TARGET_NAME} 30 | add_library (${TARGET_NAME} ${SOURCE_FILES}) 31 | 32 | install ( TARGETS ${TARGET_NAME} 33 | RUNTIME DESTINATION bin 34 | ARCHIVE DESTINATION bin 35 | LIBRARY DESTINATION bin ) 36 | 37 | set_target_properties( ${TARGET_NAME} PROPERTIES FOLDER ${DEBUG_FOLDER} ) 38 | -------------------------------------------------------------------------------- /debug/concerto.mak: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | include $(PRELUDE) 20 | TARGET := vx_debug 21 | TARGETTYPE := library 22 | CSOURCES := $(call all-c-files) 23 | IDIRS := $(HOST_ROOT)/$(OPENVX_SRC)/include 24 | include $(FINALE) -------------------------------------------------------------------------------- /examples/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | LOCAL_PATH := $(call my-dir) 20 | 21 | include $(CLEAR_VARS) 22 | LOCAL_MODULE_TAGS := optional 23 | LOCAL_PRELINK_MODULE := false 24 | LOCAL_ARM_MODE := arm 25 | LOCAL_CFLAGS := $(OPENVX_DEFS) 26 | LOCAL_SRC_FILES := vx_xyz_module.c 27 | LOCAL_C_INCLUDES := $(OPENVX_INC) $(LOCAL_PATH) 28 | #LOCAL_SHARED_LIBRARIES := libdl libutils libcutils libbinder libhardware libion libgui libui 29 | LOCAL_SHARED_LIBRARIES += libopenvx 30 | LOCAL_MODULE := libxyz 31 | include $(BUILD_SHARED_LIBRARY) 32 | 33 | include $(CLEAR_VARS) 34 | LOCAL_MODULE_TAGS := optional 35 | LOCAL_PRELINK_MODULE := false 36 | LOCAL_ARM_MODE := arm 37 | LOCAL_CFLAGS := $(OPENVX_DEFS) 38 | LOCAL_SRC_FILES := vx_xyz_lib.c 39 | LOCAL_C_INCLUDES := $(OPENVX_INC) $(LOCAL_PATH) 40 | LOCAL_MODULE := libvx_xyz_lib 41 | include $(BUILD_STATIC_LIBRARY) 42 | 43 | ifeq ($(BUILD_EXAMPLE),1) 44 | include $(CLEAR_VARS) 45 | LOCAL_MODULE_TAGS := optional 46 | LOCAL_PRELINK_MODULE := false 47 | LOCAL_ARM_MODE := arm 48 | LOCAL_CFLAGS := $(OPENVX_DEFS) 49 | LOCAL_SRC_FILES := vx_main.c vx_ar.c vx_corners.c vx_pipeline.c 50 | LOCAL_C_INCLUDES := $(OPENVX_INC) $(LOCAL_PATH) $(OPENVX_TOP)/$(OPENVX_SRC)/extensions/include 51 | LOCAL_STATIC_LIBRARIES := libvx_xyz_lib libopenvx-debug-lib 52 | LOCAL_SHARED_LIBRARIES := libdl libutils libcutils libbinder libhardware libion libgui libui libopenvx 53 | LOCAL_MODULE := vx_example 54 | include $(BUILD_EXECUTABLE) 55 | endif 56 | 57 | -------------------------------------------------------------------------------- /examples/vx_arrayrange.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | 20 | vx_array example_array_of_custom_type_and_initialization(vx_context context) 21 | { 22 | //! [array define] 23 | typedef struct _mystruct { 24 | vx_uint32 some_uint; 25 | vx_float64 some_double; 26 | } mystruct; 27 | #define MY_NUM_ITEMS (10) 28 | vx_enum mytype = vxRegisterUserStruct(context, sizeof(mystruct)); 29 | vx_array array = vxCreateArray(context, mytype, MY_NUM_ITEMS); 30 | //! [array define] 31 | //! [array query] 32 | vx_size num_items = 0; 33 | vxQueryArray(array, VX_ARRAY_NUMITEMS, &num_items, sizeof(num_items)); 34 | //! [array query] 35 | { 36 | //! [array range] 37 | vx_size i, stride = sizeof(vx_size); 38 | void *base = NULL; 39 | vx_map_id map_id; 40 | /* access entire array at once */ 41 | vxMapArrayRange(array, 0, num_items, &map_id, &stride, &base, VX_READ_AND_WRITE, VX_MEMORY_TYPE_HOST, 0); 42 | for (i = 0; i < num_items; i++) 43 | { 44 | vxArrayItem(mystruct, base, i, stride).some_uint += i; 45 | vxArrayItem(mystruct, base, i, stride).some_double = 3.14f; 46 | } 47 | vxUnmapArrayRange(array, map_id); 48 | //! [array range] 49 | 50 | //! [array subaccess] 51 | /* access each array item individually */ 52 | for (i = 0; i < num_items; i++) 53 | { 54 | mystruct *myptr = NULL; 55 | vxMapArrayRange(array, i, i+1, &map_id, &stride, (void **)&myptr, VX_READ_AND_WRITE, VX_MEMORY_TYPE_HOST, 0); 56 | myptr->some_uint += 1; 57 | myptr->some_double = 3.14f; 58 | vxUnmapArrayRange(array, map_id); 59 | } 60 | //! [array subaccess] 61 | } 62 | return array; 63 | } 64 | -------------------------------------------------------------------------------- /examples/vx_convolution.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | 20 | vx_status example_conv(vx_context context) 21 | { 22 | //! [assign] 23 | // A horizontal Scharr gradient operator with different scale. 24 | vx_int16 gx[3][3] = { 25 | { 3, 0, -3}, 26 | { 10, 0,-10}, 27 | { 3, 0, -3}, 28 | }; 29 | vx_uint32 scale = 8; 30 | vx_convolution scharr_x = vxCreateConvolution(context, 3, 3); 31 | vxCopyConvolutionCoefficients(scharr_x, (vx_int16*)gx, VX_WRITE_ONLY, VX_MEMORY_TYPE_HOST); 32 | vxSetConvolutionAttribute(scharr_x, VX_CONVOLUTION_SCALE, &scale, sizeof(scale)); 33 | //! [assign] 34 | vxReleaseConvolution(&scharr_x); 35 | return VX_SUCCESS; 36 | } 37 | -------------------------------------------------------------------------------- /examples/vx_delaygraph.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | 20 | void example_delaygraph(vx_context context) 21 | { 22 | vx_status status = VX_SUCCESS; 23 | vx_image yuv = vxCreateImage(context, 320, 240, VX_DF_IMAGE_UYVY); 24 | vx_delay delay = vxCreateDelay(context, (vx_reference)yuv, 4); 25 | vx_image rgb = vxCreateImage(context, 320, 240, VX_DF_IMAGE_RGB); 26 | vx_graph graph = vxCreateGraph(context); 27 | 28 | vxColorConvertNode(graph, (vx_image)vxGetReferenceFromDelay(delay, 0),rgb); 29 | 30 | status = vxVerifyGraph(graph); 31 | if (status == VX_SUCCESS) 32 | { 33 | do { 34 | /* capture or read image into vxGetImageFromDelay(delay, 0); */ 35 | status = vxProcessGraph(graph); 36 | /* 0 becomes -1, -1 becomes -2, etc. convert is updated with new 0 */ 37 | vxAgeDelay(delay); 38 | } while (1); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /examples/vx_examples.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /*! 19 | * \file vx_examples.h 20 | * \brief A header of example functions. 21 | * \author Erik Rainey 22 | * 23 | * \defgroup group_example OpenVX Examples 24 | * \brief A series of examples of how to use the OpenVX API. 25 | * 26 | */ 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | int example_pipeline(int argc, char *argv[]); 36 | int example_corners(int argc, char *argv[]); 37 | int example_ar(int argc, char *argv[]); 38 | int example_super_resolution(int argc, char *argv[]); 39 | -------------------------------------------------------------------------------- /examples/vx_extensions.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | vx_status vx_example_extensions(vx_context context) { 24 | //! [extensions] 25 | vx_char *tmp, *extensions = NULL; 26 | vx_size size = 0; 27 | vxQueryContext(context,VX_CONTEXT_EXTENSIONS_SIZE,&size,sizeof(size)); 28 | extensions = malloc(size); 29 | vxQueryContext(context,VX_CONTEXT_EXTENSIONS, 30 | extensions, size); 31 | //! [extensions] 32 | tmp = strtok(extensions, " "); 33 | do { 34 | if (tmp) 35 | printf("Extension: %s\n", tmp); 36 | tmp = strtok(NULL, " "); 37 | } while (tmp); 38 | free(extensions); 39 | return VX_SUCCESS; 40 | } 41 | -------------------------------------------------------------------------------- /examples/vx_eyetrack.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /*! 19 | * \file vx_eyetrack.c 20 | * \example vx_eyetrack.c 21 | * \brief The example graph used to preprocess eye tracking data. 22 | * \author Erik Rainey 23 | */ 24 | 25 | #include 26 | 27 | /*! 28 | * \brief An example of an Eye Tracking Graph. 29 | * \ingroup group_example 30 | */ 31 | int example_eyetracking(int argc, char *argv[]) 32 | { 33 | vx_status status = VX_SUCCESS; 34 | vx_uint32 width = 640; 35 | vx_uint32 height = 480; 36 | vx_bool running = vx_true_e; 37 | vx_context context = vxCreateContext(); 38 | if (vxGetStatus((vx_reference)context) == VX_SUCCESS) 39 | { 40 | vx_image images[] = { 41 | vxCreateImage(context, width, height, VX_DF_IMAGE_UYVY), 42 | vxCreateImage(context, width, height, VX_DF_IMAGE_U8), 43 | }; 44 | 45 | vx_graph graph = vxCreateGraph(context); 46 | if (vxGetStatus((vx_reference)graph) == VX_SUCCESS) 47 | { 48 | vx_node nodes[] = { 49 | /*! \todo add nodes which process eye tracking */ 50 | }; 51 | 52 | status = vxVerifyGraph(context, graph); 53 | if (status == VX_SUCCESS) 54 | { 55 | do { 56 | /*! \todo capture an image */ 57 | status = vxProcessGraph(context, graph, NULL); 58 | /*! \todo do something with the data */ 59 | } while (running == vx_true_e); 60 | } 61 | vxReleaseGraph(&graph); 62 | } 63 | vxReleaseContext(&context); 64 | } 65 | return status; 66 | } 67 | 68 | -------------------------------------------------------------------------------- /examples/vx_graph_factory.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef _VX_EXAMPLE_GRAPH_FACTORY_H_ 19 | #define _VX_EXAMPLE_GRAPH_FACTORY_H_ 20 | 21 | #include 22 | #include 23 | 24 | /*! \ingroup group_example */ 25 | enum vx_factory_name_e { 26 | VX_GRAPH_FACTORY_EDGE, 27 | VX_GRAPH_FACTORY_CORNERS, 28 | VX_GRAPH_FACTORY_PIPELINE, 29 | }; 30 | 31 | /*! \brief An prototype of a graph factory method. 32 | * \ingroup group_example 33 | */ 34 | typedef vx_graph(*vx_graph_factory_f)(vx_context context); 35 | 36 | /*! \brief A graph factory structure. 37 | * \ingroup group_example 38 | */ 39 | typedef struct _vx_graph_factory_t { 40 | vx_enum factory_name; 41 | vx_graph_factory_f factory; 42 | } vx_graph_factory_t; 43 | 44 | // PROTOTYPES 45 | vx_graph vxEdgeGraphFactory(vx_context context); 46 | vx_graph vxCornersGraphFactory(vx_context context); 47 | vx_graph vxPipelineGraphFactory(vx_context context); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /examples/vx_independent.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2013-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #include 18 | 19 | vx_status run_example_parallel(void) 20 | { 21 | vx_status status = VX_SUCCESS; 22 | //! [independent] 23 | vx_context context = vxCreateContext(); 24 | vx_image images[] = { 25 | vxCreateImage(context, 640, 480, VX_DF_IMAGE_UYVY), 26 | vxCreateImage(context, 640, 480, VX_DF_IMAGE_S16), 27 | vxCreateImage(context, 640, 480, VX_DF_IMAGE_U8), 28 | }; 29 | vx_graph graph = vxCreateGraph(context); 30 | vx_image virts[] = { 31 | vxCreateVirtualImage(graph, 0, 0, VX_DF_IMAGE_VIRT), 32 | vxCreateVirtualImage(graph, 0, 0, VX_DF_IMAGE_VIRT), 33 | vxCreateVirtualImage(graph, 0, 0, VX_DF_IMAGE_VIRT), 34 | vxCreateVirtualImage(graph, 0, 0, VX_DF_IMAGE_VIRT), 35 | }; 36 | 37 | vxChannelExtractNode(graph, images[0], VX_CHANNEL_Y, virts[0]), 38 | vxGaussian3x3Node(graph, virts[0], virts[1]), 39 | vxSobel3x3Node(graph, virts[1], virts[2], virts[3]), 40 | vxMagnitudeNode(graph, virts[2], virts[3], images[1]), 41 | vxPhaseNode(graph, virts[2], virts[3], images[2]), 42 | 43 | status = vxVerifyGraph(graph); 44 | if (status == VX_SUCCESS) 45 | { 46 | status = vxProcessGraph(graph); 47 | } 48 | vxReleaseContext(&context); /* this will release everything */ 49 | //! [independent] 50 | return status; 51 | } 52 | -------------------------------------------------------------------------------- /examples/vx_kernels.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2013-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | #include 20 | 21 | vx_node vx_create_specific_sobel(vx_context context, vx_graph graph, vx_bool easy) 22 | { 23 | vx_node n = 0; 24 | if (easy == vx_false_e) { 25 | //! [firstmethod] 26 | vx_kernel kernel = vxGetKernelByEnum(context, VX_KERNEL_SOBEL_3x3); 27 | vx_node node = vxCreateGenericNode(graph, kernel); 28 | //! [firstmethod] 29 | n = node; 30 | } else { 31 | //! [secondmethod] 32 | vx_kernel kernel = vxGetKernelByName(context, "org.khronos.openvx.sobel_3x3"); 33 | vx_node node = vxCreateGenericNode(graph, kernel); 34 | //! [secondmethod] 35 | n = node; 36 | } 37 | return n; 38 | } 39 | 40 | -------------------------------------------------------------------------------- /examples/vx_matrix_access.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | #include 20 | 21 | #if __STDC_VERSION__ >= 199901L 22 | #define OPENVX_USE_C99 23 | #endif 24 | 25 | vx_matrix example_random_matrix(vx_context context) 26 | { 27 | //! [matrix] 28 | const vx_size columns = 3; 29 | const vx_size rows = 4; 30 | vx_matrix matrix = vxCreateMatrix(context, VX_TYPE_FLOAT32, columns, rows); 31 | vx_status status = vxGetStatus((vx_reference)matrix); 32 | if (status == VX_SUCCESS) 33 | { 34 | vx_int32 j, i; 35 | #if defined(OPENVX_USE_C99) 36 | vx_float32 mat[rows][columns]; /* note: row major */ 37 | #else 38 | vx_float32 *mat = (vx_float32 *)malloc(rows*columns*sizeof(vx_float32)); 39 | #endif 40 | if (vxCopyMatrix(matrix, mat, VX_READ_ONLY, VX_MEMORY_TYPE_HOST) == VX_SUCCESS) { 41 | for (j = 0; j < (vx_int32)rows; j++) 42 | for (i = 0; i < (vx_int32)columns; i++) 43 | #if defined(OPENVX_USE_C99) 44 | mat[j][i] = (vx_float32)rand()/(vx_float32)RAND_MAX; 45 | #else 46 | mat[j*columns + i] = (vx_float32)rand()/(vx_float32)RAND_MAX; 47 | #endif 48 | vxCopyMatrix(matrix, mat, VX_WRITE_ONLY, VX_MEMORY_TYPE_HOST); 49 | } 50 | #if !defined(OPENVX_USE_C99) 51 | free(mat); 52 | #endif 53 | } 54 | //! [matrix] 55 | return matrix; 56 | } 57 | -------------------------------------------------------------------------------- /examples/vx_multi_node_graph.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | #include 20 | 21 | vx_status vx_example_multinode_graph() 22 | { 23 | vx_status status = VX_SUCCESS; 24 | vx_uint32 n, width = 320, height = 240; 25 | //! [context] 26 | vx_context context = vxCreateContext(); 27 | //! [context] 28 | //! [data] 29 | vx_image in = vxCreateImage(context, width, height, VX_DF_IMAGE_U8); 30 | vx_image out = vxCreateImage(context, width, height, VX_DF_IMAGE_U8); 31 | //! [data] 32 | //! [graph] 33 | vx_graph graph = vxCreateGraph(context); 34 | //! [graph] 35 | //! [virt] 36 | vx_image blurred = vxCreateVirtualImage(graph, 0, 0, VX_DF_IMAGE_VIRT); 37 | vx_image gx = vxCreateVirtualImage(graph, 0, 0, VX_DF_IMAGE_S16); 38 | vx_image gy = vxCreateVirtualImage(graph, 0, 0, VX_DF_IMAGE_S16); 39 | //! [virt] 40 | //! [nodes] 41 | vx_node nodes[] = { 42 | vxGaussian3x3Node(graph, in, blurred), 43 | vxSobel3x3Node(graph, blurred, gx, gy), 44 | vxMagnitudeNode(graph, gx, gy, out), 45 | }; 46 | //! [nodes] 47 | 48 | //! [verify] 49 | status = vxVerifyGraph(graph); 50 | //! [verify] 51 | 52 | //! [process] 53 | if (status == VX_SUCCESS) 54 | status = vxProcessGraph(graph); 55 | //! [process] 56 | 57 | //! [teardown] 58 | for (n = 0; n < dimof(nodes); n++) 59 | vxReleaseNode(&nodes[n]); 60 | /* this catches anything else we forgot to release */ 61 | vxReleaseContext(&context); 62 | //! [teardown] 63 | return status; 64 | } 65 | -------------------------------------------------------------------------------- /examples/vx_parameters.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | 20 | /*! 21 | * \file vx_parameters.c 22 | * \example vx_parameters.c 23 | * \author Erik Rainey 24 | */ 25 | 26 | void example_explore_parameters(vx_context context, vx_kernel kernel) 27 | { 28 | vx_uint32 p, numParams = 0; 29 | vx_graph graph = vxCreateGraph(context); 30 | vx_node node = vxCreateGenericNode(graph, kernel); 31 | vxQueryKernel(kernel, VX_KERNEL_PARAMETERS, &numParams, sizeof(numParams)); 32 | for (p = 0; p < numParams; p++) 33 | { 34 | //! [Getting the ref] 35 | vx_parameter param = vxGetParameterByIndex(node, p); 36 | vx_reference ref; 37 | vxQueryParameter(param, VX_PARAMETER_REF, &ref, sizeof(ref)); 38 | //! [Getting the ref] 39 | if (ref) 40 | { 41 | //! [Getting the type] 42 | vx_enum type; 43 | vxQueryParameter(param, VX_PARAMETER_TYPE, &type, sizeof(type)); 44 | /* cast the ref to the correct vx_. Atomics are now vx_scalar */ 45 | //! [Getting the type] 46 | } 47 | vxReleaseParameter(¶m); 48 | } 49 | vxReleaseNode(&node); 50 | vxReleaseGraph(&graph); 51 | } 52 | -------------------------------------------------------------------------------- /examples/vx_single_node_graph.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | #include 20 | 21 | vx_status vxSingleNodeGraph() 22 | { 23 | vx_status status = VX_SUCCESS; 24 | vx_uint32 width = 320, height = 240; 25 | //! [whole] 26 | /* This is an example of a Single Node Graph */ 27 | //! [context] 28 | vx_context context = vxCreateContext(); 29 | //! [context] 30 | //! [data] 31 | vx_image in = vxCreateImage(context, width, height, VX_DF_IMAGE_U8); 32 | vx_image out = vxCreateImage(context, width, height, VX_DF_IMAGE_U8); 33 | //! [data] 34 | //! [graph] 35 | vx_graph graph = vxCreateGraph(context); 36 | //! [graph] 37 | //! [node] 38 | vx_node node = vxGaussian3x3Node(graph, in, out); 39 | //! [node] 40 | 41 | //! [verify] 42 | status = vxVerifyGraph(graph); 43 | //! [verify] 44 | //! [process] 45 | if (status == VX_SUCCESS) 46 | status = vxProcessGraph(graph); 47 | //! [process] 48 | //! [whole] 49 | //! [vxu] 50 | status = vxuGaussian3x3(context, in, out); 51 | //! [vxu] 52 | 53 | //! [teardown] 54 | vxReleaseNode(&node); 55 | /* this also releases any nodes we forgot to release */ 56 | vxReleaseGraph(&graph); 57 | vxReleaseImage(&in); 58 | vxReleaseImage(&out); 59 | /* this catches anything else we forgot to release */ 60 | vxReleaseContext(&context); 61 | //! [teardown] 62 | return status; 63 | } 64 | -------------------------------------------------------------------------------- /examples/vx_tiling_alpha.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | 20 | /*! \file 21 | * \example vx_tiling_alpha.c 22 | */ 23 | 24 | /*! \brief A 1x1 to 1x1 tile size. 25 | * \details This tiling kernel doesn't have an inner set of block loops as the 26 | * block size is 1x1. 27 | * This kernel uses this tiling definition. 28 | * \code 29 | * vx_block_size_t outSize = {1,1}; 30 | * vx_neighborhood_size_t inNbhd = {0,0,0,0}; 31 | * \endcode 32 | * \ingroup group_tiling 33 | */ 34 | //! [alpha_tiling_function] 35 | void alpha_image_tiling(void * VX_RESTRICT parameters[VX_RESTRICT], 36 | void * VX_RESTRICT tile_memory, 37 | vx_size tile_memory_size) 38 | { 39 | vx_uint32 i,j; 40 | vx_tile_t *in = (vx_tile_t *)parameters[0]; 41 | vx_float32 *alpha = (vx_float32 *)parameters[1]; 42 | vx_tile_t *out = (vx_tile_t *)parameters[2]; 43 | 44 | for (j = 0u; j < vxTileHeight(in, 0); j+=vxTileBlockHeight(in)) 45 | { 46 | for (i = 0u; i < vxTileWidth(in, 0); i+=vxTileBlockWidth(in)) 47 | { 48 | vx_uint8 pixel = vxImagePixel(vx_uint8, in, 0, i, j, 0, 0); 49 | vx_uint8 coeff = (vx_uint8)(255.0f * (*alpha)); 50 | vx_uint16 value = (coeff * pixel) >> 8; 51 | if (value > 255) 52 | value = 255; 53 | vxImagePixel(vx_uint8, out, 0, i, j, 0, 0) = (vx_uint8)value; 54 | } 55 | } 56 | } 57 | //! [alpha_tiling_function] 58 | -------------------------------------------------------------------------------- /examples/vx_tiling_box.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | #include 20 | 21 | /*! \file 22 | * \example vx_tiling_box.c 23 | */ 24 | 25 | /*! \brief A 3x3 to 1x1 box filter 26 | * This kernel uses this tiling definition. 27 | * \code 28 | * vx_block_size_t outSize = {1,1}; 29 | * vx_neighborhood_size_t inNbhd = {-1,1,-1,1}; 30 | * \endcode 31 | * \ingroup group_tiling 32 | */ 33 | //! [box_tiling_function] 34 | void box_image_tiling(void * VX_RESTRICT parameters[VX_RESTRICT], 35 | void * VX_RESTRICT tile_memory, 36 | vx_size tile_memory_size) 37 | { 38 | vx_uint32 x, y; 39 | vx_tile_t *in = (vx_tile_t *)parameters[0]; 40 | vx_tile_t *out = (vx_tile_t *)parameters[1]; 41 | 42 | for (y = 0; y < vxTileHeight(out, 0); y+=vxTileBlockHeight(out)) 43 | { 44 | for (x = 0; x < vxTileWidth(out, 0); x+=vxTileBlockWidth(out)) 45 | { 46 | vx_int32 j, i; 47 | vx_uint32 sum = 0; 48 | vx_uint32 count = 0; 49 | /* these loops can handle 3x3, 5x5, etc. since block size would be 1x1 */ 50 | for (j = vxNeighborhoodTop(in); j < vxNeighborhoodBottom(in); j++) 51 | { 52 | for (i = vxNeighborhoodLeft(in); i < vxNeighborhoodRight(in); i++) 53 | { 54 | sum += vxImagePixel(vx_uint8, in, 0, x, y, i, j); 55 | count++; 56 | } 57 | } 58 | sum /= count; 59 | if (sum > 255) 60 | sum = 255; 61 | vxImagePixel(vx_uint8, out, 0, x, y, 0, 0) = (vx_uint8)sum; 62 | } 63 | } 64 | } 65 | //! [box_tiling_function] 66 | 67 | -------------------------------------------------------------------------------- /examples/vx_tiling_ext.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef _VX_EXAMPLE_TILING_H_ 19 | #define _VX_EXAMPLE_TILING_H_ 20 | 21 | /*! \brief The list of example tiling kernels */ 22 | enum vx_tiling_kernels_e { 23 | /*! \brief a re-implementation of a gaussian blur */ 24 | VX_KERNEL_GAUSSIAN_3x3_TILING = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x100, 25 | /*! \brief a re-implementation of a generic box filter of any size */ 26 | VX_KERNEL_BOX_MxN_TILING = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x101, 27 | /*! \brief a re-implementation of a add kernel */ 28 | VX_KERNEL_ADD_TILING = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x102, 29 | /*! \brief an alpha multiply kernel */ 30 | VX_KERNEL_ALPHA_TILING = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x103, 31 | }; 32 | 33 | #ifdef _VX_TILING_EXT_INTERNAL_ 34 | void add_image_tiling(void * VX_RESTRICT parameters[VX_RESTRICT], void * VX_RESTRICT tile_memory, vx_size tile_memory_size); 35 | void alpha_image_tiling(void * VX_RESTRICT parameters[VX_RESTRICT], void * VX_RESTRICT tile_memory, vx_size tile_memory_size); 36 | void box_image_tiling(void * VX_RESTRICT parameters[VX_RESTRICT], void * VX_RESTRICT tile_memory, vx_size tile_memory_size); 37 | void gaussian_image_tiling_fast(void * VX_RESTRICT parameters[VX_RESTRICT], void * VX_RESTRICT tile_memory, vx_size tile_memory_size); 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /examples/vx_warps.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | #include 20 | 21 | vx_status vx_example_warp_affine(vx_context context, vx_image src, vx_image dst) 22 | { 23 | vx_float32 a = 1.0f, b = 0.0f, c = 0.0f, d = 1.0f, e = 0.0f , f = 0.0f; 24 | //! [warp affine] 25 | // x0 = a x + b y + c; 26 | // y0 = d x + e y + f; 27 | vx_float32 mat[3][2] = { 28 | {a, d}, // 'x' coefficients 29 | {b, e}, // 'y' coefficients 30 | {c, f}, // 'offsets' 31 | }; 32 | vx_matrix matrix = vxCreateMatrix(context, VX_TYPE_FLOAT32, 2, 3); 33 | vxCopyMatrix(matrix, mat, VX_WRITE_ONLY, VX_MEMORY_TYPE_HOST); 34 | //! [warp affine] 35 | return vxuWarpAffine(context, src, matrix, VX_INTERPOLATION_NEAREST_NEIGHBOR, dst); 36 | } 37 | 38 | vx_status vx_example_warp_perspective(vx_context context, vx_image src, vx_image dst) 39 | { 40 | vx_float32 a = 1.0f, b = 0.0f, c = 0.0f, d = 1.0f, e = 0.0f, f = 0.0f, g = 1.0f, h = 0.0f, i = 0.0f; 41 | //! [warp perspective] 42 | // x0 = a x + b y + c; 43 | // y0 = d x + e y + f; 44 | // z0 = g x + h y + i; 45 | vx_float32 mat[3][3] = { 46 | {a, d, g}, // 'x' coefficients 47 | {b, e, h}, // 'y' coefficients 48 | {c, f, i}, // 'offsets' 49 | }; 50 | vx_matrix matrix = vxCreateMatrix(context, VX_TYPE_FLOAT32, 3, 3); 51 | vxCopyMatrix(matrix, mat, VX_WRITE_ONLY, VX_MEMORY_TYPE_HOST); 52 | //! [warp perspective] 53 | return vxuWarpPerspective(context, src, matrix, VX_INTERPOLATION_NEAREST_NEIGHBOR, dst); 54 | } 55 | -------------------------------------------------------------------------------- /examples/xyz.def: -------------------------------------------------------------------------------- 1 | LIBRARY "xyz.dll" 2 | VERSION 1.0 3 | EXPORTS 4 | vxPublishKernels 5 | vxUnpublishKernels 6 | -------------------------------------------------------------------------------- /helper/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | LOCAL_PATH := $(call my-dir) 20 | 21 | include $(CLEAR_VARS) 22 | LOCAL_MODULE_TAGS := optional 23 | LOCAL_PRELINK_MODULE := false 24 | LOCAL_ARM_MODE := arm 25 | LOCAL_CFLAGS := $(OPENVX_DEFS) 26 | LOCAL_SRC_FILES := vx_helper.c 27 | LOCAL_C_INCLUDES := $(OPENVX_INC) $(OPENVX_TOP)/$(OPENVX_SRC)/include 28 | LOCAL_MODULE := libopenvx-helper 29 | include $(BUILD_STATIC_LIBRARY) -------------------------------------------------------------------------------- /helper/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2011-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | # set target name 20 | set( TARGET_NAME openvx-helper ) 21 | 22 | include_directories( BEFORE 23 | ${CMAKE_CURRENT_SOURCE_DIR} 24 | ${VX_HEADER_DIR} 25 | ) 26 | 27 | FIND_SOURCES() 28 | 29 | # add a target named ${TARGET_NAME} 30 | add_library (${TARGET_NAME} ${SOURCE_FILES}) 31 | 32 | install ( TARGETS ${TARGET_NAME} 33 | RUNTIME DESTINATION bin 34 | ARCHIVE DESTINATION bin 35 | LIBRARY DESTINATION bin ) 36 | 37 | set_target_properties( ${TARGET_NAME} PROPERTIES FOLDER ${HELPER_FOLDER} ) 38 | -------------------------------------------------------------------------------- /helper/concerto.mak: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | include $(PRELUDE) 20 | TARGET := openvx-helper 21 | TARGETTYPE := library 22 | CSOURCES := $(call all-c-files) 23 | IDIRS += $(HOST_ROOT)/$(OPENVX_SRC)/include 24 | include $(FINALE) -------------------------------------------------------------------------------- /include/VX/vx_khr_dot.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef _VX_KHR_DOT_H_ 19 | #define _VX_KHR_DOT_H_ 20 | 21 | #define OPENVX_KHR_DOT "vx_khr_dot" 22 | 23 | #include 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /*! \brief Exports a single graph to a dotfile. 30 | * \param [in] graph The graph to export. 31 | * \param [in] dotfile The name of the file to write to. 32 | * \param [in] showData If true, data objects will be listed in the graph too. 33 | * \see http://www.graphviz.com 34 | */ 35 | vx_status vxExportGraphToDot(vx_graph g, vx_char dotfile[], vx_bool showData); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /include/VX/vx_khr_interp.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef _VX_KHR_INTERP_H_ 19 | #define _VX_KHR_INTERP_H_ 20 | 21 | /*! \brief The Interpolation Type Query Extension. 22 | * \file 23 | */ 24 | 25 | #define OPENVX_KHR_INTERP "vx_khr_interpolation" 26 | 27 | #include 28 | 29 | /*! \brief Additional interpolation types */ 30 | enum vx_interpolation_type_ext_e { 31 | /*! \brief Bicubic interpolation method */ 32 | VX_INTERPOLATION_BICUBIC = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_INTERPOLATION) + 0x3, 33 | /*! \brief Mipmapping interpolation method */ 34 | VX_INTERPOLATION_MIPMAP = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_INTERPOLATION) + 0x4, 35 | }; 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /include/concerto.mak: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2015-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | # Make a bzip2 tarball containing just the standard headers 20 | # (no extensions). 21 | 22 | OPENVX_STD_HEADER_BASENAMES = \ 23 | vx.h vxu.h vx_vendors.h vx_types.h vx_kernels.h vx_api.h vx_nodes.h vx_compatibility.h 24 | OPENVX_EXT_HEADER_BASENAMES = \ 25 | vx_import.h vx_khr_class.h vx_khr_icd.h vx_khr_ix.h vx_khr_nn.h vx_khr_tiling.h vx_khr_xml.h 26 | 27 | OPENVX_STD_HEADERS = $(patsubst %, VX/%, $(OPENVX_STD_HEADER_BASENAMES)) 28 | OPENVX_EXT_HEADERS = $(patsubst %, VX/%, $(OPENVX_EXT_HEADER_BASENAMES)) 29 | 30 | # This is just the default destination, expected to be overridden. 31 | OPENVX_HEADERS_DESTDIR = $(HOST_ROOT)/out 32 | 33 | OPENVX_STD_HEADERS_PACKAGE_NAME = \ 34 | openvx-standard-headers-$(VERSION)-$(strip $(shell date '+%Y%m%d')).tar.bz2 35 | OPENVX_EXT_HEADERS_PACKAGE_NAME = \ 36 | openvx-extension-headers-$(VERSION)-$(strip $(shell date '+%Y%m%d')).tar.bz2 37 | 38 | # Only do this for the same host environments where the concerto 39 | # "tar" package type is available. 40 | ifneq ($(filter $(HOST_OS),LINUX CYGWIN DARWIN),) 41 | 42 | .PHONY: openvx-header-packages 43 | openvx-header-packages: \ 44 | $(OPENVX_HEADERS_DESTDIR)/$(OPENVX_STD_HEADERS_PACKAGE_NAME) \ 45 | $(OPENVX_HEADERS_DESTDIR)/$(OPENVX_EXT_HEADERS_PACKAGE_NAME) 46 | 47 | $(OPENVX_HEADERS_DESTDIR)/$(OPENVX_STD_HEADERS_PACKAGE_NAME): \ 48 | $(patsubst %, $(HOST_ROOT)/include/%, $(OPENVX_STD_HEADERS)) 49 | @$(MKDIR) $(OPENVX_HEADERS_DESTDIR) 50 | @tar -cjf $@ -C $(HOST_ROOT)/include $(OPENVX_STD_HEADERS) 51 | 52 | $(OPENVX_HEADERS_DESTDIR)/$(OPENVX_EXT_HEADERS_PACKAGE_NAME): \ 53 | $(patsubst %, $(HOST_ROOT)/include/%, $(OPENVX_EXT_HEADERS)) 54 | @$(MKDIR) $(OPENVX_HEADERS_DESTDIR) 55 | @tar -cjf $@ -C $(HOST_ROOT)/include $(OPENVX_EXT_HEADERS) 56 | 57 | endif # Host environments. 58 | -------------------------------------------------------------------------------- /kernels/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | include $(call all-subdir-makefiles) 20 | 21 | -------------------------------------------------------------------------------- /kernels/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2011-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | add_subdirectory( c_model ) 20 | add_subdirectory( debug ) 21 | add_subdirectory( extras ) 22 | if (EXPERIMENTAL_USE_VENUM) 23 | add_subdirectory( venum ) 24 | endif (EXPERIMENTAL_USE_VENUM) 25 | if (OPENVX_USE_TILING) 26 | add_subdirectory( tiling ) 27 | endif (OPENVX_USE_TILING) 28 | if (OPENVX_CONFORMANCE_NNEF_IMPORT) 29 | # set target name 30 | set( TARGET_NAME nnef-lib ) 31 | 32 | include_directories( BEFORE 33 | ${CMAKE_CURRENT_SOURCE_DIR} 34 | ${CMAKE_SOURCE_DIR}/kernels/NNEF-Tools/parser/cpp/include ) 35 | 36 | if (UNIX) 37 | set(CMAKE_CXX_STANDARD 11) 38 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 39 | endif (UNIX) 40 | 41 | FIND_SOURCES() 42 | 43 | file(GLOB OVX_SRC_NNEF_LIB "${CMAKE_SOURCE_DIR}/kernels/NNEF-Tools/parser/cpp/src/*.cpp") 44 | add_library (${TARGET_NAME} STATIC ${OVX_SRC_NNEF_LIB} ) 45 | 46 | install ( TARGETS ${TARGET_NAME} 47 | RUNTIME DESTINATION bin 48 | ARCHIVE DESTINATION bin 49 | LIBRARY DESTINATION bin ) 50 | 51 | set_target_properties( ${TARGET_NAME} PROPERTIES FOLDER ${HELPER_FOLDER} ) 52 | endif (OPENVX_CONFORMANCE_NNEF_IMPORT) 53 | -------------------------------------------------------------------------------- /kernels/README: -------------------------------------------------------------------------------- 1 | 2 | These libraries are "flat" OpenVX type-compliant implementations of the core 3 | vision functions, or "kernels". 4 | 5 | c_model: flat kernels associated with language-specific kernels in sample/targets/c_model 6 | debug: flat kernels associated with language-specific kernels in extensions/debug 7 | -------------------------------------------------------------------------------- /kernels/c_model/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | LOCAL_PATH := $(call my-dir) 20 | 21 | include $(CLEAR_VARS) 22 | LOCAL_MODULE_TAGS := optional 23 | LOCAL_PRELINK_MODULE := false 24 | LOCAL_ARM_MODE := arm 25 | LOCAL_CFLAGS := $(OPENVX_DEFS) 26 | LOCAL_SRC_FILES := c_absdiff.c \ 27 | c_accumulate.c \ 28 | c_addsub.c \ 29 | c_bitwise.c \ 30 | c_channel.c \ 31 | c_conv3x3.c \ 32 | c_convertcolor.c \ 33 | c_convertdepth.c \ 34 | c_convolve.c \ 35 | c_fast9.c \ 36 | c_filter.c \ 37 | c_histogram.c \ 38 | c_integralimage.c \ 39 | c_lut.c \ 40 | c_magnitude.c \ 41 | c_sobel3x3.c \ 42 | c_statistics.c 43 | LOCAL_C_INCLUDES := $(OPENVX_INC) $(OPENVX_TOP)/$(OPENVX_SRC)/include $(OPENVX_TOP)/debug 44 | LOCAL_MODULE := libopenvx-c_model-lib 45 | include $(BUILD_STATIC_LIBRARY) -------------------------------------------------------------------------------- /kernels/c_model/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2011-2018 The Khronos Group Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | 18 | # set target name 19 | set( TARGET_NAME openvx-c_model-lib ) 20 | 21 | include_directories( BEFORE 22 | ${CMAKE_CURRENT_SOURCE_DIR} 23 | ${VX_HEADER_DIR} 24 | ${CMAKE_SOURCE_DIR}/utils 25 | ${CMAKE_SOURCE_DIR}/debug ) 26 | 27 | FIND_SOURCES() 28 | 29 | # add a target named ${TARGET_NAME} 30 | add_library (${TARGET_NAME} ${SOURCE_FILES}) 31 | 32 | target_link_libraries( ${TARGET_NAME} openvx ) 33 | 34 | install ( TARGETS ${TARGET_NAME} 35 | RUNTIME DESTINATION bin 36 | ARCHIVE DESTINATION bin 37 | LIBRARY DESTINATION bin ) 38 | 39 | set_target_properties( ${TARGET_NAME} PROPERTIES FOLDER ${KERNELS_FOLDER} ) 40 | -------------------------------------------------------------------------------- /kernels/c_model/c_optpyrlk.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | 20 | // nodeless version of the OpticalFlowPyrLK kernel 21 | vx_status vxOpticalFlowPyrLK(/*p1, p2, p3...*/) 22 | { 23 | // 24 | 25 | return VX_ERROR_NOT_IMPLEMENTED; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /kernels/c_model/c_sobel3x3.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | 20 | static vx_int16 sobel_x[3][3] = { 21 | {-1, 0, +1}, 22 | {-2, 0, +2}, 23 | {-1, 0, +1}, 24 | }; 25 | 26 | static vx_int16 sobel_y[3][3] = { 27 | {-1, -2, -1}, 28 | { 0, 0, 0}, 29 | {+1, +2, +1}, 30 | }; 31 | 32 | // nodeless version of the Sobel3x3 kernel 33 | vx_status vxSobel3x3(vx_image input, vx_image grad_x, vx_image grad_y, vx_border_t *bordermode) 34 | { 35 | if (grad_x) { 36 | vx_status status = vxConvolution3x3(input, grad_x, sobel_x, bordermode); 37 | if (status != VX_SUCCESS) return status; 38 | } 39 | 40 | if (grad_y) { 41 | vx_status status = vxConvolution3x3(input, grad_y, sobel_y, bordermode); 42 | if (status != VX_SUCCESS) return status; 43 | } 44 | 45 | return VX_SUCCESS; 46 | } 47 | -------------------------------------------------------------------------------- /kernels/c_model/concerto.mak: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | _MODULE := openvx-c_model-lib 20 | include $(PRELUDE) 21 | TARGET := openvx-c_model-lib 22 | TARGETTYPE := library 23 | CSOURCES := $(call all-c-files) 24 | IDIRS := $(HOST_ROOT)/debug $(HOST_ROOT)/utils 25 | SHARED_LIBS := openvx 26 | include $(FINALE) 27 | 28 | -------------------------------------------------------------------------------- /kernels/c_model/template: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | or 20 | #include 21 | or 22 | #include 23 | 24 | // nodeless version of the XXX kernel 25 | vx_status vxXXX(p1, p2, p3...) 26 | { 27 | 28 | 29 | 30 | 31 | vx_status; 32 | 33 | 34 | 35 | return status; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /kernels/debug/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | LOCAL_PATH := $(call my-dir) 20 | 21 | include $(CLEAR_VARS) 22 | LOCAL_MODULE_TAGS := optional 23 | LOCAL_PRELINK_MODULE := false 24 | LOCAL_ARM_MODE := arm 25 | LOCAL_CFLAGS := $(OPENVX_DEFS) 26 | LOCAL_SRC_FILES := d_file.c 27 | LOCAL_C_INCLUDES := $(OPENVX_INC) $(OPENVX_TOP)/$(OPENVX_SRC)/include 28 | LOCAL_MODULE := libopenvx-debug_k-lib 29 | include $(BUILD_STATIC_LIBRARY) -------------------------------------------------------------------------------- /kernels/debug/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2011-2018 The Khronos Group Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | 18 | # set target name 19 | set( TARGET_NAME openvx-debug_k-lib ) 20 | 21 | include_directories( BEFORE 22 | ${CMAKE_CURRENT_SOURCE_DIR} 23 | ${VX_HEADER_DIR} 24 | ) 25 | 26 | FIND_SOURCES() 27 | 28 | # add a target named ${TARGET_NAME} 29 | add_library (${TARGET_NAME} ${SOURCE_FILES}) 30 | 31 | install ( TARGETS ${TARGET_NAME} 32 | RUNTIME DESTINATION bin 33 | ARCHIVE DESTINATION bin 34 | LIBRARY DESTINATION bin ) 35 | 36 | set_target_properties( ${TARGET_NAME} PROPERTIES FOLDER ${KERNELS_FOLDER} ) 37 | -------------------------------------------------------------------------------- /kernels/debug/concerto.mak: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | _MODULE := openvx-debug_k-lib 20 | include $(PRELUDE) 21 | TARGET := openvx-debug_k-lib 22 | TARGETTYPE := library 23 | CSOURCES := $(call all-c-files) 24 | include $(FINALE) 25 | 26 | -------------------------------------------------------------------------------- /kernels/debug/debug_k.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2011-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef _VX_DEBUG_K_H_ 19 | #define _VX_DEBUG_K_H_ 20 | 21 | #include 22 | #include 23 | 24 | #define FGETS(str, fh) \ 25 | { \ 26 | char* success = fgets(str, sizeof(str), fh); \ 27 | if (!success) \ 28 | { \ 29 | printf("fgets failed\n"); \ 30 | } \ 31 | } 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | vx_status ownFWriteImage (vx_image input, vx_array filename); 38 | vx_status ownFReadImage (vx_array filename, vx_image output); 39 | 40 | vx_status ownCopyImage(vx_image input, vx_image output); 41 | vx_status ownCopyArray(vx_array src, vx_array dst); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif // !_VX_DEBUG_K_H_ 48 | 49 | -------------------------------------------------------------------------------- /kernels/extras/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2011-2018 The Khronos Group Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | 18 | # set target name 19 | set( TARGET_NAME openvx-extras_k-lib ) 20 | 21 | include_directories( BEFORE 22 | ${CMAKE_CURRENT_SOURCE_DIR} 23 | ${VX_HEADER_DIR} 24 | ) 25 | 26 | FIND_SOURCES() 27 | 28 | # add a target named ${TARGET_NAME} 29 | add_library (${TARGET_NAME} ${SOURCE_FILES}) 30 | 31 | install ( TARGETS ${TARGET_NAME} 32 | RUNTIME DESTINATION bin 33 | ARCHIVE DESTINATION bin 34 | LIBRARY DESTINATION bin ) 35 | 36 | set_target_properties( ${TARGET_NAME} PROPERTIES FOLDER ${KERNELS_FOLDER} ) 37 | -------------------------------------------------------------------------------- /kernels/extras/concerto.mak: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | _MODULE := openvx-extras_k-lib 20 | include $(PRELUDE) 21 | TARGET := openvx-extras_k-lib 22 | TARGETTYPE := library 23 | CSOURCES := $(call all-c-files) 24 | include $(FINALE) 25 | 26 | -------------------------------------------------------------------------------- /kernels/extras/extras_k.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2011-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef _VX_EXTRAS_K_H_ 19 | #define _VX_EXTRAS_K_H_ 20 | 21 | #include 22 | #include 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | vx_status ownEuclideanNonMaxSuppressionHarris(vx_image src, vx_scalar thr, vx_scalar rad, vx_image dst); 29 | vx_status ownNonMaxSuppression(vx_image i_mag, vx_image i_ang, vx_image i_edge, vx_border_t* bordermode); 30 | vx_status ownLaplacian3x3(vx_image src, vx_image dst, vx_border_t* bordermode); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif // !_VX_EXTRAS_K_H_ 37 | -------------------------------------------------------------------------------- /kernels/opencl/vx_absdiff.cl: -------------------------------------------------------------------------------- 1 | 2 | #if 1 3 | 4 | __kernel void vx_absdiff(int ssx0, int ssy0, __global uchar *src0, 5 | int ssx1, int ssy1, __global uchar *src1, 6 | int dsx, int dsy, __global uchar *dst) 7 | { 8 | const int x = get_global_id(0); 9 | const int y = get_global_id(1); 10 | 11 | uchar src_value0 = src0[x * ssx0 + y * ssy0]; 12 | uchar src_value1 = src1[x * ssx1 + y * ssy1]; 13 | 14 | if (src_value0 > src_value1) 15 | dst[x * dsx + y * dsy] = src_value0 - src_value1; 16 | else 17 | dst[x * dsx + y * dsy] = src_value1 - src_value0; 18 | } 19 | 20 | #else 21 | 22 | __kernel void vx_absdiff(int ssx0, int ssy0, __global short *src0, 23 | int ssx1, int ssy1, __global short *src1, 24 | int dsx, int dsy, __global short *dst) 25 | { 26 | const int x = get_global_id(0); 27 | const int y = get_global_id(1); 28 | 29 | short src_value0 = src0[x * ssx0 / 2 + y * ssy0 / 2]; 30 | short src_value1 = src1[x * ssx1 / 2 + y * ssy1 / 2]; 31 | uint val; 32 | 33 | if (src_value0 > src_value1) 34 | val = src_value0 - src_value1; 35 | else 36 | val = src_value1 - src_value0; 37 | 38 | dst[x * dsx / 2 + y * dsy / 2] = (short)((val > 32767) ? 32767 : val); 39 | } 40 | 41 | #endif -------------------------------------------------------------------------------- /kernels/opencl/vx_and.cl: -------------------------------------------------------------------------------- 1 | 2 | __kernel void vx_and(int asx, int asy, __global uchar *a, 3 | int bsx, int bsy, __global uchar *b, 4 | int csx, int csy, __global uchar *c) 5 | { 6 | int x = get_global_id(0); 7 | int y = get_global_id(1); 8 | 9 | c[y * csy + x * csx] = a[y * asy + x * asx] & b[y * bsy + x * bsx]; 10 | } 11 | -------------------------------------------------------------------------------- /kernels/opencl/vx_not.cl: -------------------------------------------------------------------------------- 1 | 2 | __kernel void vx_not(int asx, int asy, __global uchar *a, 3 | int bsx, int bsy, __global uchar *b) 4 | { 5 | int x = get_global_id(0); 6 | int y = get_global_id(1); 7 | 8 | b[y * bsy + x * bsx] = ~a[y * asy + x * asx]; 9 | } 10 | -------------------------------------------------------------------------------- /kernels/opencl/vx_orr.cl: -------------------------------------------------------------------------------- 1 | 2 | __kernel void vx_orr(int asx, int asy, __global uchar *a, 3 | int bsx, int bsy, __global uchar *b, 4 | int csx, int csy, __global uchar *c) 5 | { 6 | int x = get_global_id(0); 7 | int y = get_global_id(1); 8 | 9 | c[y * csy + x * csx] = a[y * asy + x * asx] | b[y * bsy + x * bsx]; 10 | } 11 | -------------------------------------------------------------------------------- /kernels/opencl/vx_xor.cl: -------------------------------------------------------------------------------- 1 | 2 | __kernel void vx_xor(int asx, int asy, __global uchar *a, 3 | int bsx, int bsy, __global uchar *b, 4 | int csx, int csy, __global uchar *c) 5 | { 6 | int x = get_global_id(0); 7 | int y = get_global_id(1); 8 | 9 | c[y * csy + x * csx] = a[y * asy + x * asx] ^ b[y * bsy + x * bsx]; 10 | } 11 | -------------------------------------------------------------------------------- /kernels/tiling/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2011-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | # set target name 20 | set( TARGET_NAME openvx-tiling_chaining-lib ) 21 | 22 | include_directories( BEFORE 23 | ${CMAKE_CURRENT_SOURCE_DIR} 24 | ${VX_HEADER_DIR} 25 | ${CMAKE_SOURCE_DIR}/utils 26 | ${CMAKE_SOURCE_DIR}/debug ) 27 | 28 | FIND_SOURCES() 29 | 30 | # add a target named ${TARGET_NAME} 31 | add_library (${TARGET_NAME} ${SOURCE_FILES}) 32 | 33 | target_link_libraries( ${TARGET_NAME} openvx ) 34 | 35 | install ( TARGETS ${TARGET_NAME} 36 | RUNTIME DESTINATION bin 37 | ARCHIVE DESTINATION bin 38 | LIBRARY DESTINATION bin ) 39 | 40 | set_target_properties( ${TARGET_NAME} PROPERTIES FOLDER ${KERNELS_FOLDER} ) 41 | -------------------------------------------------------------------------------- /kernels/venum/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2011-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | # set target name 20 | set( TARGET_NAME openvx-venum-lib ) 21 | 22 | include_directories( BEFORE 23 | ${CMAKE_CURRENT_SOURCE_DIR} 24 | ${VX_HEADER_DIR} 25 | ${CMAKE_SOURCE_DIR}/utils 26 | ${CMAKE_SOURCE_DIR}/debug ) 27 | 28 | FIND_SOURCES() 29 | 30 | # add a target named ${TARGET_NAME} 31 | add_library (${TARGET_NAME} STATIC ${SOURCE_FILES}) 32 | 33 | target_link_libraries( ${TARGET_NAME} openvx ) 34 | 35 | install ( TARGETS ${TARGET_NAME} 36 | RUNTIME DESTINATION bin 37 | ARCHIVE DESTINATION bin 38 | LIBRARY DESTINATION bin ) 39 | 40 | set_target_properties( ${TARGET_NAME} PROPERTIES FOLDER ${KERNELS_FOLDER} ) 41 | -------------------------------------------------------------------------------- /libraries/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | include $(call all-subdir-makefiles) 20 | 21 | -------------------------------------------------------------------------------- /libraries/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2011-2018 The Khronos Group Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | 18 | add_subdirectory( debug ) 19 | add_subdirectory( extras ) 20 | 21 | -------------------------------------------------------------------------------- /libraries/debug/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | LOCAL_PATH := $(call my-dir) 20 | 21 | include $(CLEAR_VARS) 22 | LOCAL_MODULE_TAGS := optional 23 | LOCAL_PRELINK_MODULE := false 24 | LOCAL_ARM_MODE := arm 25 | LOCAL_CFLAGS := $(OPENVX_DEFS) 26 | LOCAL_SRC_FILES := vx_debug_module.c \ 27 | vx_check.c \ 28 | vx_copy.c \ 29 | vx_compare.c \ 30 | vx_file.c \ 31 | vx_fill.c 32 | LOCAL_C_INCLUDES := $(OPENVX_INC) $(OPENVX_TOP)/kernels/debug 33 | LOCAL_WHOLE_STATIC_LIBRARIES := libopenvx-debug_k-lib 34 | LOCAL_STATIC_LIBRARIES := libopenvx-helper 35 | LOCAL_SHARED_LIBRARIES := libdl libutils libcutils libbinder libhardware libion libgui libui libopenvx 36 | LOCAL_MODULE := libopenvx-debug 37 | include $(BUILD_SHARED_LIBRARY) 38 | 39 | include $(CLEAR_VARS) 40 | LOCAL_MODULE_TAGS := optional 41 | LOCAL_PRELINK_MODULE := false 42 | LOCAL_ARM_MODE := arm 43 | LOCAL_CFLAGS := $(OPENVX_DEFS) 44 | LOCAL_SRC_FILES := vx_debug_lib.c 45 | LOCAL_C_INCLUDES := $(OPENVX_INC) 46 | LOCAL_STATIC_LIBRARIES := libopenvx-helper 47 | LOCAL_MODULE := libopenvx-debug-lib 48 | include $(BUILD_STATIC_LIBRARY) 49 | 50 | -------------------------------------------------------------------------------- /libraries/debug/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2011-2018 The Khronos Group Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | 18 | # set target name 19 | set( TARGET_NAME_1 openvx-debug-lib ) 20 | set( TARGET_NAME_2 openvx-debug ) 21 | 22 | include_directories( BEFORE 23 | ${CMAKE_CURRENT_SOURCE_DIR} 24 | ${VX_HEADER_DIR} 25 | ${CMAKE_SOURCE_DIR}/kernels/debug ) 26 | 27 | if ((WIN32) OR (CYGWIN)) 28 | add_definitions( ${OPENVX_BUILDING_EXPORT_DEF} ) 29 | endif ((WIN32) OR (CYGWIN)) 30 | 31 | # add a target named ${TARGET_NAME} 32 | add_library (${TARGET_NAME_1} vx_debug_lib.c) 33 | 34 | FIND_SOURCES( vx_debug_lib.c ) 35 | 36 | if ((WIN32) OR (CYGWIN)) 37 | set( DEF_FILE openvx-debug.def ) 38 | endif ((WIN32) OR (CYGWIN)) 39 | 40 | add_library (${TARGET_NAME_2} SHARED ${SOURCE_FILES} ${DEF_FILE}) 41 | 42 | if (CYGWIN) 43 | set_target_properties( ${TARGET_NAME_2} PROPERTIES LINK_FLAGS ${CMAKE_CURRENT_SOURCE_DIR}/${DEF_FILE} ) 44 | endif (CYGWIN) 45 | 46 | target_link_libraries( ${TARGET_NAME_2} openvx-helper openvx-debug_k-lib openvx ) 47 | 48 | install ( TARGETS ${TARGET_NAME_1} ${TARGET_NAME_2} 49 | RUNTIME DESTINATION bin 50 | ARCHIVE DESTINATION bin 51 | LIBRARY DESTINATION bin ) 52 | 53 | set_target_properties( ${TARGET_NAME_1} PROPERTIES FOLDER ${LIBRARIES_DEBUG_FOLDER} ) 54 | set_target_properties( ${TARGET_NAME_2} PROPERTIES FOLDER ${LIBRARIES_DEBUG_FOLDER} ) 55 | -------------------------------------------------------------------------------- /libraries/debug/concerto.mak: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | _MODULE := openvx-debug-lib 20 | include $(PRELUDE) 21 | TARGET := openvx-debug-lib 22 | TARGETTYPE := library 23 | CSOURCES := vx_debug_lib.c 24 | include $(FINALE) 25 | 26 | _MODULE := openvx-debug 27 | include $(PRELUDE) 28 | TARGET := openvx-debug 29 | TARGETTYPE := dsmo 30 | IDIRS += $(HOST_ROOT)/kernels/debug 31 | DEFFILE := openvx-debug.def 32 | CSOURCES := $(filter-out vx_debug_lib.c,$(call all-c-files)) 33 | STATIC_LIBS := openvx-helper openvx-debug_k-lib 34 | SHARED_LIBS := openvx 35 | include $(FINALE) 36 | 37 | -------------------------------------------------------------------------------- /libraries/debug/openvx-debug.def: -------------------------------------------------------------------------------- 1 | LIBRARY "openvx-debug.dll" 2 | VERSION 1.0 3 | EXPORTS 4 | vxPublishKernels 5 | vxUnpublishKernels 6 | 7 | 8 | -------------------------------------------------------------------------------- /libraries/debug/vx_debug_module.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /*! 19 | * \file 20 | * \brief The Debug Extensions Module Header. 21 | * \author Erik Rainey 22 | */ 23 | 24 | #ifndef _VX_DEBUG_MODULE_H_ 25 | #define _VX_DEBUG_MODULE_H_ 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | extern vx_kernel_description_t fwrite_image_kernel; 32 | extern vx_kernel_description_t fread_image_kernel; 33 | extern vx_kernel_description_t fwrite_array_kernel; 34 | extern vx_kernel_description_t fread_array_kernel; 35 | extern vx_kernel_description_t check_image_kernel; 36 | extern vx_kernel_description_t check_array_kernel; 37 | extern vx_kernel_description_t copy_image_kernel; 38 | extern vx_kernel_description_t copy_array_kernel; 39 | extern vx_kernel_description_t fill_image_kernel; 40 | extern vx_kernel_description_t compare_images_kernel; 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif /* _VX_DEBUG_MODULE_H_ */ 47 | 48 | -------------------------------------------------------------------------------- /libraries/extras/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | LOCAL_PATH := $(call my-dir) 20 | 21 | include $(CLEAR_VARS) 22 | LOCAL_MODULE_TAGS := optional 23 | LOCAL_PRELINK_MODULE := false 24 | LOCAL_ARM_MODE := arm 25 | LOCAL_CFLAGS := $(OPENVX_DEFS) 26 | LOCAL_SRC_FILES := vx_extras_module.c \ 27 | vx_filter.c \ 28 | vx_gradients.c \ 29 | vx_nonmax.c \ 30 | vx_harris_score.c \ 31 | vx_listers.c 32 | LOCAL_C_INCLUDES := $(OPENVX_INC) 33 | LOCAL_SHARED_LIBRARIES := libdl libutils libcutils libbinder libhardware libion libgui libui libopenvx 34 | LOCAL_MODULE := libopenvx-extras 35 | include $(BUILD_SHARED_LIBRARY) 36 | 37 | include $(CLEAR_VARS) 38 | LOCAL_MODULE_TAGS := optional 39 | LOCAL_PRELINK_MODULE := false 40 | LOCAL_ARM_MODE := arm 41 | LOCAL_CFLAGS := $(OPENVX_DEFS) 42 | LOCAL_SRC_FILES := vx_extras_lib.c 43 | LOCAL_C_INCLUDES := $(OPENVX_INC) 44 | LOCAL_STATIC_LIBRARIES := libopenvx-helper 45 | LOCAL_MODULE := libopenvx-extras-lib 46 | include $(BUILD_STATIC_LIBRARY) 47 | 48 | -------------------------------------------------------------------------------- /libraries/extras/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2011-2018 The Khronos Group Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | 18 | # set target name 19 | set( TARGET_NAME_1 openvx-extras-lib ) 20 | set( TARGET_NAME_2 openvx-extras ) 21 | 22 | include_directories( BEFORE 23 | ${CMAKE_CURRENT_SOURCE_DIR} 24 | ${VX_HEADER_DIR} 25 | ${CMAKE_SOURCE_DIR}/kernels/extras ) 26 | 27 | if ((WIN32) OR (CYGWIN)) 28 | add_definitions( ${OPENVX_BUILDING_EXPORT_DEF} ) 29 | endif ((WIN32) OR (CYGWIN)) 30 | 31 | # add a target named ${TARGET_NAME} 32 | add_library (${TARGET_NAME_1} vx_extras_lib.c) 33 | 34 | target_link_libraries( ${TARGET_NAME_1} openvx-helper ) 35 | 36 | FIND_SOURCES( vx_extras_lib.c ) 37 | 38 | if ((WIN32) OR (CYGWIN)) 39 | set( DEF_FILE openvx-extras.def ) 40 | endif ((WIN32) OR (CYGWIN)) 41 | 42 | add_library (${TARGET_NAME_2} SHARED ${SOURCE_FILES} ${DEF_FILE}) 43 | 44 | if (CYGWIN) 45 | set_target_properties( ${TARGET_NAME_2} PROPERTIES LINK_FLAGS ${CMAKE_CURRENT_SOURCE_DIR}/${DEF_FILE} ) 46 | endif (CYGWIN) 47 | 48 | target_link_libraries( ${TARGET_NAME_2} openvx-helper openvx-extras_k-lib openvx ) 49 | 50 | install ( TARGETS ${TARGET_NAME_1} ${TARGET_NAME_2} 51 | RUNTIME DESTINATION bin 52 | ARCHIVE DESTINATION bin 53 | LIBRARY DESTINATION bin ) 54 | 55 | set_target_properties( ${TARGET_NAME_1} PROPERTIES FOLDER ${LIBRARIES_EXTRAS_FOLDER} ) 56 | set_target_properties( ${TARGET_NAME_2} PROPERTIES FOLDER ${LIBRARIES_EXTRAS_FOLDER} ) 57 | -------------------------------------------------------------------------------- /libraries/extras/concerto.mak: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | _MODULE := openvx-extras-lib 20 | include $(PRELUDE) 21 | TARGET := openvx-extras-lib 22 | TARGETTYPE := library 23 | CSOURCES := vx_extras_lib.c 24 | STATIC_LIBS := openvx-helper 25 | include $(FINALE) 26 | 27 | _MODULE := openvx-extras 28 | include $(PRELUDE) 29 | TARGET := openvx-extras 30 | TARGETTYPE := dsmo 31 | IDIRS += $(HOST_ROOT)/kernels/extras 32 | DEFFILE := openvx-extras.def 33 | CSOURCES := $(filter-out vx_extras_lib.c,$(call all-c-files)) 34 | STATIC_LIBS := openvx-helper openvx-extras_k-lib 35 | SHARED_LIBS := openvx 36 | include $(FINALE) 37 | 38 | -------------------------------------------------------------------------------- /libraries/extras/openvx-extras.def: -------------------------------------------------------------------------------- 1 | LIBRARY "openvx-extras.dll" 2 | VERSION 1.0 3 | EXPORTS 4 | vxPublishKernels 5 | vxUnpublishKernels 6 | 7 | 8 | -------------------------------------------------------------------------------- /libraries/extras/vx_extras_module.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * Copyright (c) 2012-2017 The Khronos Group Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /*! 19 | * \file 20 | * \brief The Extra Extensions Module Header. 21 | * \author Erik Rainey 22 | */ 23 | 24 | #ifndef _VX_EXTRAS_MODULE_H_ 25 | #define _VX_EXTRAS_MODULE_H_ 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | extern vx_kernel_description_t edge_trace_kernel; 32 | extern vx_kernel_description_t euclidean_nonmaxsuppression_harris_kernel; 33 | extern vx_kernel_description_t harris_score_kernel; 34 | extern vx_kernel_description_t laplacian3x3_kernel; 35 | extern vx_kernel_description_t image_lister_kernel; 36 | extern vx_kernel_description_t nonmaxsuppression_kernel; 37 | extern vx_kernel_description_t norm_kernel; 38 | extern vx_kernel_description_t scharr3x3_kernel; 39 | extern vx_kernel_description_t sobelMxN_kernel; 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif /* _VX_EXTRAS_MODULE_H_ */ 46 | 47 | -------------------------------------------------------------------------------- /raw/bikegray_640x480.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhronosGroup/OpenVX-sample-impl/9caba36a541fa6480f9d65d9a78dde208ebe96f9/raw/bikegray_640x480.pgm -------------------------------------------------------------------------------- /raw/colorbars_640x480_I444.rgb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhronosGroup/OpenVX-sample-impl/9caba36a541fa6480f9d65d9a78dde208ebe96f9/raw/colorbars_640x480_I444.rgb -------------------------------------------------------------------------------- /raw/lena_512x512.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhronosGroup/OpenVX-sample-impl/9caba36a541fa6480f9d65d9a78dde208ebe96f9/raw/lena_512x512.pgm -------------------------------------------------------------------------------- /raw/shapes.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhronosGroup/OpenVX-sample-impl/9caba36a541fa6480f9d65d9a78dde208ebe96f9/raw/shapes.pgm -------------------------------------------------------------------------------- /raw/superresFirst_3072x2048_UYVY.yuv: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ef056b0db928fc66c4c24e82c724c35ab55df13b19bf4c65b28fdd3afe69eecc 3 | size 12582912 4 | -------------------------------------------------------------------------------- /raw/superresSecond_3072x2048_UYVY.yuv: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:26607518eb41a42c3746cad6e946b80dcbb899ab7d79eab08c005381a81849d8 3 | size 12582912 4 | -------------------------------------------------------------------------------- /sample/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | include $(call all-subdir-makefiles) 20 | 21 | -------------------------------------------------------------------------------- /sample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2011-2017 The Khronos Group Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | add_subdirectory( include ) 18 | add_subdirectory( framework ) 19 | add_subdirectory( targets ) 20 | add_subdirectory( tests ) 21 | add_subdirectory( vxu ) 22 | 23 | if (OPENVX_USE_NN) 24 | add_subdirectory( cnn ) 25 | endif (OPENVX_USE_NN) 26 | 27 | -------------------------------------------------------------------------------- /sample/application/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Copyright (c) 2012-2017 The Khronos Group Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | LOCAL_PATH:= $(call my-dir) 20 | include $(CLEAR_VARS) 21 | LOCAL_MODULE_TAGS := optional 22 | LOCAL_SRC_FILES := $(call all-java-files-under, src) 23 | LOCAL_STATIC_JAVA_LIBRARIES := org.khronos.openvx 24 | LOCAL_JNI_SHARED_LIBRARIES := libopenvx_jni 25 | LOCAL_PACKAGE_NAME := OpenVXActivity 26 | LOCAL_CERTIFICATE := platform 27 | LOCAL_SDK_VERSION := current 28 | LOCAL_PROGUARD_FLAG_FILES := procfg.txt 29 | LOCAL_PROGUARD_ENABLED := disabled 30 | include $(BUILD_PACKAGE) 31 | -------------------------------------------------------------------------------- /sample/application/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | -------------------------------------------------------------------------------- /sample/application/default.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | -------------------------------------------------------------------------------- /sample/application/procfg.txt: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | #-keep public class com.android.vending.licensing.ILicensingService 14 | 15 | -keepclasseswithmembernames class * { 16 | native ; 17 | } 18 | 19 | -keepclasseswithmembernames class * { 20 | public (android.content.Context, android.util.AttributeSet); 21 | } 22 | 23 | -keepclasseswithmembernames class * { 24 | public (android.content.Context, android.util.AttributeSet, int); 25 | } 26 | 27 | -keepclassmembers enum * { 28 | public static **[] values(); 29 | public static ** valueOf(java.lang.String); 30 | } 31 | 32 | -------------------------------------------------------------------------------- /sample/application/res/drawable/app_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhronosGroup/OpenVX-sample-impl/9caba36a541fa6480f9d65d9a78dde208ebe96f9/sample/application/res/drawable/app_logo.png -------------------------------------------------------------------------------- /sample/application/res/layout-land/skeleton_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 22 | 23 | 28 | 29 |