opencv/modules/core/src
Francesco Petrogalli d29c7e7871
Merge pull request #20392 from fpetrogalli:aarch64-semihosting
AArch64 semihosting

* [ts] Disable filesystem support in the TS module.

Because of this change, all the tests loading data will file, but tat
least the core module can be tested with the following line:

    opencv_test_core --gtest_filter=-"*Core_InputOutput*:*Core_globbing.accuracy*"

* [aarch64] Build OpenCV for AArch64 semihosting.

This patch provide a toolchain file that allows to build the library
for semihosting applications [1]. Minimal changes have been applied to
the code to be able to compile with a baremetal toolchain.

[1] https://developer.arm.com/documentation/100863/latest

The option `CV_SEMIHOSTING` is used to guard the bits in the code that
are specific to the target.

To build the code:

    cmake ../opencv/ \
        -DCMAKE_TOOLCHAIN_FILE=../opencv/platforms/semihosting/aarch64-semihosting.toolchain.cmake \
        -DSEMIHOSTING_TOOLCHAIN_PATH=/path/to/baremetal-toolchain/bin/ \
        -DBUILD_EXAMPLES=ON -GNinja

A barematel toolchain for targeting aarch64 semihosting can be found
at [2], under `aarch64-none-elf`.

[2] https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads

The folder `samples/semihosting` provides two example semihosting
applications.

The two binaries can be executed on the host platform with:

    qemu-aarch64 ./bin/example_semihosting_histogram
    qemu-aarch64 ./bin/example_semihosting_norm

Similarly, the test and perf executables of the modules can be run
with:

    qemu-aarch64 ./bin/opecv_[test|perf]_<module>

Notice that filesystem support is disabled by the toolchain file,
hence some of the test that depend on filesystem support will fail.

* [semihosting] Remove blank like at the end of file. [NFC]

The spurious blankline was reported by
https://pullrequest.opencv.org/buildbot/builders/precommit_docs/builds/31158.

* [semihosting] Make the raw pixel file generation OS independent.

Use the facilities provided by Cmake to generate the header file
instead of a shell script, so that the build doesn't fail on systems
that do not have a unix shell.

* [semihosting] Rename variable for semihosting compilation.

* [semihosting] Move the cmake configuration to a variable file.

* [semihosting] Make the guard macro private for the core module.

* [semihosting] Remove space. [NFC]

* [semihosting] Improve comment with information about semihosting. [NFC]

* [semihosting] Update license statement on top of sourvce file. [NFC]

* [semihosting] Replace BM_SUFFIX with SEMIHOSTING_SUFFIX. [NFC]

* [semihosting] Remove double space. [NFC]

* [semihosting] Add some text output to the sample applications.

* [semihosting] Remove duplicate entry in cmake configuration. [NFCI]

* [semihosting] Replace `long` with `int` in sample apps. [NFCI]

* [semihosting] Use `configure_file` to create the random pixels. [NFCI]

* [semihosting][bugfix] Fix name of cmakedefine variable.

* [semihosting][samples] Use CV_8UC1 for grayscale images. [NFCI]

* [semihosting] Add readme file.

* [semihosting] Remove blank like at the end of README. [NFC]

