Trouble converting ACEScct to Linear and back in CUDA

Hello all,

I am in the process of developing a plugin in which I am trying to integrate ACES.
The way in which we are developing this integration is by doing our processing in a linear space. This requires us to take an AP1/ACEScct signal, convert it to AP1/Linear, do our processing and then convert back out to AP1/ACEScct.

This would allow users who use ACES color management to use our tool.
We are having problems with this conversion as all our tests/attempts are breaking our image.
Currently, this is our code for this conversion:

__device__ float ACESCCToLinear(float value) 
{
    const float ACESCC_THRESHOLD2 = 15.99929538702341f;
    const float ACESCC_THRESHOLD1 = 0.155251141552511f;

    if (value <= ACESCC_THRESHOLD1) 
    {
        return (value - 0.0729055341958355f) / 10.5402377416545f;
    }
    else if (value >= ACESCC_THRESHOLD2)
    {
        return 65504.0f;
    }
    else
    {
        return std::pow(2.f, value * 17.52f - 9.72f);
    }
}

__device__ float linearToACESCC(float linear) 
{
    if (linear <= 0.0078125f)
    {
        return 10.5402377416545f * linear + 0.0729055341958355f;
    }
    else 
    {
        return (std::log(linear) / std::log(2.0f) + 9.72f) / 17.52f;
    }
}

Our expected outcome from this conversion should no visible change as ACEScct should be received, passed to Linear, and then converted back to ACEScct.

Instead, we are getting this image (expected outcome on the left, what we actually get on the right):

Any help would be greatly appreciated. I know that the ACEScct is the function name yet ACESCC is labeled within but that is just the moniker for now-- I’ve been told by my developer that ACEScct values have been used. But please correct me if he is wrong-- he may have the wrong data.

Thank you

This is a duplicate of your other thread.

Please do not double post.

@nick - I apologize for the double post, I figured it would be easier for folks to lend a hand if I presented more info in a more concise post rather then deep in the comments of the previous.