Skip to content

Fix #153 by checking for SSE4.2 support#1876

Merged
adamnovak merged 2 commits intovgteam:masterfrom
adamnovak:check-sse
Sep 18, 2018
Merged

Fix #153 by checking for SSE4.2 support#1876
adamnovak merged 2 commits intovgteam:masterfrom
adamnovak:check-sse

Conversation

@adamnovak
Copy link
Copy Markdown
Member

I've made vg check the CPUID bits as the first thing it does, using methodology borrowed from what dlib does, and bail out if SSE2 is not available.

I've also added -msse4.2 to the vg cflags, because dozeu.h was warning that it was forcing SSE4.1 on one of its functions, since the default was to build vg itself without any fancy instructions. This should let the majority of vg code use SSE4.2 instructions when the compiler thinks it appropriate, and quash the warning. The code that checks for SSE4.2 support and complains if it can't find it is built to run on lowest-common-denominator x86-64, and works in practice on my machine which lacks SSE4.2:

[anovak@hex Desktop]$ ./vg
error[vg::preflight_check]: The CPU does not support SSE4.2 instructions. VG cannot run here. Please use a system with SSE4.2 support.

This is a bit blunt, but it should make it much more clear what the problem is than a signal 4 and a crash report that makes it look like vg has a terrible bug.

Since GCC and Clang now have function multi-versioning, we really should be able to have the appropriate implementation (SSE4.2 or not) for anything that requires it chosen at runtime automatically, if we want to support systems without SSE4.2.

@ghost ghost assigned adamnovak Sep 17, 2018
@ghost ghost added the in progress label Sep 17, 2018
@adamnovak adamnovak added this to the v1.11.0 milestone Sep 17, 2018
@cgcloud-jenkins
Copy link
Copy Markdown

Jenkins vg tests complete for PR 1876. View the full report here.

19 tests passed, 0 tests failed and 10 tests skipped in 22141 seconds

Tests produced 2680 warnings. 2679 were for lower-than-expected alignment scores

@adamnovak adamnovak merged commit 8792983 into vgteam:master Sep 18, 2018
@ghost ghost removed the in progress label Sep 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants