Git Product home page Git Product logo

Comments (5)

jan-wassenberg avatar jan-wassenberg commented on May 8, 2024 1

Hi Vlad, thank you for reporting this. We're working on a fix that will also hide x86-specific code behind an ifdef.

Yes, we currently do require AVX2 - we're adding similar checks using instruction_sets.h Supported.

from pik.

vmdanilov avatar vmdanilov commented on May 8, 2024 1

Hi Jan,

All good. Closing the issue.

from pik.

vmdanilov avatar vmdanilov commented on May 8, 2024

Had to also add JPG_FLAGS := $(shell pkg-config --cflags libjpeg) and JPG_LIBS := $(shell pkg-config --libs libjpeg) to Makefile and install zlib as the system one does not have pkg-config.

Even though it fixed the issue, the compiled binary crashes when trying to encode a PNG/JPEG file. Using macOS Sierra 10.12.6, Intel Core i7, libpng 1.6.32 and libjpeg-turbo 1.5.2.

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
    frame #0: 0x0000000100043111 cpik`pik::ComputeTransposedScaledBlockDCTFloat(float*) [inlined] pik::ColumnDCT(block=0x00007fff5fbfe3e0) at dct.cc:145
   142 	  const V t19 = c2 * t16;
   143 	  const V t20 = t01 + t18;
   144 	  const V t21 = t01 - t18;
-> 145 	  const V t22(_mm256_fmsub_ps(c3, t13, t19));
   146 	  const V t23(_mm256_fmsub_ps(c4, t14, t19));
   147 	  Store(t08 + t10, &block[ 0]);
   148 	  Store(t20 + t22, &block[ 8]);

Edit: It turns out my CPU does not support AVX2 and FMA. Maybe these checks will be helpful.

int main(int argc, char** argv) {
  if(!__builtin_cpu_supports("avx2") || !__builtin_cpu_supports("fma")) {
    printf("AVX2 and FMA support is required.\n");
    return 1;
  }

from pik.

jan-wassenberg avatar jan-wassenberg commented on May 8, 2024

Done (including exiting if non-AVX2 CPU).
We will also add support for other CPUs in the medium term.

from pik.

jan-wassenberg avatar jan-wassenberg commented on May 8, 2024

Thanks for letting us know :D

from pik.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.