This fixes the failure at
https://pullrequest.opencv.org/buildbot/builders/precommit_docs/builds/31272.
2021-07-21 18:46:05 +03:00
..
cuda Merge pull request #19259 from nglee:dev_gpumatnd1 2021-02-05 20:30:37 +00:00
opencl Merge pull request #20203 from JoeHowse:clMath-patches 2021-06-07 20:24:27 +00:00
parallel core(parallel): fix plugins handling if no filesystem available 2021-03-18 23:05:12 +00:00
utils Merge pull request #19985 from fpetrogalli:disable_threads 2021-07-08 20:21:21 +00:00
algorithm.cpp Python: wrap Algorithm::read and Algorithm::write 2017-11-27 17:04:56 +01:00
alloc.cpp add windows native aligned malloc + unit test case 2020-12-23 14:59:28 +01:00
arithm_ipp.hpp core: reimplement SIMD arithmetic, logic and comparison operations into wide universal intrinsics 2018-10-30 12:48:31 +02:00
arithm.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-04-01 09:54:57 +00:00
arithm.dispatch.cpp core: reimplement SIMD arithmetic, logic and comparison operations into wide universal intrinsics 2018-10-30 12:48:31 +02:00
arithm.simd.hpp Merge pull request #19778 from damonyu1989:master-riscv-0.7.1 2021-05-25 20:15:12 +03:00
array.cpp core: rework code locality 2021-03-02 23:24:28 +00:00
async.cpp Merge pull request #19985 from fpetrogalli:disable_threads 2021-07-08 20:21:21 +00:00
batch_distance.cpp remove non-ideal pairs when using crosscheck in batchdistance 2018-10-26 20:25:24 +00:00
bindings_utils.cpp Merge pull request #19668 from asmorkalov:as/filesystem_py 2021-03-04 16:17:57 +00:00
buffer_area.cpp core(buffer_area): handle 'OPENCV_ENABLE_MEMORY_SANITIZER=ON' case 2020-03-16 19:34:08 +03:00
bufferpool.impl.hpp Utilize CV_UNUSED macro 2018-09-07 20:33:52 +09:00
channels.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-10-26 17:56:55 +03:00
check.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-02-26 20:09:03 +03:00
command_line_parser.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-10 20:50:26 +00:00
conjugate_gradient.cpp opencv: Use cv::AutoBuffer<>::data() 2018-07-04 19:11:29 +03:00
convert_c.cpp core: rework code locality 2021-03-02 23:24:28 +00:00
convert_scale.dispatch.cpp core: rework code locality 2021-03-02 23:24:28 +00:00
convert_scale.simd.hpp Fix spelling typos 2019-12-27 12:46:53 +00:00
convert.dispatch.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-12-17 21:05:34 +00:00
convert.hpp added basic support for CV_16F (the new datatype etc.) (#12463) 2018-09-10 16:56:29 +03:00
convert.simd.hpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-11-17 21:56:26 +00:00
copy.cpp core: rework code locality 2021-03-02 23:24:28 +00:00
count_non_zero.dispatch.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-12-04 18:26:58 +00:00
count_non_zero.simd.hpp core: vectorize countNonZero64f 2019-10-11 09:02:46 -05:00
cuda_gpu_mat_nd.cpp Merge pull request #19259 from nglee:dev_gpumatnd1 2021-02-05 20:30:37 +00:00
cuda_gpu_mat.cpp Utilize CV_UNUSED macro 2018-09-07 20:33:52 +09:00
cuda_host_mem.cpp build: fix warnings 2019-03-05 14:47:04 +03:00
cuda_info.cpp Utilize CV_UNUSED macro 2018-09-07 20:33:52 +09:00
cuda_stream.cpp add cuda::Stream constructor with cuda flags 2021-01-28 16:14:01 +01:00
datastructs.cpp core: rework code locality 2021-03-02 23:24:28 +00:00
directx.cpp DirectX: Support more types, including float16 2021-06-11 00:55:06 -03:00
directx.inc.hpp Merge pull request #13972 from Mainvooid:add_cuda_support_for_D3D11_interop 2019-03-24 18:34:09 +03:00
downhill_simplex.cpp Fix spelling typos 2019-12-27 12:46:53 +00:00
dxt.cpp Merge pull request #20203 from JoeHowse:clMath-patches 2021-06-07 20:24:27 +00:00
gl_core_3_1.cpp build: unreachable code after CV_Error() (part 2) 2018-04-24 16:03:40 +03:00
gl_core_3_1.hpp
glob.cpp [build][option] Build option to disable filesystem support. 2021-05-11 12:54:54 +00:00
hal_internal.cpp core: include version.hpp in cvdef.h, fix precomp.hpp usage 2021-02-16 11:10:45 +00:00
hal_internal.hpp core: include version.hpp in cvdef.h, fix precomp.hpp usage 2021-02-16 11:10:45 +00:00
hal_replacement.hpp HAL for minMaxIdx 2017-12-22 12:56:52 +03:00
intel_gpu_gemm.inl.hpp Merge pull request #20203 from JoeHowse:clMath-patches 2021-06-07 20:24:27 +00:00
kmeans.cpp core(kmeans): bailout if can't select cluster center 2019-11-22 14:40:02 +00:00
lapack.cpp core: rework code locality 2021-03-02 23:24:28 +00:00
lda.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-04-01 18:11:55 +03:00
logger.cpp core(logger): avoid destruction of GlobalLoggingInitStruct object 2020-10-06 12:50:32 +00:00
lpsolver.cpp core: update solveLP() interface 2018-10-15 18:58:11 +00:00
lut.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-10 20:50:26 +00:00
mathfuncs_core.dispatch.cpp core(IPP): disable some ippsMagnitude_32f calls 2021-03-31 13:38:57 +00:00
mathfuncs_core.simd.hpp Merge pull request #16236 from alalek:fix_core_simd_emulator 2020-01-10 21:31:02 +03:00
mathfuncs.cpp core: rework code locality 2021-03-02 23:24:28 +00:00
mathfuncs.hpp core: move const tables outside of dispatched code 2018-08-08 17:54:54 +03:00
matmul.dispatch.cpp Merge pull request #20203 from JoeHowse:clMath-patches 2021-06-07 20:24:27 +00:00
matmul.simd.hpp [cv::transform] Enable CV_SIMD for the 16U case on AArch64. 2020-12-20 15:58:21 +00:00
matrix_c.cpp core: rework code locality 2021-03-02 23:24:28 +00:00
matrix_decomp.cpp Add semicolons after CV_INSTRUMENT macros 2018-09-14 06:45:31 +09:00
matrix_expressions.cpp core(MatExpr): fix warning in case of e.s == (0, 0, 0, 0) 2020-05-01 07:29:57 +00:00
matrix_iterator.cpp core: include version.hpp in cvdef.h, fix precomp.hpp usage 2021-02-16 11:10:45 +00:00
matrix_operations.cpp add usageFlags to UMat static factories 2021-06-23 18:50:33 +02:00
matrix_sparse.cpp core: include version.hpp in cvdef.h, fix precomp.hpp usage 2021-02-16 11:10:45 +00:00
matrix_transform.cpp Merge pull request #18952 from terfendail:wui_doc 2021-03-30 16:18:03 +00:00
matrix_wrap.cpp core: rework code locality 2021-03-02 23:24:28 +00:00
matrix.cpp noexcept def construct Mat, UMat, Mat_, MatSize, MatStep 2021-03-12 20:26:32 +00:00
mean.dispatch.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-08-05 18:11:43 +00:00
mean.simd.hpp core: dispatch mean.cpp 2019-02-19 16:58:32 +03:00
merge.dispatch.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-02-26 17:34:42 +03:00
merge.simd.hpp core: dispatch merge.cpp 2019-02-23 15:42:26 +00:00
minmax.cpp Merge pull request #16754 from alalek:issue_16752 2020-03-07 19:06:47 +00:00
norm.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-06-19 18:44:16 +00:00
ocl_disabled.impl.hpp Merge pull request #19755 from mikhail-nikolskiy:ffmpeg-umat 2021-05-14 16:48:50 +00:00
ocl.cpp OpenCL: core support for FP16, more channel orders 2021-06-30 14:14:37 -03:00
opengl.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-12-17 21:05:34 +00:00
out.cpp Merge pull request #12310 from cv3d:chunks/enum_interface 2018-09-21 18:12:35 +03:00
ovx.cpp Fixed compilation on windows with openvx 2020-01-06 06:32:56 +03:00
parallel_impl.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-02-12 21:34:49 +00:00
parallel_impl.hpp core: fix pthreads performance 2018-01-26 04:09:11 +00:00
parallel.cpp Merge pull request #20392 from fpetrogalli:aarch64-semihosting 2021-07-21 18:46:05 +03:00
pca.cpp Add semicolons after CV_INSTRUMENT macros 2018-09-14 06:45:31 +09:00
persistence_base64_encoding.cpp port base64 encoding from 3.4 2021-07-08 10:42:44 +03:00
persistence_base64_encoding.hpp port base64 encoding from 3.4 2021-07-08 10:42:44 +03:00
persistence_impl.hpp port base64 encoding from 3.4 2021-07-08 10:42:44 +03:00
persistence_json.cpp port base64 encoding from 3.4 2021-07-08 10:42:44 +03:00
persistence_types.cpp refactoring catching all exceptions as const ref 2018-11-08 19:59:47 +03:00
persistence_xml.cpp port base64 encoding from 3.4 2021-07-08 10:42:44 +03:00
persistence_yml.cpp port base64 encoding from 3.4 2021-07-08 10:42:44 +03:00
persistence.cpp port base64 encoding from 3.4 2021-07-08 10:42:44 +03:00
persistence.hpp port base64 encoding from 3.4 2021-07-08 10:42:44 +03:00
precomp.hpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-04-15 20:50:26 +00:00
rand.cpp core: rework code locality 2021-03-02 23:24:28 +00:00
softfloat.cpp core: fix UBSAN in softfloat 2019-09-27 16:29:50 +03:00
split.dispatch.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-02-26 17:34:42 +03:00
split.simd.hpp core: dispatch split.cpp 2019-02-22 09:54:31 +00:00
stat_c.cpp core: rework code locality 2021-03-02 23:24:28 +00:00
stat.dispatch.cpp Add semicolons after CV_INSTRUMENT macros 2018-09-14 06:45:31 +09:00
stat.hpp Split stat.cpp into smaller pieces 2018-02-12 14:14:08 +03:00
stat.simd.hpp Merge pull request #15402 from ChipKerchner:normUnroll 2019-08-31 11:10:05 +00:00
stl.cpp core: get rid of built-in String type 2018-08-27 14:42:18 +03:00
sum.dispatch.cpp Merge pull request #16754 from alalek:issue_16752 2020-03-07 19:06:47 +00:00
sum.simd.hpp core: dispatch sum 2019-02-13 18:17:38 +03:00
system.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-07-16 10:35:42 +00:00
tables.cpp
trace.cpp core(trace): lazy quering for OPENCV_TRACE_LOCATION 2020-08-20 21:48:05 +00:00
types.cpp Add semicolons after CV_INSTRUMENT macros 2018-09-14 06:45:31 +09:00
umatrix.cpp Merge pull request #19985 from fpetrogalli:disable_threads 2021-07-08 20:21:21 +00:00
umatrix.hpp core(ocl): fix deadlock in UMatDataAutoLock 2018-01-16 17:33:06 +03:00
va_intel.cpp Merge pull request #19755 from mikhail-nikolskiy:ffmpeg-umat 2021-05-14 16:48:50 +00:00
va_wrapper.impl.hpp core(libva): use dynamic loader 2021-02-19 10:32:59 +00:00