Skip to content

Commit

Permalink
Adsk contrib - Add support for neon intrinsic integration (#1828)
Browse files Browse the repository at this point in the history
* Merging the previous ARM Neon branch

Signed-off-by: Cédrik Fuoco <[email protected]>

* Testing each SIMD variants using a small code snippet and first pass on unifying the way related cmake variables

Signed-off-by: Cédrik Fuoco <[email protected]>

* Removing the usage of USE_SSE in favor of the new OCIO_USE_SSE2 as they serve the same purpose

Signed-off-by: Cédrik Fuoco <[email protected]>

* Using try_compile instead of check_cxx_source_compiles as it was given false positive.  Stubbing cpuinfo for Apple ARM plateform. Handling Apple M1 correctly and adding support for SSE2NEON.

Signed-off-by: Cédrik Fuoco <[email protected]>

* Comments clean up and refactor some comments and documentations

Signed-off-by: Cédrik Fuoco <[email protected]>

* Added something in the documentation for Rosetta and small change in cmake

Signed-off-by: Cédrik Fuoco <[email protected]>

* Fixing the build under Rosetta and fixing issue in the MacOS CI.

Signed-off-by: Cédrik Fuoco <[email protected]>

* Using try_compile for CheckSupportSSEUsingSSE2NEON to standardize the code and fixed CheckSupport compiler flags.

Signed-off-by: Cédrik Fuoco <[email protected]>

* use emmintrin.h for only sse2 features

Signed-off-by: Mark Reid <[email protected]>
Signed-off-by: Cédrik Fuoco <[email protected]>

* Allow F16C to be completely turned off

Signed-off-by: Mark Reid <[email protected]>
Signed-off-by: Cédrik Fuoco <[email protected]>

* Seperate SIMD test code from code that adds unit tests.

This isolates the compulation units and
avoids executing illegal hardware instructions

Signed-off-by: Mark Reid <[email protected]>
Signed-off-by: Cédrik Fuoco <[email protected]>

* remove uneeded checks

Signed-off-by: Cédrik Fuoco <[email protected]>

* use software implementations of f16c intrinsics for SSE2

Signed-off-by: Cédrik Fuoco <[email protected]>

* Added preprocessor checks for ARM as it is needed for universal build on APPLE platform

Signed-off-by: Cédrik Fuoco <[email protected]>

* Adding missing checks for "not arm64"

Signed-off-by: Cédrik Fuoco <[email protected]>

* Ease the future maintainability a the new OCIO_USE_xyz be moving the logic into CPUInfoConfig.h.in as well as fixing issue on ARM when building with OCIO_USE_SSE2NEON=OFF.

Signed-off-by: Cédrik Fuoco <[email protected]>

* Fixing some spacing, documentations and making some cmake conditions clearer.

Signed-off-by: Cédrik Fuoco <[email protected]>

* Adding a build in ci_workflow for macos USE_OCIO_SSE2NEON=OFF

Signed-off-by: Cédrik Fuoco <[email protected]>

* typo

Signed-off-by: Cédrik Fuoco <[email protected]>

* Changing back all the macOS (except one) builds to x86_64 only as it takes double the time to do the universal build.
OCIO no longuer build a universal binary by default

Signed-off-by: Cédrik Fuoco <[email protected]>

* Update the CMakeLists.txt logic to accomodate all scenario and fixing documentations.

Signed-off-by: Cédrik Fuoco <[email protected]>

* Update documentation and remove ocio_use_sse2neon from the CI matrix

Signed-off-by: Cédrik Fuoco <[email protected]>

---------

Signed-off-by: Cédrik Fuoco <[email protected]>
Signed-off-by: Mark Reid <[email protected]>
Signed-off-by: Cédrik Fuoco <[email protected]>
Co-authored-by: Mark Reid <[email protected]>
Co-authored-by: Doug Walker <[email protected]>
  • Loading branch information
3 people committed Sep 1, 2023
1 parent f885f83 commit caa20dd
Show file tree
Hide file tree
Showing 67 changed files with 1,813 additions and 588 deletions.
73 changes: 45 additions & 28 deletions .github/workflows/ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
<${{ matrix.compiler-desc }}
config=${{ matrix.build-type }},
shared=${{ matrix.build-shared }},
sse=${{ matrix.use-sse }},
simd=${{ matrix.use-simd }},
cxx=${{ matrix.cxx-standard }},
docs=${{ matrix.build-docs }},
oiio=${{ matrix.use-oiio }}>'
Expand All @@ -70,7 +70,7 @@ jobs:
build-shared: 'ON'
build-docs: 'OFF'
build-openfx: 'ON'
use-sse: 'ON'
use-simd: 'ON'
use-oiio: 'ON'
cxx-standard: 17
cxx-compiler: clang++
Expand All @@ -82,7 +82,7 @@ jobs:
build-shared: 'ON'
build-docs: 'ON'
build-openfx: 'ON'
use-sse: 'OFF'
use-simd: 'OFF'
use-oiio: 'OFF'
cxx-standard: 17
cxx-compiler: g++
Expand All @@ -94,7 +94,7 @@ jobs:
build-shared: 'OFF'
build-docs: 'OFF'
build-openfx: 'OFF'
use-sse: 'ON'
use-simd: 'ON'
use-oiio: 'OFF'
cxx-standard: 11
cxx-compiler: g++
Expand All @@ -109,7 +109,7 @@ jobs:
build-shared: 'ON'
build-docs: 'OFF'
build-openfx: 'ON'
use-sse: 'ON'
use-simd: 'ON'
use-oiio: 'ON'
cxx-standard: 17
cxx-compiler: clang++
Expand All @@ -121,7 +121,7 @@ jobs:
build-shared: 'ON'
build-docs: 'ON'
build-openfx: 'ON'
use-sse: 'OFF'
use-simd: 'OFF'
use-oiio: 'OFF'
cxx-standard: 17
cxx-compiler: g++
Expand All @@ -133,7 +133,7 @@ jobs:
build-shared: 'OFF'
build-docs: 'OFF'
build-openfx: 'OFF'
use-sse: 'ON'
use-simd: 'ON'
use-oiio: 'OFF'
cxx-standard: 11
cxx-compiler: g++
Expand All @@ -148,7 +148,7 @@ jobs:
build-shared: 'ON'
build-docs: 'OFF'
build-openfx: 'OFF'
use-sse: 'ON'
use-simd: 'ON'
use-oiio: 'ON'
cxx-standard: 17
cxx-compiler: clang++
Expand All @@ -160,7 +160,7 @@ jobs:
build-shared: 'OFF'
build-docs: 'OFF'
build-openfx: 'ON'
use-sse: 'OFF'
use-simd: 'OFF'
use-oiio: 'OFF'
cxx-standard: 14
cxx-compiler: clang++
Expand All @@ -172,7 +172,7 @@ jobs:
build-shared: 'ON'
build-docs: 'OFF'
build-openfx: 'OFF'
use-sse: 'ON'
use-simd: 'ON'
use-oiio: 'OFF'
cxx-standard: 11
cxx-compiler: g++
Expand All @@ -187,7 +187,7 @@ jobs:
build-shared: 'ON'
build-docs: 'OFF'
build-openfx: 'ON'
use-sse: 'OFF'
use-simd: 'OFF'
use-oiio: 'OFF'
cxx-standard: 14
cxx-compiler: clang++
Expand All @@ -199,7 +199,7 @@ jobs:
build-shared: 'OFF'
build-docs: 'OFF'
build-openfx: 'ON'
use-sse: 'ON'
use-simd: 'ON'
use-oiio: 'ON'
cxx-standard: 14
cxx-compiler: g++
Expand All @@ -211,7 +211,7 @@ jobs:
build-shared: 'ON'
build-docs: 'OFF'
build-openfx: 'OFF'
use-sse: 'ON'
use-simd: 'ON'
use-oiio: 'OFF'
cxx-standard: 11
cxx-compiler: g++
Expand Down Expand Up @@ -243,7 +243,7 @@ jobs:
-DOCIO_BUILD_DOCS=${{ matrix.build-docs }} \
-DOCIO_BUILD_OPENFX=${{ matrix.build-openfx }} \
-DOCIO_BUILD_GPU_TESTS=OFF \
-DOCIO_USE_SSE=${{ matrix.use-sse }} \
-DOCIO_USE_SIMD=${{ matrix.use-simd }} \
-DOCIO_USE_OIIO_FOR_APPS=${{ matrix.use-oiio }} \
-DOCIO_INSTALL_EXT_PACKAGES=ALL \
-DOCIO_WARNING_AS_ERROR=ON \
Expand Down Expand Up @@ -306,9 +306,10 @@ jobs:
macos:
name: 'macOS 11
<AppleClang
arch=${{ matrix.arch-type }},
config=${{ matrix.build-type }},
shared=${{ matrix.build-shared }},
sse=${{ matrix.use-sse }},
simd=${{ matrix.use-simd }},
cxx=${{ matrix.cxx-standard }},
python=${{ matrix.python-version }},
docs=${{ matrix.build-docs }},
Expand All @@ -322,39 +323,54 @@ jobs:
matrix:
build: [1, 2, 3, 4]
include:
- build: 4
- build: 5
arch-type: "x86_64"
build-type: Release
build-shared: 'ON'
build-docs: 'OFF'
build-openfx: 'ON'
use-sse: 'ON'
use-simd: 'ON'
use-oiio: 'ON'
cxx-standard: 17
python-version: '3.11'
# Keeping one universal build
- build: 4
arch-type: "x86_64;arm64"
build-type: Release
build-shared: 'ON'
build-docs: 'OFF'
build-openfx: 'OFF'
use-simd: 'ON'
use-oiio: 'OFF'
cxx-standard: 11
python-version: '3.10'
- build: 3
arch-type: "x86_64"
build-type: Release
build-shared: 'ON'
build-docs: 'ON'
build-openfx: 'OFF'
use-sse: 'OFF'
use-simd: 'OFF'
use-oiio: 'OFF'
cxx-standard: 11
python-version: '3.10'
- build: 2
arch-type: "x86_64"
build-type: Debug
build-shared: 'ON'
build-docs: 'OFF'
build-openfx: 'ON'
use-sse: 'ON'
use-simd: 'ON'
use-oiio: 'OFF'
cxx-standard: 11
python-version: '3.9'
- build: 1
arch-type: "x86_64"
build-type: Release
build-shared: 'OFF'
build-docs: 'OFF'
build-openfx: 'ON'
use-sse: 'ON'
use-simd: 'ON'
use-oiio: 'OFF'
cxx-standard: 14
python-version: '3.7'
Expand Down Expand Up @@ -384,11 +400,12 @@ jobs:
-DOCIO_BUILD_DOCS=${{ matrix.build-docs }} \
-DOCIO_BUILD_OPENFX=${{ matrix.build-openfx }} \
-DOCIO_BUILD_GPU_TESTS=OFF \
-DOCIO_USE_SSE=${{ matrix.use-sse }} \
-DOCIO_USE_SIMD=${{ matrix.use-simd }} \
-DOCIO_USE_OIIO_FOR_APPS=${{ matrix.use-oiio }} \
-DOCIO_INSTALL_EXT_PACKAGES=ALL \
-DOCIO_WARNING_AS_ERROR=ON \
-DPython_EXECUTABLE=$(which python)
-DPython_EXECUTABLE=$(which python) \
-DCMAKE_OSX_ARCHITECTURES="${{ matrix.arch-type }}"
working-directory: _build
- name: Build
run: |
Expand Down Expand Up @@ -451,7 +468,7 @@ jobs:
<MSVC
config=${{ matrix.build-type }},
shared=${{ matrix.build-shared }},
sse=${{ matrix.use-sse }},
simd=${{ matrix.use-simd }},
cxx=${{ matrix.cxx-standard }},
python=${{ matrix.python-version }},
docs=${{ matrix.build-docs }},
Expand All @@ -470,7 +487,7 @@ jobs:
build-shared: 'ON'
build-docs: 'OFF'
build-openfx: 'ON'
use-sse: 'OFF'
use-simd: 'OFF'
use-oiio: 'ON'
cxx-standard: 17
python-version: '3.11'
Expand All @@ -479,7 +496,7 @@ jobs:
build-shared: 'OFF'
build-docs: 'OFF'
build-openfx: 'OFF'
use-sse: 'ON'
use-simd: 'ON'
use-oiio: 'OFF'
cxx-standard: 11
python-version: '3.9'
Expand All @@ -488,7 +505,7 @@ jobs:
build-shared: 'ON'
build-docs: 'OFF'
build-openfx: 'OFF'
use-sse: 'ON'
use-simd: 'ON'
use-oiio: 'OFF'
cxx-standard: 11
python-version: '3.8'
Expand All @@ -498,7 +515,7 @@ jobs:
build-shared: 'ON'
build-docs: 'OFF'
build-openfx: 'ON'
use-sse: 'ON'
use-simd: 'ON'
use-oiio: 'OFF'
cxx-standard: 14
python-version: '3.7'
Expand Down Expand Up @@ -532,7 +549,7 @@ jobs:
-DOCIO_BUILD_DOCS=${{ matrix.build-docs }} \
-DOCIO_BUILD_OPENFX=${{ matrix.build-openfx }} \
-DOCIO_BUILD_GPU_TESTS=OFF \
-DOCIO_USE_SSE=${{ matrix.use-sse }} \
-DOCIO_USE_SIMD=${{ matrix.use-simd }} \
-DOCIO_USE_OIIO_FOR_APPS=${{ matrix.use-oiio }} \
-DOCIO_INSTALL_EXT_PACKAGES=ALL \
-DOCIO_WARNING_AS_ERROR=ON \
Expand Down
Loading

0 comments on commit caa20dd

Please sign in to comment.