Skip to content

Commit

Permalink
Create RB-2.3.2 release (#1940)
Browse files Browse the repository at this point in the history
* Fix ssse3 detection typo (#1929)

Signed-off-by: Mark Reid <mindmark@gmail.com>
(cherry picked from commit 003b6a1)
Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* fix: use system `include pystring.h` for `ConfigUtils.cpp` (#1921)

Signed-off-by: Rui Chen <rui@chenrui.dev>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit e747e9c)
Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Fix narrowing conversion error on riscv64 (#1924)

Signed-off-by: phancb <nxhsdu@qq.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit a95febc)
Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Add manylinux_2_28 Python wheels (#1933)

Signed-off-by: Rémi Achard <remiachard@gmail.com>
Co-authored-by: Michael Dolan <michdolan@gmail.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit f925099)
Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Enhance ociochecklut to print the output after each step in a multi-t… (#1925)

* Enhance ociochecklut to print the output after each step in a multi-transform LUT

Signed-off-by: pylee <penne.y.lee@intel.com>

* Review feedback to enable printe of transforms list when using -s flag.

Signed-off-by: pylee <penne.y.lee@intel.com>

* Print transform description for each step instead.

Signed-off-by: pylee <penne.y.lee@intel.com>

---------

Signed-off-by: pylee <penne.y.lee@intel.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit aadf595)
Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Fix AVX instructions used on CPUs that don't support them (#1935)

* Fix AVX instructions used on CPUs that don't support them

It's supposed to check all bits are enabled, not just one of them.
This causes a crash using OpenColorIO on older CPUs.

Thanks to Ray Molenkamp for help tracking this down.

Signed-off-by: Brecht Van Lommel <brecht@blender.org>

* Fix another case pointed out in review

Signed-off-by: Brecht Van Lommel <brecht@blender.org>

---------

Signed-off-by: Brecht Van Lommel <brecht@blender.org>
(cherry picked from commit 0c90ded)
Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Increment library version to 2.3.2

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

---------

Signed-off-by: Mark Reid <mindmark@gmail.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Rui Chen <rui@chenrui.dev>
Signed-off-by: phancb <nxhsdu@qq.com>
Signed-off-by: Rémi Achard <remiachard@gmail.com>
Signed-off-by: pylee <penne.y.lee@intel.com>
Signed-off-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: Mark Reid <mindmark@gmail.com>
Co-authored-by: Rui Chen <rui@chenrui.dev>
Co-authored-by: phanium <91544758+phanen@users.noreply.github.com>
Co-authored-by: Rémi Achard <remiachard@gmail.com>
Co-authored-by: Michael Dolan <michdolan@gmail.com>
Co-authored-by: PenneLee <penne.y.lee@intel.com>
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
  • Loading branch information
8 people committed Jan 30, 2024
1 parent 92db29b commit fa52192
Show file tree
Hide file tree
Showing 8 changed files with 196 additions and 71 deletions.
69 changes: 55 additions & 14 deletions .github/workflows/wheel_workflow.yml
Expand Up @@ -78,45 +78,84 @@ jobs:
matrix:
include:
# -------------------------------------------------------------------
# CPython 64 bits
# CPython 64 bits manylinux_2_28
# -------------------------------------------------------------------
- build: CPython 3.7 64 bits
- build: CPython 3.7 64 bits manylinux_2_28
manylinux: manylinux_2_28
python: cp37-manylinux*
arch: x86_64
- build: CPython 3.8 64 bits
- build: CPython 3.8 64 bits manylinux_2_28
manylinux: manylinux_2_28
python: cp38-manylinux*
arch: x86_64
- build: CPython 3.9 64 bits
- build: CPython 3.9 64 bits manylinux_2_28
manylinux: manylinux_2_28
python: cp39-manylinux*
arch: x86_64
- build: CPython 3.10 64 bits
- build: CPython 3.10 64 bits manylinux_2_28
manylinux: manylinux_2_28
python: cp310-manylinux*
arch: x86_64
- build: CPython 3.11 64 bits
- build: CPython 3.11 64 bits manylinux_2_28
manylinux: manylinux_2_28
python: cp311-manylinux*
arch: x86_64
- build: CPython 3.12 64 bits
- build: CPython 3.12 64 bits manylinux_2_28
manylinux: manylinux_2_28
python: cp312-manylinux*
arch: x86_64
# -------------------------------------------------------------------
# CPython ARM 64 bits
# CPython 64 bits manylinux2014
# -------------------------------------------------------------------
- build: CPython 3.7 ARM 64 bits
- build: CPython 3.7 64 bits manylinux2014
manylinux: manylinux2014
python: cp37-manylinux*
arch: x86_64
- build: CPython 3.8 64 bits manylinux2014
manylinux: manylinux2014
python: cp38-manylinux*
arch: x86_64
- build: CPython 3.9 64 bits manylinux2014
manylinux: manylinux2014
python: cp39-manylinux*
arch: x86_64
- build: CPython 3.10 64 bits manylinux2014
manylinux: manylinux2014
python: cp310-manylinux*
arch: x86_64
- build: CPython 3.11 64 bits manylinux2014
manylinux: manylinux2014
python: cp311-manylinux*
arch: x86_64
- build: CPython 3.12 64 bits manylinux2014
manylinux: manylinux2014
python: cp312-manylinux*
arch: x86_64
# -------------------------------------------------------------------
# CPython ARM 64 bits manylinux2014
# -------------------------------------------------------------------
- build: CPython 3.7 ARM 64 bits manylinux2014
manylinux: manylinux2014
python: cp37-manylinux*
arch: aarch64
- build: CPython 3.8 ARM 64 bits
- build: CPython 3.8 ARM 64 bits manylinux2014
manylinux: manylinux2014
python: cp38-manylinux*
arch: aarch64
- build: CPython 3.9 ARM 64 bits
- build: CPython 3.9 ARM 64 bits manylinux2014
manylinux: manylinux2014
python: cp39-manylinux*
arch: aarch64
- build: CPython 3.10 ARM 64 bits
- build: CPython 3.10 ARM 64 bits manylinux2014
manylinux: manylinux2014
python: cp310-manylinux*
arch: aarch64
- build: CPython 3.11 ARM 64 bits
- build: CPython 3.11 ARM 64 bits manylinux2014
manylinux: manylinux2014
python: cp311-manylinux*
arch: aarch64
- build: CPython 3.12 ARM 64 bits
- build: CPython 3.12 ARM 64 bits manylinux2014
manylinux: manylinux2014
python: cp312-manylinux*
arch: aarch64

Expand All @@ -138,6 +177,8 @@ jobs:
env:
CIBW_BUILD: ${{ matrix.python }}
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux }}
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.manylinux }}

- uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -29,7 +29,7 @@ endif()
# Project definition.

project(OpenColorIO
VERSION 2.3.1
VERSION 2.3.2
DESCRIPTION "OpenColorIO (OCIO) is a complete color management solution"
HOMEPAGE_URL https://github.com/AcademySoftwareFoundation/OpenColorIO
LANGUAGES CXX C)
Expand Down
4 changes: 0 additions & 4 deletions pyproject.toml
Expand Up @@ -26,10 +26,6 @@ test-command = [
"ociocheck"
]

manylinux-x86_64-image = "manylinux2014"
manylinux-i686-image = "manylinux2014"
manylinux-aarch64-image = "manylinux2014"

[tool.cibuildwheel.linux]
before-build = "share/ci/scripts/linux/yum/install_docs_env.sh"

Expand Down
2 changes: 1 addition & 1 deletion share/cmake/utils/CheckSupportSSSE3.cmake
Expand Up @@ -13,7 +13,7 @@ endif()

# MSVC doesn't have flags
if(USE_GCC OR USE_CLANG)
set(CMAKE_CXX_FLAGS "-w -msse3")
set(CMAKE_CXX_FLAGS "-w -mssse3")
endif()

if (APPLE AND __universal_build)
Expand Down
6 changes: 3 additions & 3 deletions src/OpenColorIO/CPUInfo.cpp
Expand Up @@ -107,10 +107,10 @@ CPUInfo::CPUInfo()
flags |= X86_CPU_FLAG_SSE42;

