vl_simdctrl.c
Go to the documentation of this file.
00001 
00006 /*
00007 Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
00008 All rights reserved.
00009 
00010 This file is part of the VLFeat library and is made available under
00011 the terms of the BSD license (see the COPYING file).
00012 */
00013 
00014 #include "mexutils.h"
00015 
00016 void
00017 mexFunction(int nout, mxArray *out[],
00018             int nin, const mxArray *in[])
00019 {
00020   enum {IN_ENABLED = 0} ;
00021   enum {OUT_ENABLED = 0} ;
00022 
00023   vl_bool wasEnabled = vl_get_simd_enabled() ;
00024 
00025   if (nout > 1) {
00026     vlmxError(vlmxErrInvalidArgument,
00027               "at most one output argument") ;
00028   }
00029 
00030   OUT(ENABLED) = vlmxCreatePlainScalar (wasEnabled) ;
00031 
00032   if (nin == 0) {
00033     return ;
00034   }
00035   if (nin > 1) {
00036     vlmxError(vlmxErrInvalidArgument,
00037       "At most one argument") ;
00038   }
00039   if (!vlmxIsScalar(IN(ENABLED))) {
00040     vlmxError(vlmxErrInvalidArgument,
00041       "ENABLED must be a scalar") ;
00042   }
00043 
00044   vl_set_simd_enabled ((vl_bool) mxGetScalar(IN(ENABLED))) ;
00045 }


libvlfeat
Author(s): Andrea Vedaldi
autogenerated on Thu Jun 6 2019 20:25:51