mirror of
https://github.com/lovell/sharp.git
synced 2026-02-04 13:46:19 +01:00
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:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user