/* Check OSXSAVE and AVX bits */
if (info.reg.ecx & 0x18000000)
if ((info.reg.ecx & 0x18000000) == 0x18000000)
{
xcr = xgetbv();
if(xcr & 0x6) {
if((xcr & 0x6) == 0x6) {
flags |= X86_CPU_FLAG_AVX;

if(info.reg.ecx & 0x20000000) {
Expand All @@ -129,7 +129,7 @@ CPUInfo::CPUInfo()

/* OPMASK/ZMM state */
if ((xcr & 0xe0) == 0xe0) {
if ((flags & X86_CPU_FLAG_AVX2) && (info.reg.ebx & 0xd0030000))
if ((flags & X86_CPU_FLAG_AVX2) && ((info.reg.ebx & 0xd0030000) == 0xd0030000))
flags |= X86_CPU_FLAG_AVX512;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/OpenColorIO/ConfigUtils.cpp
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright Contributors to the OpenColorIO Project.

#include <pystring.h>

#include "ConfigUtils.h"
#include "MathUtils.h"
#include "pystring/pystring.h"
#include "utils/StringUtils.h"

namespace OCIO_NAMESPACE
Expand Down
179 changes: 133 additions & 46 deletions src/apps/ociochecklut/main.cpp
Expand Up @@ -50,12 +50,16 @@ class ProcessorWrapper
void setGPU(OCIO::ConstGPUProcessorRcPtr gpu)
{
m_gpu = gpu;
m_oglApp = OCIO::OglApp::CreateOglApp("ociochecklut", 256, 20);

if (m_verbose)
if (!m_oglApp)
{
m_oglApp->printGLInfo();
m_oglApp = OCIO::OglApp::CreateOglApp("ociochecklut", 256, 20);

if (m_verbose)
{
m_oglApp->printGLInfo();
}
}

m_oglApp->setPrintShader(m_verbose);
float image[4]{ 0.f, 0.f, 0.f, 0.f };
m_oglApp->initImage(1, 1, OCIO::OglApp::COMPONENTS_RGBA, image);
Expand Down Expand Up @@ -191,6 +195,7 @@ int main (int argc, const char* argv[])
bool usegpu = false;
bool usegpuLegacy = false;
bool outputgpuInfo = false;
bool stepInfo = false;

ArgParse ap;
ap.options("ociochecklut -- check any LUT file and optionally convert a pixel\n\n"
Expand All @@ -199,6 +204,7 @@ int main (int argc, const char* argv[])
"<SEPARATOR>", "Options:",
"-t", &test, "Test a set a predefined RGB values",
"-v", &verbose, "Verbose",
"-s", &stepInfo, "Print the output after each step in a multi - transform LUT",
"--help", &help, "Print help message",
"--inv", &invlut, "Apply LUT in inverse direction",
"--gpu", &usegpu, "Use GPU instead of CPU",
Expand Down Expand Up @@ -346,7 +352,7 @@ int main (int argc, const char* argv[])
0.f, 1.f, 0.f,
0.f, 0.f, 1.f };

if (verbose)
if (verbose || stepInfo)
{
std::cout << std::endl;
}
Expand All @@ -357,59 +363,140 @@ int main (int argc, const char* argv[])
{
std::vector<float> pixel = { input[curPix], input[curPix+1], input[curPix+2],
comp == 3 ? 0.0f : input[curPix + 3] };
try
{
proc.apply(pixel);
}
catch (const OCIO::Exception & e)
{
std::cerr << "ERROR: Processing pixel: " << e.what() << std::endl;
return 1;
}
catch (...)
{
std::cerr << "ERROR: Unknown error encountered while processing pixel." << std::endl;
return 1;
}

// Print to string so that in & out values can be aligned if needed.

std::vector<std::string> out;
ToString(out, pixel, 0, comp);

if (verbose)
if (stepInfo)
{
std::vector<std::string> in;
ToString(in, input, curPix, comp);

std::cout << "Input [R G B";
if (comp == 4)
// Process each step in a multi - transform LUT
try
{
std::cout << " A";
// Create GroupTransform so that each can be processed one at a time.
auto processor = config->getProcessor(t);
auto transform = processor->createGroupTransform();
std::vector<float> inputPixel = pixel;
std::vector<float> outputPixel = pixel;
const auto numTransforms = transform->getNumTransforms();

std::cout << std::endl;

for (int i = 0; i < numTransforms; ++i)
{
auto transformStep = transform->getTransform(i);
auto processorStep = config->getProcessor(transformStep);

if (usegpu || usegpuLegacy)
{
proc.setGPU(usegpuLegacy ? processorStep->getOptimizedLegacyGPUProcessor(OCIO::OPTIMIZATION_DEFAULT, 32)
: processorStep->getDefaultGPUProcessor());
}
else
{
proc.setCPU(processorStep->getDefaultCPUProcessor());
}

// Process the pixel
proc.apply(outputPixel);

// Print the input/output pixel
std::vector<std::string> in;
ToString(in, inputPixel, 0, comp);

std::vector<std::string> out;
ToString(out, outputPixel, 0, comp);

std::cout << "\n" << *(transform->getTransform(i)) << std::endl;
std::cout << "Input [R G B";
if (comp == 4)
{
std::cout << " A";
}
std::cout << "]: [";
PrintAlignedVec(in, out, comp);
std::cout << "]" << std::endl;

std::cout << "Output [R G B";
if (comp == 4)
{
std::cout << " A";
}
std::cout << "]: [";
PrintAlignedVec(out, in, comp);
std::cout << "]" << std::endl;

inputPixel = outputPixel;
}
}
std::cout << "]: [";
PrintAlignedVec(in, out, comp);
std::cout << "]" << std::endl;

std::cout << "Output [R G B";
if (comp == 4)
catch (const OCIO::Exception& exception)
{
std::cout << " A";
std::cerr << "ERROR: " << exception.what() << std::endl;
return 1;
}
std::cout << "]: [";
PrintAlignedVec(out, in, comp);
std::cout << "]" << std::endl;
catch (...)
{
std::cerr << "ERROR: Unknown error encountered while processing single step operator." << std::endl;
return 1;
}

curPix += comp;
}
else
{
std::cout << out[0] << " " << out[1] << " " << out[2];
if (comp == 4)
// Process in a single step
try
{
proc.apply(pixel);
}
catch (const OCIO::Exception& e)
{
std::cerr << "ERROR: Processing pixel: " << e.what() << std::endl;
return 1;
}
catch (...)
{
std::cout << " " << out[3];
std::cerr << "ERROR: Unknown error encountered while processing pixel." << std::endl;
return 1;
}

// Print to string so that in & out values can be aligned if needed.

std::vector<std::string> out;
ToString(out, pixel, 0, comp);

std::cout << std::endl;
}
curPix += comp;

if (verbose)
{
std::vector<std::string> in;
ToString(in, input, curPix, comp);

std::cout << "Input [R G B";
if (comp == 4)
{
std::cout << " A";
}
std::cout << "]: [";
PrintAlignedVec(in, out, comp);
std::cout << "]" << std::endl;

std::cout << "Output [R G B";
if (comp == 4)
{
std::cout << " A";
}
std::cout << "]: [";
PrintAlignedVec(out, in, comp);
std::cout << "]" << std::endl;
}
else
{
std::cout << out[0] << " " << out[1] << " " << out[2];
if (comp == 4)
{
std::cout << " " << out[3];
}
std::cout << std::endl;
}
curPix += comp;
}
}
else if (test)
{
Expand Down

0 comments on commit fa52192

Please sign in to comment.