Allow SIMD vector unit to be toggled on/off #172

Currently defaults to off but future versions may default to on
This commit is contained in:
Lovell Fuller
2015-12-12 09:11:50 +00:00
parent 95cf35efc5
commit 32c4b9eff1
12 changed files with 107 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
#include <cmath>
#include <node.h>
#include <vips/vips.h>
#include <vips/vector.h>
#include "nan.h"
@@ -81,6 +82,20 @@ NAN_METHOD(counters) {
info.GetReturnValue().Set(counters);
}
/*
Get and set use of SIMD vector unit instructions
*/
NAN_METHOD(simd) {
HandleScope();
// Set state
if (info[0]->IsBoolean()) {
vips_vector_set_enabled(To<bool>(info[0]).FromJust());
}
// Get state
info.GetReturnValue().Set(New<Boolean>(vips_vector_isenabled()));
}
/*
Get libvips version
*/