/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.39
 * 
 * This file is not intended to be easily readable and contains a number of 
 * coding conventions designed to improve portability and efficiency. Do not make
 * changes to this file unless you know what you are doing--modify the SWIG 
 * interface file instead. 
 * ----------------------------------------------------------------------------- */

#define SWIGLUA


#ifdef __cplusplus
/* SwigValueWrapper is described in swig.swg */
template<typename T> class SwigValueWrapper {
  struct SwigMovePointer {
    T *ptr;
    SwigMovePointer(T *p) : ptr(p) { }
    ~SwigMovePointer() { delete ptr; }
    SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
  } pointer;
  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
public:
  SwigValueWrapper() : pointer(0) { }
  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
  operator T&() const { return *pointer.ptr; }
  T *operator&() { return pointer.ptr; }
};

template <typename T> T SwigValueInit() {
  return T();
}
#endif

/* -----------------------------------------------------------------------------
 *  This section contains generic SWIG labels for method/variable
 *  declarations/attributes, and other compiler dependent labels.
 * ----------------------------------------------------------------------------- */

/* template workaround for compilers that cannot correctly implement the C++ standard */
#ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
#  define SWIGTEMPLATEDISAMBIGUATOR template
# elif defined(__HP_aCC)
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
#  define SWIGTEMPLATEDISAMBIGUATOR template
# else
#  define SWIGTEMPLATEDISAMBIGUATOR
# endif
#endif

/* inline attribute */
#ifndef SWIGINLINE
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
#   define SWIGINLINE inline
# else
#   define SWIGINLINE
# endif
#endif

/* attribute recognised by some compilers to avoid 'unused' warnings */
#ifndef SWIGUNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define SWIGUNUSED __attribute__ ((__unused__)) 
#   else
#     define SWIGUNUSED
#   endif
# elif defined(__ICC)
#   define SWIGUNUSED __attribute__ ((__unused__)) 
# else
#   define SWIGUNUSED 
# endif
#endif

#ifndef SWIG_MSC_UNSUPPRESS_4505
# if defined(_MSC_VER)
#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
# endif 
#endif

#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
#   define SWIGUNUSEDPARM(p)
# else
#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
# endif
#endif

/* internal SWIG method */
#ifndef SWIGINTERN
# define SWIGINTERN static SWIGUNUSED
#endif

/* internal inline SWIG method */
#ifndef SWIGINTERNINLINE
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif

/* exporting methods */
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
#  ifndef GCC_HASCLASSVISIBILITY
#    define GCC_HASCLASSVISIBILITY
#  endif
#endif

#ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#   if defined(STATIC_LINKED)
#     define SWIGEXPORT
#   else
#     define SWIGEXPORT __declspec(dllexport)
#   endif
# else
#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
#     define SWIGEXPORT __attribute__ ((visibility("default")))
#   else
#     define SWIGEXPORT
#   endif
# endif
#endif

/* calling conventions for Windows */
#ifndef SWIGSTDCALL
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#   define SWIGSTDCALL __stdcall
# else
#   define SWIGSTDCALL
# endif 
#endif

/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE
#endif

/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
# define _SCL_SECURE_NO_DEPRECATE
#endif


/* -----------------------------------------------------------------------------
 * swigrun.swg
 *
 * This file contains generic C API SWIG runtime support for pointer
 * type checking.
 * ----------------------------------------------------------------------------- */

/* This should only be incremented when either the layout of swig_type_info changes,
   or for whatever reason, the runtime changes incompatibly */
#define SWIG_RUNTIME_VERSION "4"

/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
#ifdef SWIG_TYPE_TABLE
# define SWIG_QUOTE_STRING(x) #x
# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
#else
# define SWIG_TYPE_TABLE_NAME
#endif

/*
  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
  creating a static or dynamic library from the SWIG runtime code.
  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
  
  But only do this if strictly necessary, ie, if you have problems
  with your compiler or suchlike.
*/

#ifndef SWIGRUNTIME
# define SWIGRUNTIME SWIGINTERN
#endif

#ifndef SWIGRUNTIMEINLINE
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
#endif

/*  Generic buffer size */
#ifndef SWIG_BUFFER_SIZE
# define SWIG_BUFFER_SIZE 1024
#endif

/* Flags for pointer conversions */
#define SWIG_POINTER_DISOWN        0x1
#define SWIG_CAST_NEW_MEMORY       0x2

/* Flags for new pointer objects */
#define SWIG_POINTER_OWN           0x1


/* 
   Flags/methods for returning states.
   
   The SWIG conversion methods, as ConvertPtr, return and integer 
   that tells if the conversion was successful or not. And if not,
   an error code can be returned (see swigerrors.swg for the codes).
   
   Use the following macros/flags to set or process the returning
   states.
   
   In old versions of SWIG, code such as the following was usually written:

     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
       // success code
     } else {
       //fail code
     }

   Now you can be more explicit:

    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
    if (SWIG_IsOK(res)) {
      // success code
    } else {
      // fail code
    }

   which is the same really, but now you can also do

    Type *ptr;
    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
    if (SWIG_IsOK(res)) {
      // success code
      if (SWIG_IsNewObj(res) {
        ...
	delete *ptr;
      } else {
        ...
      }
    } else {
      // fail code
    }
    
   I.e., now SWIG_ConvertPtr can return new objects and you can
   identify the case and take care of the deallocation. Of course that
   also requires SWIG_ConvertPtr to return new result values, such as

      int SWIG_ConvertPtr(obj, ptr,...) {         
        if (<obj is ok>) {			       
          if (<need new object>) {		       
            *ptr = <ptr to new allocated object>; 
            return SWIG_NEWOBJ;		       
          } else {				       
            *ptr = <ptr to old object>;	       
            return SWIG_OLDOBJ;		       
          } 				       
        } else {				       
          return SWIG_BADOBJ;		       
        }					       
      }

   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
   SWIG errors code.

   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
   allows to return the 'cast rank', for example, if you have this

       int food(double)
       int fooi(int);

   and you call
 
      food(1)   // cast rank '1'  (1 -> 1.0)
      fooi(1)   // cast rank '0'

   just use the SWIG_AddCast()/SWIG_CheckState()
*/

#define SWIG_OK                    (0) 
#define SWIG_ERROR                 (-1)
#define SWIG_IsOK(r)               (r >= 0)
#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  

/* The CastRankLimit says how many bits are used for the cast rank */
#define SWIG_CASTRANKLIMIT         (1 << 8)
/* The NewMask denotes the object was created (using new/malloc) */
#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
/* The TmpMask is for in/out typemaps that use temporal objects */
#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
/* Simple returning values */
#define SWIG_BADOBJ                (SWIG_ERROR)
#define SWIG_OLDOBJ                (SWIG_OK)
#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
/* Check, add and del mask methods */
#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))

/* Cast-Rank Mode */
#if defined(SWIG_CASTRANK_MODE)
#  ifndef SWIG_TypeRank
#    define SWIG_TypeRank             unsigned long
#  endif
#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
#    define SWIG_MAXCASTRANK          (2)
#  endif
#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
SWIGINTERNINLINE int SWIG_AddCast(int r) { 
  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
}
SWIGINTERNINLINE int SWIG_CheckState(int r) { 
  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
}
#else /* no cast-rank mode */
#  define SWIG_AddCast
#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
#endif


#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef void *(*swig_converter_func)(void *, int *);
typedef struct swig_type_info *(*swig_dycast_func)(void **);

/* Structure to store information on one type */
typedef struct swig_type_info {
  const char             *name;			/* mangled name of this type */
  const char             *str;			/* human readable name of this type */
  swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
  struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
  void                   *clientdata;		/* language specific type data */
  int                    owndata;		/* flag if the structure owns the clientdata */
} swig_type_info;

/* Structure to store a type and conversion function used for casting */
typedef struct swig_cast_info {
  swig_type_info         *type;			/* pointer to type that is equivalent to this type */
  swig_converter_func     converter;		/* function to cast the void pointers */
  struct swig_cast_info  *next;			/* pointer to next cast in linked list */
  struct swig_cast_info  *prev;			/* pointer to the previous cast */
} swig_cast_info;

/* Structure used to store module information
 * Each module generates one structure like this, and the runtime collects
 * all of these structures and stores them in a circularly linked list.*/
typedef struct swig_module_info {
  swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
  size_t                 size;		        /* Number of types in this module */
  struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
  swig_type_info         **type_initial;	/* Array of initially generated type structures */
  swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
  void                    *clientdata;		/* Language specific module data */
} swig_module_info;

/* 
  Compare two type names skipping the space characters, therefore
  "char*" == "char *" and "Class<int>" == "Class<int >", etc.

  Return 0 when the two name types are equivalent, as in
  strncmp, but skipping ' '.
*/
SWIGRUNTIME int
SWIG_TypeNameComp(const char *f1, const char *l1,
		  const char *f2, const char *l2) {
  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
    while ((*f1 == ' ') && (f1 != l1)) ++f1;
    while ((*f2 == ' ') && (f2 != l2)) ++f2;
    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
  }
  return (int)((l1 - f1) - (l2 - f2));
}

/*
  Check type equivalence in a name list like <name1>|<name2>|...
  Return 0 if not equal, 1 if equal
*/
SWIGRUNTIME int
SWIG_TypeEquiv(const char *nb, const char *tb) {
  int equiv = 0;
  const char* te = tb + strlen(tb);
  const char* ne = nb;
  while (!equiv && *ne) {
    for (nb = ne; *ne; ++ne) {
      if (*ne == '|') break;
    }
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
    if (*ne) ++ne;
  }
  return equiv;
}

/*
  Check type equivalence in a name list like <name1>|<name2>|...
  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
*/
SWIGRUNTIME int
SWIG_TypeCompare(const char *nb, const char *tb) {
  int equiv = 0;
  const char* te = tb + strlen(tb);
  const char* ne = nb;
  while (!equiv && *ne) {
    for (nb = ne; *ne; ++ne) {
      if (*ne == '|') break;
    }
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
    if (*ne) ++ne;
  }
  return equiv;
}


/*
  Check the typename
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
  if (ty) {
    swig_cast_info *iter = ty->cast;
    while (iter) {
      if (strcmp(iter->type->name, c) == 0) {
        if (iter == ty->cast)
          return iter;
        /* Move iter to the top of the linked list */
        iter->prev->next = iter->next;
        if (iter->next)
          iter->next->prev = iter->prev;
        iter->next = ty->cast;
        iter->prev = 0;
        if (ty->cast) ty->cast->prev = iter;
        ty->cast = iter;
        return iter;
      }
      iter = iter->next;
    }
  }
  return 0;
}

/* 
  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
  if (ty) {
    swig_cast_info *iter = ty->cast;
    while (iter) {
      if (iter->type == from) {
        if (iter == ty->cast)
          return iter;
        /* Move iter to the top of the linked list */
        iter->prev->next = iter->next;
        if (iter->next)
          iter->next->prev = iter->prev;
        iter->next = ty->cast;
        iter->prev = 0;
        if (ty->cast) ty->cast->prev = iter;
        ty->cast = iter;
        return iter;
      }
      iter = iter->next;
    }
  }
  return 0;
}

/*
  Cast a pointer up an inheritance hierarchy
*/
SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
}

/* 
   Dynamic pointer casting. Down an inheritance hierarchy
*/
SWIGRUNTIME swig_type_info *
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
  swig_type_info *lastty = ty;
  if (!ty || !ty->dcast) return ty;
  while (ty && (ty->dcast)) {
    ty = (*ty->dcast)(ptr);
    if (ty) lastty = ty;
  }
  return lastty;
}

/*
  Return the name associated with this type
*/
SWIGRUNTIMEINLINE const char *
SWIG_TypeName(const swig_type_info *ty) {
  return ty->name;
}

/*
  Return the pretty name associated with this type,
  that is an unmangled type name in a form presentable to the user.
*/
SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info *type) {
  /* The "str" field contains the equivalent pretty names of the
     type, separated by vertical-bar characters.  We choose
     to print the last name, as it is often (?) the most
     specific. */
  if (!type) return NULL;
  if (type->str != NULL) {
    const char *last_name = type->str;
    const char *s;
    for (s = type->str; *s; s++)
      if (*s == '|') last_name = s+1;
    return last_name;
  }
  else
    return type->name;
}

/* 
   Set the clientdata field for a type
*/
SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
  swig_cast_info *cast = ti->cast;
  /* if (ti->clientdata == clientdata) return; */
  ti->clientdata = clientdata;
  
  while (cast) {
    if (!cast->converter) {
      swig_type_info *tc = cast->type;
      if (!tc->clientdata) {
	SWIG_TypeClientData(tc, clientdata);
      }
    }    
    cast = cast->next;
  }
}
SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
  SWIG_TypeClientData(ti, clientdata);
  ti->owndata = 1;
}
  
/*
  Search for a swig_type_info structure only by mangled name
  Search is a O(log #types)
  
  We start searching at module start, and finish searching when start == end.  
  Note: if start == end at the beginning of the function, we go all the way around
  the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info *start, 
                            swig_module_info *end, 
		            const char *name) {
  swig_module_info *iter = start;
  do {
    if (iter->size) {
      register size_t l = 0;
      register size_t r = iter->size - 1;
      do {
	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
	register size_t i = (l + r) >> 1; 
	const char *iname = iter->types[i]->name;
	if (iname) {
	  register int compare = strcmp(name, iname);
	  if (compare == 0) {	    
	    return iter->types[i];
	  } else if (compare < 0) {
	    if (i) {
	      r = i - 1;
	    } else {
	      break;
	    }
	  } else if (compare > 0) {
	    l = i + 1;
	  }
	} else {
	  break; /* should never happen */
	}
      } while (l <= r);
    }
    iter = iter->next;
  } while (iter != end);
  return 0;
}

/*
  Search for a swig_type_info structure for either a mangled name or a human readable name.
  It first searches the mangled names of the types, which is a O(log #types)
  If a type is not found it then searches the human readable names, which is O(#types).
  
  We start searching at module start, and finish searching when start == end.  
  Note: if start == end at the beginning of the function, we go all the way around
  the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info *start, 
                     swig_module_info *end, 
		     const char *name) {
  /* STEP 1: Search the name field using binary search */
  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
  if (ret) {
    return ret;
  } else {
    /* STEP 2: If the type hasn't been found, do a complete search
       of the str field (the human readable name) */
    swig_module_info *iter = start;
    do {
      register size_t i = 0;
      for (; i < iter->size; ++i) {
	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
	  return iter->types[i];
      }
      iter = iter->next;
    } while (iter != end);
  }
  
  /* neither found a match */
  return 0;
}

/* 
   Pack binary data into a string
*/
SWIGRUNTIME char *
SWIG_PackData(char *c, void *ptr, size_t sz) {
  static const char hex[17] = "0123456789abcdef";
  register const unsigned char *u = (unsigned char *) ptr;
  register const unsigned char *eu =  u + sz;
  for (; u != eu; ++u) {
    register unsigned char uu = *u;
    *(c++) = hex[(uu & 0xf0) >> 4];
    *(c++) = hex[uu & 0xf];
  }
  return c;
}

/* 
   Unpack binary data from a string
*/
SWIGRUNTIME const char *
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
  register unsigned char *u = (unsigned char *) ptr;
  register const unsigned char *eu = u + sz;
  for (; u != eu; ++u) {
    register char d = *(c++);
    register unsigned char uu;
    if ((d >= '0') && (d <= '9'))
      uu = ((d - '0') << 4);
    else if ((d >= 'a') && (d <= 'f'))
      uu = ((d - ('a'-10)) << 4);
    else 
      return (char *) 0;
    d = *(c++);
    if ((d >= '0') && (d <= '9'))
      uu |= (d - '0');
    else if ((d >= 'a') && (d <= 'f'))
      uu |= (d - ('a'-10));
    else 
      return (char *) 0;
    *u = uu;
  }
  return c;
}

/* 
   Pack 'void *' into a string buffer.
*/
SWIGRUNTIME char *
SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
  char *r = buff;
  if ((2*sizeof(void *) + 2) > bsz) return 0;
  *(r++) = '_';
  r = SWIG_PackData(r,&ptr,sizeof(void *));
  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
  strcpy(r,name);
  return buff;
}

SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
  if (*c != '_') {
    if (strcmp(c,"NULL") == 0) {
      *ptr = (void *) 0;
      return name;
    } else {
      return 0;
    }
  }
  return SWIG_UnpackData(++c,ptr,sizeof(void *));
}

SWIGRUNTIME char *
SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
  char *r = buff;
  size_t lname = (name ? strlen(name) : 0);
  if ((2*sz + 2 + lname) > bsz) return 0;
  *(r++) = '_';
  r = SWIG_PackData(r,ptr,sz);
  if (lname) {
    strncpy(r,name,lname+1);
  } else {
    *r = 0;
  }
  return buff;
}

SWIGRUNTIME const char *
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
  if (*c != '_') {
    if (strcmp(c,"NULL") == 0) {
      memset(ptr,0,sz);
      return name;
    } else {
      return 0;
    }
  }
  return SWIG_UnpackData(++c,ptr,sz);
}

#ifdef __cplusplus
}
#endif

/* -----------------------------------------------------------------------------
 * See the LICENSE file for information on copyright, usage and redistribution
 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
 *
 * luarun.swg
 *
 * This file contains the runtime support for Lua modules
 * and includes code for managing global variables and pointer
 * type checking.
 * ----------------------------------------------------------------------------- */

#ifdef __cplusplus
extern "C" {
#endif

#include "lua.h"
#include "lauxlib.h"
#include <stdlib.h>  /* for malloc */
#include <assert.h>  /* for a few sanity tests */

/* -----------------------------------------------------------------------------
 * global swig types
 * ----------------------------------------------------------------------------- */
/* Constant table */
#define SWIG_LUA_INT     1
#define SWIG_LUA_FLOAT   2
#define SWIG_LUA_STRING  3
#define SWIG_LUA_POINTER 4
#define SWIG_LUA_BINARY  5
#define SWIG_LUA_CHAR    6

/* Structure for variable linking table */
typedef struct {
  const char *name;
  lua_CFunction get;
  lua_CFunction set;
} swig_lua_var_info;

/* Constant information structure */
typedef struct {
    int type;
    char *name;
    long lvalue;
    double dvalue;
    void   *pvalue;
    swig_type_info **ptype;
} swig_lua_const_info;

typedef struct {
  const char     *name;
  lua_CFunction   method;
} swig_lua_method;

typedef struct {
  const char     *name;
  lua_CFunction   getmethod;
  lua_CFunction   setmethod;
} swig_lua_attribute;

typedef struct swig_lua_class {
  const char    *name;
  swig_type_info   **type;
  lua_CFunction  constructor;
  void    (*destructor)(void *);
  swig_lua_method   *methods;
  swig_lua_attribute     *attributes;
  struct swig_lua_class **bases;
  const char **base_names;
} swig_lua_class;

/* this is the struct for wrappering all pointers in SwigLua
*/
typedef struct {
  swig_type_info   *type;
  int     own;  /* 1 if owned & must be destroyed */
  void        *ptr;
} swig_lua_userdata;

/* this is the struct for wrapping arbitary packed binary data
(currently it is only used for member function pointers)
the data ordering is similar to swig_lua_userdata, but it is currently not possible
to tell the two structures apart within SWIG, other than by looking at the type
*/
typedef struct {
  swig_type_info   *type;
  int     own;  /* 1 if owned & must be destroyed */
  char data[1];       /* arbitary amount of data */    
} swig_lua_rawdata;

/* Common SWIG API */
#define SWIG_NewPointerObj(L, ptr, type, owner)       SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner)
#define SWIG_ConvertPtr(L,idx, ptr, type, flags)    SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags)
#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname)  SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname)
/* for C++ member pointers, ie, member methods */
#define SWIG_ConvertMember(L, idx, ptr, sz, ty)       SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty)
#define SWIG_NewMemberObj(L, ptr, sz, type)      SWIG_Lua_NewPackedObj(L, ptr, sz, type)

/* Runtime API */
#define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata))
#define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer)
#define SWIG_MODULE_CLIENTDATA_TYPE lua_State*

/* Contract support */
#define SWIG_contract_assert(expr, msg)  \
  if (!(expr)) { lua_pushstring(L, (char *) msg); goto fail; } else

/* helper #defines */
#define SWIG_fail {goto fail;}
#define SWIG_fail_arg(func_name,argnum,type) \
  {lua_pushfstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
  func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
  goto fail;}
#define SWIG_fail_ptr(func_name,argnum,type) \
  SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
#define SWIG_check_num_args(func_name,a,b) \
  if (lua_gettop(L)<a || lua_gettop(L)>b) \
  {lua_pushfstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
  goto fail;}


#define SWIG_Lua_get_table(L,n) \
  (lua_pushstring(L, n), lua_rawget(L,-2))

#define SWIG_Lua_add_function(L,n,f) \
  (lua_pushstring(L, n), \
      lua_pushcfunction(L, f), \
      lua_rawset(L,-3))

/* special helper for allowing 'nil' for usertypes */
#define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I))

#ifdef __cplusplus
/* Special helper for member function pointers 
it gets the address, casts it, then dereferences it */
//#define SWIG_mem_fn_as_voidptr(a)  (*((char**)&(a)))
#endif

/* storing/access of swig_module_info */
SWIGRUNTIME swig_module_info *
SWIG_Lua_GetModule(lua_State* L) {
  swig_module_info *ret = 0;
  lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
  lua_rawget(L,LUA_REGISTRYINDEX);
  if (lua_islightuserdata(L,-1))
    ret=(swig_module_info*)lua_touserdata(L,-1);
  lua_pop(L,1);  /* tidy */
  return ret;
}

SWIGRUNTIME void
SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) {
  /* add this all into the Lua registry: */
  lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
  lua_pushlightuserdata(L,(void*)module);
  lua_rawset(L,LUA_REGISTRYINDEX);
}

/* -----------------------------------------------------------------------------
 * global variable support code: modules
 * ----------------------------------------------------------------------------- */

/* this function is called when trying to set an immutable.
default value is to print an error.
This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */
SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L)
{
/*  there should be 1 param passed in: the new value */
#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
  lua_pop(L,1);  /* remove it */
  lua_pushstring(L,"This variable is immutable");
  lua_error(L);
#endif
    return 0;   /* should not return anything */
}

/* the module.get method used for getting linked data */
SWIGINTERN int SWIG_Lua_module_get(lua_State* L)
{
/*  there should be 2 params passed in
  (1) table (not the meta table)
  (2) string name of the attribute
  printf("SWIG_Lua_module_get %p(%s) '%s'\n",
   lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
   lua_tostring(L,2));
*/
  /* get the metatable */
  assert(lua_istable(L,1));  /* just in case */
  lua_getmetatable(L,1);  /* get the metatable */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".get");  /* get the .get table */
  lua_remove(L,3);  /* remove metatable */
  if (lua_istable(L,-1))
  {
    /* look for the key in the .get table */
    lua_pushvalue(L,2);  /* key */
    lua_rawget(L,-2);
    lua_remove(L,3);  /* remove .get */
    if (lua_iscfunction(L,-1))
    {  /* found it so call the fn & return its value */
      lua_call(L,0,1);
      return 1;
    }
    lua_pop(L,1);  /* remove the top */
  }
  lua_pop(L,1);  /* remove the .get */
  lua_pushnil(L);  /* return a nil */
    return 1;
}

/* the module.set method used for setting linked data */
SWIGINTERN int SWIG_Lua_module_set(lua_State* L)
{
/*  there should be 3 params passed in
  (1) table (not the meta table)
  (2) string name of the attribute
  (3) any for the new value
*/
  /* get the metatable */
  assert(lua_istable(L,1));  /* just in case */
  lua_getmetatable(L,1);  /* get the metatable */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".set");  /* get the .set table */
  lua_remove(L,4);  /* remove metatable */
  if (lua_istable(L,-1))
  {
    /* look for the key in the .set table */
    lua_pushvalue(L,2);  /* key */
    lua_rawget(L,-2);
    lua_remove(L,4);  /* remove .set */
    if (lua_iscfunction(L,-1))
    {  /* found it so call the fn & return its value */
      lua_pushvalue(L,3);  /* value */
      lua_call(L,1,0);
      return 0;
    }
  }
  lua_settop(L,3);  /* reset back to start */
  /* we now have the table, key & new value, so just set directly */
  lua_rawset(L,1);  /* add direct */
  return 0;
}

/* registering a module in lua */
SWIGINTERN void  SWIG_Lua_module_begin(lua_State* L,const char* name)
{
  assert(lua_istable(L,-1));  /* just in case */
  lua_pushstring(L,name);
  lua_newtable(L);   /* the table */
  /* add meta table */
  lua_newtable(L);    /* the meta table */
  SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get);
  SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set);
  lua_pushstring(L,".get");
  lua_newtable(L);    /* the .get table */
  lua_rawset(L,-3);  /* add .get into metatable */
  lua_pushstring(L,".set");
  lua_newtable(L);    /* the .set table */
  lua_rawset(L,-3);  /* add .set into metatable */
  lua_setmetatable(L,-2);  /* sets meta table in module */
  lua_rawset(L,-3);        /* add module into parent */
  SWIG_Lua_get_table(L,name);   /* get the table back out */
}

/* ending the register */
SWIGINTERN void  SWIG_Lua_module_end(lua_State* L)
{
  lua_pop(L,1);       /* tidy stack (remove module) */
}

/* adding a linked variable to the module */
SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
{
  assert(lua_istable(L,-1));  /* just in case */
  lua_getmetatable(L,-1);  /* get the metatable */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".get"); /* find the .get table */
  assert(lua_istable(L,-1));  /* should be a table: */
  SWIG_Lua_add_function(L,name,getFn);
  lua_pop(L,1);       /* tidy stack (remove table) */
  if (setFn)  /* if there is a set fn */
  {
    SWIG_Lua_get_table(L,".set"); /* find the .set table */
    assert(lua_istable(L,-1));  /* should be a table: */
    SWIG_Lua_add_function(L,name,setFn);
    lua_pop(L,1);       /* tidy stack (remove table) */
  }
  lua_pop(L,1);       /* tidy stack (remove meta) */
}

/* adding a function module */
SWIGINTERN void  SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn)
{
  SWIG_Lua_add_function(L,name,fn);
}

/* -----------------------------------------------------------------------------
 * global variable support code: classes
 * ----------------------------------------------------------------------------- */

/* the class.get method, performs the lookup of class attributes */
SWIGINTERN int  SWIG_Lua_class_get(lua_State* L)
{
/*  there should be 2 params passed in
  (1) userdata (not the meta table)
  (2) string name of the attribute
*/
  assert(lua_isuserdata(L,-2));  /* just in case */
  lua_getmetatable(L,-2);    /* get the meta table */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".get"); /* find the .get table */
  assert(lua_istable(L,-1));  /* just in case */
  /* look for the key in the .get table */
  lua_pushvalue(L,2);  /* key */
  lua_rawget(L,-2);
  lua_remove(L,-2); /* stack tidy, remove .get table */
  if (lua_iscfunction(L,-1))
  {  /* found it so call the fn & return its value */
    lua_pushvalue(L,1);  /* the userdata */
    lua_call(L,1,1);  /* 1 value in (userdata),1 out (result) */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return 1;
  }
  lua_pop(L,1);  /* remove whatever was there */
  /* ok, so try the .fn table */
  SWIG_Lua_get_table(L,".fn"); /* find the .get table */
  assert(lua_istable(L,-1));  /* just in case */
  lua_pushvalue(L,2);  /* key */
  lua_rawget(L,-2);  /* look for the fn */
  lua_remove(L,-2); /* stack tidy, remove .fn table */
  if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */
  {  /* found it so return the fn & let lua call it */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return 1;
  }
  lua_pop(L,1);  /* remove whatever was there */
  /* NEW: looks for the __getitem() fn
  this is a user provided get fn */
  SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */
  if (lua_iscfunction(L,-1))  /* if its there */
  {  /* found it so call the fn & return its value */
    lua_pushvalue(L,1);  /* the userdata */
    lua_pushvalue(L,2);  /* the parameter */
    lua_call(L,2,1);  /* 2 value in (userdata),1 out (result) */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return 1;
  }
  return 0;  /* sorry not known */
}

/* the class.set method, performs the lookup of class attributes */
SWIGINTERN int  SWIG_Lua_class_set(lua_State* L)
{
/*  there should be 3 params passed in
  (1) table (not the meta table)
  (2) string name of the attribute
  (3) any for the new value
printf("SWIG_Lua_class_set %p(%s) '%s' %p(%s)\n",
      lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
      lua_tostring(L,2),
      lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/

  assert(lua_isuserdata(L,1));  /* just in case */
  lua_getmetatable(L,1);    /* get the meta table */
  assert(lua_istable(L,-1));  /* just in case */

  SWIG_Lua_get_table(L,".set"); /* find the .set table */
  if (lua_istable(L,-1))
  {
    /* look for the key in the .set table */
    lua_pushvalue(L,2);  /* key */
    lua_rawget(L,-2);
    if (lua_iscfunction(L,-1))
    {  /* found it so call the fn & return its value */
      lua_pushvalue(L,1);  /* userdata */
      lua_pushvalue(L,3);  /* value */
      lua_call(L,2,0);
      return 0;
    }
    lua_pop(L,1);  /* remove the value */
  }
  lua_pop(L,1);  /* remove the value .set table */
  /* NEW: looks for the __setitem() fn
  this is a user provided set fn */
  SWIG_Lua_get_table(L,"__setitem"); /* find the fn */
  if (lua_iscfunction(L,-1))  /* if its there */
  {  /* found it so call the fn & return its value */
    lua_pushvalue(L,1);  /* the userdata */
    lua_pushvalue(L,2);  /* the parameter */
    lua_pushvalue(L,3);  /* the value */
    lua_call(L,3,0);  /* 3 values in ,0 out */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return 1;
  }
  return 0;
}

/* the class.destruct method called by the interpreter */
SWIGINTERN int  SWIG_Lua_class_destruct(lua_State* L)
{
/*  there should be 1 params passed in
  (1) userdata (not the meta table) */
  swig_lua_userdata* usr;
  swig_lua_class* clss;
  assert(lua_isuserdata(L,-1));  /* just in case */
  usr=(swig_lua_userdata*)lua_touserdata(L,-1);  /* get it */
  /* if must be destroyed & has a destructor */
  if (usr->own) /* if must be destroyed */
  {
    clss=(swig_lua_class*)usr->type->clientdata;  /* get the class */
    if (clss && clss->destructor)  /* there is a destroy fn */
    {
      clss->destructor(usr->ptr);  /* bye bye */
    }
  }
  return 0;
}

/* gets the swig class registry (or creates it) */
SWIGINTERN void  SWIG_Lua_get_class_registry(lua_State* L)
{
  /* add this all into the swig registry: */
  lua_pushstring(L,"SWIG");
  lua_rawget(L,LUA_REGISTRYINDEX);  /* get the registry */
  if (!lua_istable(L,-1))  /* not there */
  {  /* must be first time, so add it */
    lua_pop(L,1);  /* remove the result */
    lua_pushstring(L,"SWIG");
    lua_newtable(L);
    lua_rawset(L,LUA_REGISTRYINDEX);
    /* then get it */
    lua_pushstring(L,"SWIG");
    lua_rawget(L,LUA_REGISTRYINDEX);
  }
}

/* helper fn to get the classes metatable from the register */
SWIGINTERN void  SWIG_Lua_get_class_metatable(lua_State* L,const char* cname)
{
  SWIG_Lua_get_class_registry(L);  /* get the registry */
  lua_pushstring(L,cname);  /* get the name */
  lua_rawget(L,-2);    /* get it */
  lua_remove(L,-2);    /* tidy up (remove registry) */
}

/* helper add a variable to a registered class */
SWIGINTERN void  SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
{
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".get"); /* find the .get table */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_add_function(L,name,getFn);
  lua_pop(L,1);       /* tidy stack (remove table) */
  if (setFn)
  {
    SWIG_Lua_get_table(L,".set"); /* find the .set table */
    assert(lua_istable(L,-1));  /* just in case */
    SWIG_Lua_add_function(L,name,setFn);
    lua_pop(L,1);       /* tidy stack (remove table) */
  }
}

/* helper to recursively add class details (attributes & operations) */
SWIGINTERN void  SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss)
{
  int i;
  /* call all the base classes first: we can then override these later: */
  for(i=0;clss->bases[i];i++)
  {
    SWIG_Lua_add_class_details(L,clss->bases[i]);
  }
  /* add fns */
  for(i=0;clss->attributes[i].name;i++){
    SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod);
  }
  /* add methods to the metatable */
  SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
  assert(lua_istable(L,-1));  /* just in case */
  for(i=0;clss->methods[i].name;i++){
    SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
  }
  lua_pop(L,1);       /* tidy stack (remove table) */
  /*   add operator overloads
    these look ANY method which start with "__" and assume they
    are operator overloads & add them to the metatable
    (this might mess up is someone defines a method __gc (the destructor)*/
  for(i=0;clss->methods[i].name;i++){
    if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){
      SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
    }
  }
}

/* set up the base classes pointers.
Each class structure has a list of pointers to the base class structures.
This function fills them.
It cannot be done at compile time, as this will not work with hireachies
spread over more than one swig file. 
Therefore it must be done at runtime, querying the SWIG type system.
*/
SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss)
{
  int i=0;
  swig_module_info* module=SWIG_GetModule(L);
  for(i=0;clss->base_names[i];i++)
  {
    if (clss->bases[i]==0) /* not found yet */
    {
      /* lookup and cache the base class */
      swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]);
      if (info) clss->bases[i] = (swig_lua_class *) info->clientdata;
    }
  }	
}

/* performs the entire class registration process */
SWIGINTERN void  SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
{
  /*  add its constructor to module with the name of the class
  so you can do MyClass(...) as well as new_MyClass(...)
  BUT only if a constructor is defined
  (this overcomes the problem of pure virtual classes without constructors)*/
  if (clss->constructor)
    SWIG_Lua_add_function(L,clss->name,clss->constructor);

  SWIG_Lua_get_class_registry(L);  /* get the registry */
  lua_pushstring(L,clss->name);  /* get the name */
  lua_newtable(L);    /* create the metatable */
  /* add string of class name called ".type" */
  lua_pushstring(L,".type");
  lua_pushstring(L,clss->name);
  lua_rawset(L,-3);
  /* add a table called ".get" */
  lua_pushstring(L,".get");
  lua_newtable(L);
  lua_rawset(L,-3);
  /* add a table called ".set" */
  lua_pushstring(L,".set");
  lua_newtable(L);
  lua_rawset(L,-3);
  /* add a table called ".fn" */
  lua_pushstring(L,".fn");
  lua_newtable(L);
  lua_rawset(L,-3);
  /* add accessor fns for using the .get,.set&.fn */
  SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get);
  SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set);
  SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct);
  /* add it */
  lua_rawset(L,-3);  /* metatable into registry */
  lua_pop(L,1);      /* tidy stack (remove registry) */

  SWIG_Lua_get_class_metatable(L,clss->name);
  SWIG_Lua_add_class_details(L,clss);  /* recursive adding of details (atts & ops) */
  lua_pop(L,1);      /* tidy stack (remove class metatable) */
}

/* -----------------------------------------------------------------------------
 * Class/structure conversion fns
 * ----------------------------------------------------------------------------- */

/* helper to add metatable to new lua object */
SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type)
{
  if (type->clientdata)  /* there is clientdata: so add the metatable */
  {
    SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name);
    if (lua_istable(L,-1))
    {
      lua_setmetatable(L,-2);
    }
    else
    {
      lua_pop(L,1);
    }
  }
}

/* pushes a new object into the lua stack */
SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *type, int own)
{
  swig_lua_userdata* usr;
  if (!ptr){
    lua_pushnil(L);
    return;
  }
  usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata));  /* get data */
  usr->ptr=ptr;  /* set the ptr */
  usr->type=type;
  usr->own=own;
  _SWIG_Lua_AddMetatable(L,type); /* add metatable */
}

/* takes a object from the lua stack & converts it into an object of the correct type
 (if possible) */
SWIGRUNTIME int  SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags)
{
  swig_lua_userdata* usr;
  swig_cast_info *cast;
  if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;}    /* special case: lua nil => NULL pointer */
  usr=(swig_lua_userdata*)lua_touserdata(L,index);  /* get data */
  if (usr)
  {
    if (flags & SWIG_POINTER_DISOWN) /* must disown the object */
    {
        usr->own=0;
    }
    if (!type)            /* special cast void*, no casting fn */
    {
      *ptr=usr->ptr;
      return SWIG_OK; /* ok */
    }
    cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */
    if (cast)
    {
      int newmemory = 0;
      *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory);
      assert(!newmemory); /* newmemory handling not yet implemented */
      return SWIG_OK;  /* ok */
    }
  }
  return SWIG_ERROR;  /* error */
}

SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *type,int flags,
       int argnum,const char* func_name){
  void* result;
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){
    lua_pushfstring(L,"Error in %s, expected a %s at argument number %d\n",
      func_name,(type && type->str)?type->str:"void*",argnum);
    lua_error(L);
  }
  return result;
}

/* pushes a packed userdata. user for member fn pointers only */
SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type)
{
  swig_lua_rawdata* raw;
  assert(ptr); /* not acceptable to pass in a NULL value */
  raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size);  /* alloc data */
  raw->type=type;
  raw->own=0;
  memcpy(raw->data,ptr,size); /* copy the data */
  _SWIG_Lua_AddMetatable(L,type); /* add metatable */
}
    
/* converts a packed userdata. user for member fn pointers only */
SWIGRUNTIME int  SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type)
{
  swig_lua_rawdata* raw;
  raw=(swig_lua_rawdata*)lua_touserdata(L,index);  /* get data */
  if (!raw) return SWIG_ERROR;  /* error */
  if (type==0 || type==raw->type) /* void* or identical type */
  {
    memcpy(ptr,raw->data,size); /* copy it */
    return SWIG_OK; /* ok */
  }
  return SWIG_ERROR;  /* error */
}

/* a function to get the typestring of a piece of data */
SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp)
{
  swig_lua_userdata* usr;
  if (lua_isuserdata(L,tp))
  {
    usr=(swig_lua_userdata*)lua_touserdata(L,tp);  /* get data */
    if (usr && usr->type && usr->type->str)
      return usr->type->str;
    return "userdata (unknown type)";
  }
  return lua_typename(L,lua_type(L,tp));
}

/* lua callable function to get the userdata's type */
SWIGRUNTIME int SWIG_Lua_type(lua_State* L)
{
  lua_pushstring(L,SWIG_Lua_typename(L,1));
  return 1;
}

/* lua callable function to compare userdata's value
the issue is that two userdata may point to the same thing
but to lua, they are different objects */
SWIGRUNTIME int SWIG_Lua_equal(lua_State* L)
{
  int result;
  swig_lua_userdata *usr1,*usr2;
  if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2))  /* just in case */
    return 0;  /* nil reply */
  usr1=(swig_lua_userdata*)lua_touserdata(L,1);  /* get data */
  usr2=(swig_lua_userdata*)lua_touserdata(L,2);  /* get data */
  /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/
  result=(usr1->ptr==usr2->ptr);
   lua_pushboolean(L,result);
  return 1;
}

/* -----------------------------------------------------------------------------
 * global variable support code: class/struct typemap functions
 * ----------------------------------------------------------------------------- */

/* Install Constants */
SWIGINTERN void
SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) {
  int i;
  for (i = 0; constants[i].type; i++) {
    switch(constants[i].type) {
    case SWIG_LUA_INT:
      lua_pushstring(L,constants[i].name);
      lua_pushnumber(L,(lua_Number)constants[i].lvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_FLOAT:
      lua_pushstring(L,constants[i].name);
      lua_pushnumber(L,(lua_Number)constants[i].dvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_CHAR:
      lua_pushstring(L,constants[i].name);
      lua_pushfstring(L,"%c",(char)constants[i].lvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_STRING:
      lua_pushstring(L,constants[i].name);
      lua_pushstring(L,(char *) constants[i].pvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_POINTER:
      lua_pushstring(L,constants[i].name);
      SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_BINARY:
      lua_pushstring(L,constants[i].name);
      SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype);
      lua_rawset(L,-3);
      break;
    default:
      break;
    }
  }
}

/* -----------------------------------------------------------------------------
 * executing lua code from within the wrapper
 * ----------------------------------------------------------------------------- */

#ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */
#define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
#endif
/* Executes a C string in Lua a really simple way of calling lua from C
Unfortunately lua keeps changing its API's, so we need a conditional compile
In lua 5.0.X its lua_dostring()
In lua 5.1.X its luaL_dostring()
*/
SWIGINTERN int 
SWIG_Lua_dostring(lua_State *L, const char* str) {
  int ok,top;
  if (str==0 || str[0]==0) return 0; /* nothing to do */
  top=lua_gettop(L); /* save stack */
#if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501))
  ok=luaL_dostring(L,str);	/* looks like this is lua 5.1.X or later, good */
#else
  ok=lua_dostring(L,str);	/* might be lua 5.0.x, using lua_dostring */
#endif
  if (ok!=0) {
    SWIG_DOSTRING_FAIL(lua_tostring(L,-1));
  }
  lua_settop(L,top); /* restore the stack */
  return ok;
}    

#ifdef __cplusplus
}
#endif

/* ------------------------------ end luarun.swg  ------------------------------ */


/* -------- TYPES TABLE (BEGIN) -------- */

#define SWIGTYPE_p_GLenum swig_types[0]
#define SWIGTYPE_p_GLuint swig_types[1]
#define SWIGTYPE_p__cl_command_queue swig_types[2]
#define SWIGTYPE_p__cl_context swig_types[3]
#define SWIGTYPE_p__cl_device_id swig_types[4]
#define SWIGTYPE_p__cl_event swig_types[5]
#define SWIGTYPE_p__cl_image_format swig_types[6]
#define SWIGTYPE_p__cl_kernel swig_types[7]
#define SWIGTYPE_p__cl_mem swig_types[8]
#define SWIGTYPE_p__cl_platform_id swig_types[9]
#define SWIGTYPE_p__cl_program swig_types[10]
#define SWIGTYPE_p__cl_sampler swig_types[11]
#define SWIGTYPE_p_cl_charArray swig_types[12]
#define SWIGTYPE_p_cl_command_queueArray swig_types[13]
#define SWIGTYPE_p_cl_contextArray swig_types[14]
#define SWIGTYPE_p_cl_device_idArray swig_types[15]
#define SWIGTYPE_p_cl_eventArray swig_types[16]
#define SWIGTYPE_p_cl_kernelArray swig_types[17]
#define SWIGTYPE_p_cl_memArray swig_types[18]
#define SWIGTYPE_p_cl_platform_idArray swig_types[19]
#define SWIGTYPE_p_cl_programArray swig_types[20]
#define SWIGTYPE_p_cl_samplerArray swig_types[21]
#define SWIGTYPE_p_cl_ucharArray swig_types[22]
#define SWIGTYPE_p_double swig_types[23]
#define SWIGTYPE_p_f_p__cl_program_p_void__void swig_types[24]
#define SWIGTYPE_p_f_p_q_const__char_p_q_const__void_unsigned_int_p_void__void swig_types[25]
#define SWIGTYPE_p_f_p_void__void swig_types[26]
#define SWIGTYPE_p_float swig_types[27]
#define SWIGTYPE_p_int swig_types[28]
#define SWIGTYPE_p_intptr_t swig_types[29]
#define SWIGTYPE_p_long_long swig_types[30]
#define SWIGTYPE_p_p__cl_command_queue swig_types[31]
#define SWIGTYPE_p_p__cl_context swig_types[32]
#define SWIGTYPE_p_p__cl_device_id swig_types[33]
#define SWIGTYPE_p_p__cl_event swig_types[34]
#define SWIGTYPE_p_p__cl_kernel swig_types[35]
#define SWIGTYPE_p_p__cl_mem swig_types[36]
#define SWIGTYPE_p_p__cl_platform_id swig_types[37]
#define SWIGTYPE_p_p__cl_program swig_types[38]
#define SWIGTYPE_p_p__cl_sampler swig_types[39]
#define SWIGTYPE_p_p_char swig_types[40]
#define SWIGTYPE_p_p_unsigned_char swig_types[41]
#define SWIGTYPE_p_p_void swig_types[42]
#define SWIGTYPE_p_short swig_types[43]
#define SWIGTYPE_p_signed_char swig_types[44]
#define SWIGTYPE_p_unsigned_char swig_types[45]
#define SWIGTYPE_p_unsigned_int swig_types[46]
#define SWIGTYPE_p_unsigned_long_long swig_types[47]
#define SWIGTYPE_p_unsigned_short swig_types[48]
#define SWIGTYPE_p_void swig_types[49]
static swig_type_info *swig_types[51];
static swig_module_info swig_module = {swig_types, 50, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)

/* -------- TYPES TABLE (END) -------- */

#define SWIG_name      "luaopencl"
#define SWIG_init      luaopen_luaopencl
#define SWIG_init_user luaopen_luaopencl_user

#define SWIG_LUACODE   luaopen_luaopencl_luacode


namespace swig {
typedef struct{} LANGUAGE_OBJ;
}


#define WIN32_LEAN_AND_MEAN
#include <windows.h>

#include <CL/cl.h>
#include <CL/cl_gl.h>
#include <CL/cl_ext.h>


#ifdef __cplusplus	/* generic alloc/dealloc fns*/
#define SWIG_ALLOC_ARRAY(TYPE,LEN) 	new TYPE[LEN]
#define SWIG_FREE_ARRAY(PTR)		delete[] PTR;
#else
#define SWIG_ALLOC_ARRAY(TYPE,LEN) 	(TYPE *)malloc(LEN*sizeof(TYPE))
#define SWIG_FREE_ARRAY(PTR)		free(PTR);
#endif
/* counting the size of arrays:*/
SWIGINTERN int SWIG_itable_size(lua_State* L, int index)
{
	int n=0;
	while(1){
		lua_rawgeti(L,index,n+1);
		if (lua_isnil(L,-1))break;
		++n;
		lua_pop(L,1);
	}
	lua_pop(L,1);
	return n;
}

SWIGINTERN int SWIG_table_size(lua_State* L, int index)
{
	int n=0;
	lua_pushnil(L);  /* first key*/
	while (lua_next(L, index) != 0) {
		++n;
		lua_pop(L, 1);  /* removes `value'; keeps `key' for next iteration*/
	}
	return n;
}

/* super macro to declare array typemap helper fns */
#define SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE)\
	SWIGINTERN int SWIG_read_##NAME##_num_array(lua_State* L,int index,TYPE *array,int size){\
		int i;\
		for (i = 0; i < size; i++) {\
			lua_rawgeti(L,index,i+1);\
			if (lua_isnumber(L,-1)){\
				array[i] = (TYPE)lua_tonumber(L,-1);\
			} else {\
				lua_pop(L,1);\
				return 0;\
			}\
			lua_pop(L,1);\
		}\
		return 1;\
	}\
	SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_fixed(lua_State* L, int index, int size){\
		TYPE *array;\
		if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {\
			lua_pushfstring(L,"expected a table of size %d",size);\
			return 0;\
		}\
		array=SWIG_ALLOC_ARRAY(TYPE,size);\
		if (!SWIG_read_##NAME##_num_array(L,index,array,size)){\
			lua_pushstring(L,"table must contain numbers");\
			SWIG_FREE_ARRAY(array);\
			return 0;\
		}\
		return array;\
	}\
	SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_var(lua_State* L, int index, int* size)\
	{\
		TYPE *array;\
		if (!lua_istable(L,index)) {\
			lua_pushstring(L,"expected a table");\
			return 0;\
		}\
		*size=SWIG_itable_size(L,index);\
		if (*size<1){\
			lua_pushstring(L,"table appears to be empty");\
			return 0;\
		}\
		array=SWIG_ALLOC_ARRAY(TYPE,*size);\
		if (!SWIG_read_##NAME##_num_array(L,index,array,*size)){\
			lua_pushstring(L,"table must contain numbers");\
			SWIG_FREE_ARRAY(array);\
			return 0;\
		}\
		return array;\
	}\
	SWIGINTERN void SWIG_write_##NAME##_num_array(lua_State* L,TYPE *array,int size){\
		int i;\
		lua_newtable(L);\
		for (i = 0; i < size; i++){\
			lua_pushnumber(L,(lua_Number)array[i]);\
			lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ \
		}\
	}

SWIG_DECLARE_TYPEMAP_ARR_FN(int,int);
SWIG_DECLARE_TYPEMAP_ARR_FN(uint,unsigned int);
SWIG_DECLARE_TYPEMAP_ARR_FN(short,short);
SWIG_DECLARE_TYPEMAP_ARR_FN(ushort,unsigned short);
SWIG_DECLARE_TYPEMAP_ARR_FN(long,long);
SWIG_DECLARE_TYPEMAP_ARR_FN(ulong,unsigned long);
SWIG_DECLARE_TYPEMAP_ARR_FN(float,float);
SWIG_DECLARE_TYPEMAP_ARR_FN(double,double);

SWIGINTERN int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type){
	int i;
	for (i = 0; i < size; i++) {
		lua_rawgeti(L,index,i+1);
		if (!lua_isuserdata(L,-1) || SWIG_ConvertPtr(L,-1,&array[i],type,0)==-1){
			lua_pop(L,1);
			return 0;
		}
		lua_pop(L,1);
	}
	return 1;
}
SWIGINTERN void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type){
	void **array;
	if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {
		lua_pushfstring(L,"expected a table of size %d",size);
		return 0;
	}
	array=SWIG_ALLOC_ARRAY(void*,size);
	if (!SWIG_read_ptr_array(L,index,array,size,type)){
		lua_pushfstring(L,"table must contain pointers of type %s",type->name);
		SWIG_FREE_ARRAY(array);
		return 0;
	}
	return array;
}
SWIGINTERN void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type){
	void **array;
	if (!lua_istable(L,index)) {
		lua_pushstring(L,"expected a table");
		return 0;
	}
	*size=SWIG_itable_size(L,index);
	if (*size<1){
		lua_pushstring(L,"table appears to be empty");
		return 0;
	}
	array=SWIG_ALLOC_ARRAY(void*,*size);
	if (!SWIG_read_ptr_array(L,index,array,*size,type)){
		lua_pushfstring(L,"table must contain pointers of type %s",type->name);
		SWIG_FREE_ARRAY(array);
		return 0;
	}
	return array;
}
SWIGINTERN void SWIG_write_ptr_array(lua_State* L,void **array,int size,swig_type_info *type,int own){
	int i;
	lua_newtable(L);
	for (i = 0; i < size; i++){
		SWIG_NewPointerObj(L,array[i],type,own);
		lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/
	}
}


typedef cl_platform_id cl_platform_idArray;

SWIGINTERN cl_platform_idArray *new_cl_platform_idArray(int nelements){
  return new cl_platform_id[nelements];
}
SWIGINTERN void delete_cl_platform_idArray(cl_platform_idArray *self){
  delete [] self;
}
SWIGINTERN cl_platform_id cl_platform_idArray_getitem(cl_platform_idArray *self,int index){
  return self[index];
}
SWIGINTERN void cl_platform_idArray_setitem(cl_platform_idArray *self,int index,cl_platform_id value){
  self[index] = value;
}
SWIGINTERN cl_platform_id *cl_platform_idArray_cast(cl_platform_idArray *self){
  return self;
}
SWIGINTERN cl_platform_idArray *cl_platform_idArray_frompointer(cl_platform_id *t){
  return (cl_platform_idArray *) t;
}

typedef cl_device_id cl_device_idArray;

SWIGINTERN cl_device_idArray *new_cl_device_idArray(int nelements){
  return new cl_device_id[nelements];
}
SWIGINTERN void delete_cl_device_idArray(cl_device_idArray *self){
  delete [] self;
}
SWIGINTERN cl_device_id cl_device_idArray_getitem(cl_device_idArray *self,int index){
  return self[index];
}
SWIGINTERN void cl_device_idArray_setitem(cl_device_idArray *self,int index,cl_device_id value){
  self[index] = value;
}
SWIGINTERN cl_device_id *cl_device_idArray_cast(cl_device_idArray *self){
  return self;
}
SWIGINTERN cl_device_idArray *cl_device_idArray_frompointer(cl_device_id *t){
  return (cl_device_idArray *) t;
}

typedef cl_context cl_contextArray;

SWIGINTERN cl_contextArray *new_cl_contextArray(int nelements){
  return new cl_context[nelements];
}
SWIGINTERN void delete_cl_contextArray(cl_contextArray *self){
  delete [] self;
}
SWIGINTERN cl_context cl_contextArray_getitem(cl_contextArray *self,int index){
  return self[index];
}
SWIGINTERN void cl_contextArray_setitem(cl_contextArray *self,int index,cl_context value){
  self[index] = value;
}
SWIGINTERN cl_context *cl_contextArray_cast(cl_contextArray *self){
  return self;
}
SWIGINTERN cl_contextArray *cl_contextArray_frompointer(cl_context *t){
  return (cl_contextArray *) t;
}

typedef cl_command_queue cl_command_queueArray;

SWIGINTERN cl_command_queueArray *new_cl_command_queueArray(int nelements){
  return new cl_command_queue[nelements];
}
SWIGINTERN void delete_cl_command_queueArray(cl_command_queueArray *self){
  delete [] self;
}
SWIGINTERN cl_command_queue cl_command_queueArray_getitem(cl_command_queueArray *self,int index){
  return self[index];
}
SWIGINTERN void cl_command_queueArray_setitem(cl_command_queueArray *self,int index,cl_command_queue value){
  self[index] = value;
}
SWIGINTERN cl_command_queue *cl_command_queueArray_cast(cl_command_queueArray *self){
  return self;
}
SWIGINTERN cl_command_queueArray *cl_command_queueArray_frompointer(cl_command_queue *t){
  return (cl_command_queueArray *) t;
}

typedef cl_mem cl_memArray;

SWIGINTERN cl_memArray *new_cl_memArray(int nelements){
  return new cl_mem[nelements];
}
SWIGINTERN void delete_cl_memArray(cl_memArray *self){
  delete [] self;
}
SWIGINTERN cl_mem cl_memArray_getitem(cl_memArray *self,int index){
  return self[index];
}
SWIGINTERN void cl_memArray_setitem(cl_memArray *self,int index,cl_mem value){
  self[index] = value;
}
SWIGINTERN cl_mem *cl_memArray_cast(cl_memArray *self){
  return self;
}
SWIGINTERN cl_memArray *cl_memArray_frompointer(cl_mem *t){
  return (cl_memArray *) t;
}

typedef cl_program cl_programArray;

SWIGINTERN cl_programArray *new_cl_programArray(int nelements){
  return new cl_program[nelements];
}
SWIGINTERN void delete_cl_programArray(cl_programArray *self){
  delete [] self;
}
SWIGINTERN cl_program cl_programArray_getitem(cl_programArray *self,int index){
  return self[index];
}
SWIGINTERN void cl_programArray_setitem(cl_programArray *self,int index,cl_program value){
  self[index] = value;
}
SWIGINTERN cl_program *cl_programArray_cast(cl_programArray *self){
  return self;
}
SWIGINTERN cl_programArray *cl_programArray_frompointer(cl_program *t){
  return (cl_programArray *) t;
}

typedef cl_kernel cl_kernelArray;

SWIGINTERN cl_kernelArray *new_cl_kernelArray(int nelements){
  return new cl_kernel[nelements];
}
SWIGINTERN void delete_cl_kernelArray(cl_kernelArray *self){
  delete [] self;
}
SWIGINTERN cl_kernel cl_kernelArray_getitem(cl_kernelArray *self,int index){
  return self[index];
}
SWIGINTERN void cl_kernelArray_setitem(cl_kernelArray *self,int index,cl_kernel value){
  self[index] = value;
}
SWIGINTERN cl_kernel *cl_kernelArray_cast(cl_kernelArray *self){
  return self;
}
SWIGINTERN cl_kernelArray *cl_kernelArray_frompointer(cl_kernel *t){
  return (cl_kernelArray *) t;
}

typedef cl_event cl_eventArray;

SWIGINTERN cl_eventArray *new_cl_eventArray(int nelements){
  return new cl_event[nelements];
}
SWIGINTERN void delete_cl_eventArray(cl_eventArray *self){
  delete [] self;
}
SWIGINTERN cl_event cl_eventArray_getitem(cl_eventArray *self,int index){
  return self[index];
}
SWIGINTERN void cl_eventArray_setitem(cl_eventArray *self,int index,cl_event value){
  self[index] = value;
}
SWIGINTERN cl_event *cl_eventArray_cast(cl_eventArray *self){
  return self;
}
SWIGINTERN cl_eventArray *cl_eventArray_frompointer(cl_event *t){
  return (cl_eventArray *) t;
}

typedef cl_sampler cl_samplerArray;

SWIGINTERN cl_samplerArray *new_cl_samplerArray(int nelements){
  return new cl_sampler[nelements];
}
SWIGINTERN void delete_cl_samplerArray(cl_samplerArray *self){
  delete [] self;
}
SWIGINTERN cl_sampler cl_samplerArray_getitem(cl_samplerArray *self,int index){
  return self[index];
}
SWIGINTERN void cl_samplerArray_setitem(cl_samplerArray *self,int index,cl_sampler value){
  self[index] = value;
}
SWIGINTERN cl_sampler *cl_samplerArray_cast(cl_samplerArray *self){
  return self;
}
SWIGINTERN cl_samplerArray *cl_samplerArray_frompointer(cl_sampler *t){
  return (cl_samplerArray *) t;
}

typedef cl_uchar cl_ucharArray;

SWIGINTERN cl_ucharArray *new_cl_ucharArray(int nelements){
  return new cl_uchar[nelements];
}
SWIGINTERN void delete_cl_ucharArray(cl_ucharArray *self){
  delete [] self;
}
SWIGINTERN cl_uchar cl_ucharArray_getitem(cl_ucharArray *self,int index){
  return self[index];
}
SWIGINTERN void cl_ucharArray_setitem(cl_ucharArray *self,int index,cl_uchar value){
  self[index] = value;
}
SWIGINTERN cl_uchar *cl_ucharArray_cast(cl_ucharArray *self){
  return self;
}
SWIGINTERN cl_ucharArray *cl_ucharArray_frompointer(cl_uchar *t){
  return (cl_ucharArray *) t;
}

typedef cl_char cl_charArray;

SWIGINTERN cl_charArray *new_cl_charArray(int nelements){
  return new cl_char[nelements];
}
SWIGINTERN void delete_cl_charArray(cl_charArray *self){
  delete [] self;
}
SWIGINTERN cl_char cl_charArray_getitem(cl_charArray *self,int index){
  return self[index];
}
SWIGINTERN void cl_charArray_setitem(cl_charArray *self,int index,cl_char value){
  self[index] = value;
}
SWIGINTERN cl_char *cl_charArray_cast(cl_charArray *self){
  return self;
}
SWIGINTERN cl_charArray *cl_charArray_frompointer(cl_char *t){
  return (cl_charArray *) t;
}

void swigbinstring(void* indata, size_t insize, char **buffer, size_t *size)
{
	*buffer = (char*)indata;
	*size = insize;
}


char* swigstring(void* indata)
{
	return (char*)indata;
}


template<class T>
T swigptr_to(void* indata, int idx=0)
{
	return *(((T*)indata)+idx);
}


const size_t SWIG_PTRSIZE = sizeof(void*);


int native_SWIG_convertto(lua_State*L)
{
	void* luserdata;
	const char* name;
	int own;
	swig_type_info* info;
	swig_module_info* module;
	
	if (lua_gettop(L)<3)
		return 0;
	
	module = SWIG_GetModule(L);
	if (!module)
		return 0;
	
	if (lua_type(L,-3) != LUA_TLIGHTUSERDATA)
		return 0;
	
	if (lua_type(L,-1) != LUA_TBOOLEAN)
		return 0;

	luserdata = lua_touserdata(L,-3);
	
	if (lua_type(L,-2) == LUA_TSTRING ){
		name = lua_tostring(L,-2);
		info = SWIG_TypeQueryModule(module,module,name);	
		if (!info) 
			return 0;
	}
	else if (lua_type(L,-2) == LUA_TLIGHTUSERDATA){
		info = (swig_type_info*)lua_touserdata(L,-2);
	}
	else{
		return 0;
	}
	
	own = lua_toboolean(L,-1);

	SWIG_NewPointerObj(L,luserdata,info,own);

	return 1;
}


int native_SWIG_get_typeinfo(lua_State*L) 
{
	const char* name;
	swig_type_info *info;
	swig_module_info* module;
	
	if (lua_gettop(L)<1)
		return 0;
	
	module = SWIG_GetModule(L);
	if (!module)
		return 0;
	
	if (lua_type(L,-1) != LUA_TSTRING)
		return 0;

	name = lua_tostring(L,-2);
	info = SWIG_TypeQueryModule(module,module,name);	
	if (!info) 
		return 0;
	
	lua_pushlightuserdata(L,info);

	return 1;
}

#ifdef __cplusplus
extern "C" {
#endif
static int _wrap_new_cl_platform_idArray(lua_State* L) {
  int SWIG_arg = 0;
  int arg1 ;
  cl_platform_idArray *result = 0 ;
  
  SWIG_check_num_args("cl_platform_idArray",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("cl_platform_idArray",1,"int");
  arg1 = (int)lua_tonumber(L, 1);
  result = (cl_platform_idArray *)new_cl_platform_idArray(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_platform_idArray,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_platform_idArray___getitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_platform_idArray *arg1 = (cl_platform_idArray *) 0 ;
  int arg2 ;
  cl_platform_id result;
  
  SWIG_check_num_args("getitem",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getitem",1,"cl_platform_idArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("getitem",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_platform_idArray,0))){
    SWIG_fail_ptr("cl_platform_idArray___getitem",1,SWIGTYPE_p_cl_platform_idArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (cl_platform_id)cl_platform_idArray_getitem(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_platform_id,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_platform_idArray___setitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_platform_idArray *arg1 = (cl_platform_idArray *) 0 ;
  int arg2 ;
  cl_platform_id arg3 = (cl_platform_id) 0 ;
  
  SWIG_check_num_args("setitem",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setitem",1,"cl_platform_idArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("setitem",2,"int");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("setitem",3,"cl_platform_id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_platform_idArray,0))){
    SWIG_fail_ptr("cl_platform_idArray___setitem",1,SWIGTYPE_p_cl_platform_idArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p__cl_platform_id,0))){
    SWIG_fail_ptr("cl_platform_idArray___setitem",3,SWIGTYPE_p__cl_platform_id);
  }
  
  cl_platform_idArray_setitem(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_platform_idArray_cast(lua_State* L) {
  int SWIG_arg = 0;
  cl_platform_idArray *arg1 = (cl_platform_idArray *) 0 ;
  cl_platform_id *result = 0 ;
  
  SWIG_check_num_args("cast",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cast",1,"cl_platform_idArray *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_platform_idArray,0))){
    SWIG_fail_ptr("cl_platform_idArray_cast",1,SWIGTYPE_p_cl_platform_idArray);
  }
  
  result = (cl_platform_id *)cl_platform_idArray_cast(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_p__cl_platform_id,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_platform_idArray_frompointer(lua_State* L) {
  int SWIG_arg = 0;
  cl_platform_id *arg1 = (cl_platform_id *) 0 ;
  cl_platform_idArray *result = 0 ;
  
  SWIG_check_num_args("cl_platform_idArray_frompointer",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cl_platform_idArray_frompointer",1,"cl_platform_id *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_p__cl_platform_id,0))){
    SWIG_fail_ptr("cl_platform_idArray_frompointer",1,SWIGTYPE_p_p__cl_platform_id);
  }
  
  result = (cl_platform_idArray *)cl_platform_idArray_frompointer(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_platform_idArray,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_cl_platform_idArray(void *obj) {
cl_platform_idArray *arg1 = (cl_platform_idArray *) obj;
delete_cl_platform_idArray(arg1);
}
static swig_lua_method swig_cl_platform_idArray_methods[] = {
    {"__getitem", _wrap_cl_platform_idArray___getitem}, 
    {"__setitem", _wrap_cl_platform_idArray___setitem}, 
    {"cast", _wrap_cl_platform_idArray_cast}, 
    {0,0}
};
static swig_lua_attribute swig_cl_platform_idArray_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_cl_platform_idArray_bases[] = {0};
static const char *swig_cl_platform_idArray_base_names[] = {0};
static swig_lua_class _wrap_class_cl_platform_idArray = { "cl_platform_idArray", &SWIGTYPE_p_cl_platform_idArray,_wrap_new_cl_platform_idArray, swig_delete_cl_platform_idArray, swig_cl_platform_idArray_methods, swig_cl_platform_idArray_attributes, swig_cl_platform_idArray_bases, swig_cl_platform_idArray_base_names };

static int _wrap_new_cl_device_idArray(lua_State* L) {
  int SWIG_arg = 0;
  int arg1 ;
  cl_device_idArray *result = 0 ;
  
  SWIG_check_num_args("cl_device_idArray",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("cl_device_idArray",1,"int");
  arg1 = (int)lua_tonumber(L, 1);
  result = (cl_device_idArray *)new_cl_device_idArray(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_device_idArray,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_device_idArray___getitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_device_idArray *arg1 = (cl_device_idArray *) 0 ;
  int arg2 ;
  cl_device_id result;
  
  SWIG_check_num_args("getitem",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getitem",1,"cl_device_idArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("getitem",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_device_idArray,0))){
    SWIG_fail_ptr("cl_device_idArray___getitem",1,SWIGTYPE_p_cl_device_idArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (cl_device_id)cl_device_idArray_getitem(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_device_id,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_device_idArray___setitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_device_idArray *arg1 = (cl_device_idArray *) 0 ;
  int arg2 ;
  cl_device_id arg3 = (cl_device_id) 0 ;
  
  SWIG_check_num_args("setitem",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setitem",1,"cl_device_idArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("setitem",2,"int");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("setitem",3,"cl_device_id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_device_idArray,0))){
    SWIG_fail_ptr("cl_device_idArray___setitem",1,SWIGTYPE_p_cl_device_idArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p__cl_device_id,0))){
    SWIG_fail_ptr("cl_device_idArray___setitem",3,SWIGTYPE_p__cl_device_id);
  }
  
  cl_device_idArray_setitem(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_device_idArray_cast(lua_State* L) {
  int SWIG_arg = 0;
  cl_device_idArray *arg1 = (cl_device_idArray *) 0 ;
  cl_device_id *result = 0 ;
  
  SWIG_check_num_args("cast",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cast",1,"cl_device_idArray *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_device_idArray,0))){
    SWIG_fail_ptr("cl_device_idArray_cast",1,SWIGTYPE_p_cl_device_idArray);
  }
  
  result = (cl_device_id *)cl_device_idArray_cast(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_p__cl_device_id,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_device_idArray_frompointer(lua_State* L) {
  int SWIG_arg = 0;
  cl_device_id *arg1 = (cl_device_id *) 0 ;
  cl_device_idArray *result = 0 ;
  
  SWIG_check_num_args("cl_device_idArray_frompointer",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cl_device_idArray_frompointer",1,"cl_device_id *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_p__cl_device_id,0))){
    SWIG_fail_ptr("cl_device_idArray_frompointer",1,SWIGTYPE_p_p__cl_device_id);
  }
  
  result = (cl_device_idArray *)cl_device_idArray_frompointer(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_device_idArray,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_cl_device_idArray(void *obj) {
cl_device_idArray *arg1 = (cl_device_idArray *) obj;
delete_cl_device_idArray(arg1);
}
static swig_lua_method swig_cl_device_idArray_methods[] = {
    {"__getitem", _wrap_cl_device_idArray___getitem}, 
    {"__setitem", _wrap_cl_device_idArray___setitem}, 
    {"cast", _wrap_cl_device_idArray_cast}, 
    {0,0}
};
static swig_lua_attribute swig_cl_device_idArray_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_cl_device_idArray_bases[] = {0};
static const char *swig_cl_device_idArray_base_names[] = {0};
static swig_lua_class _wrap_class_cl_device_idArray = { "cl_device_idArray", &SWIGTYPE_p_cl_device_idArray,_wrap_new_cl_device_idArray, swig_delete_cl_device_idArray, swig_cl_device_idArray_methods, swig_cl_device_idArray_attributes, swig_cl_device_idArray_bases, swig_cl_device_idArray_base_names };

static int _wrap_new_cl_contextArray(lua_State* L) {
  int SWIG_arg = 0;
  int arg1 ;
  cl_contextArray *result = 0 ;
  
  SWIG_check_num_args("cl_contextArray",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("cl_contextArray",1,"int");
  arg1 = (int)lua_tonumber(L, 1);
  result = (cl_contextArray *)new_cl_contextArray(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_contextArray,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_contextArray___getitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_contextArray *arg1 = (cl_contextArray *) 0 ;
  int arg2 ;
  cl_context result;
  
  SWIG_check_num_args("getitem",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getitem",1,"cl_contextArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("getitem",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_contextArray,0))){
    SWIG_fail_ptr("cl_contextArray___getitem",1,SWIGTYPE_p_cl_contextArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (cl_context)cl_contextArray_getitem(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_context,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_contextArray___setitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_contextArray *arg1 = (cl_contextArray *) 0 ;
  int arg2 ;
  cl_context arg3 = (cl_context) 0 ;
  
  SWIG_check_num_args("setitem",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setitem",1,"cl_contextArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("setitem",2,"int");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("setitem",3,"cl_context");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_contextArray,0))){
    SWIG_fail_ptr("cl_contextArray___setitem",1,SWIGTYPE_p_cl_contextArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p__cl_context,0))){
    SWIG_fail_ptr("cl_contextArray___setitem",3,SWIGTYPE_p__cl_context);
  }
  
  cl_contextArray_setitem(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_contextArray_cast(lua_State* L) {
  int SWIG_arg = 0;
  cl_contextArray *arg1 = (cl_contextArray *) 0 ;
  cl_context *result = 0 ;
  
  SWIG_check_num_args("cast",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cast",1,"cl_contextArray *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_contextArray,0))){
    SWIG_fail_ptr("cl_contextArray_cast",1,SWIGTYPE_p_cl_contextArray);
  }
  
  result = (cl_context *)cl_contextArray_cast(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_p__cl_context,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_contextArray_frompointer(lua_State* L) {
  int SWIG_arg = 0;
  cl_context *arg1 = (cl_context *) 0 ;
  cl_contextArray *result = 0 ;
  
  SWIG_check_num_args("cl_contextArray_frompointer",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cl_contextArray_frompointer",1,"cl_context *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_p__cl_context,0))){
    SWIG_fail_ptr("cl_contextArray_frompointer",1,SWIGTYPE_p_p__cl_context);
  }
  
  result = (cl_contextArray *)cl_contextArray_frompointer(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_contextArray,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_cl_contextArray(void *obj) {
cl_contextArray *arg1 = (cl_contextArray *) obj;
delete_cl_contextArray(arg1);
}
static swig_lua_method swig_cl_contextArray_methods[] = {
    {"__getitem", _wrap_cl_contextArray___getitem}, 
    {"__setitem", _wrap_cl_contextArray___setitem}, 
    {"cast", _wrap_cl_contextArray_cast}, 
    {0,0}
};
static swig_lua_attribute swig_cl_contextArray_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_cl_contextArray_bases[] = {0};
static const char *swig_cl_contextArray_base_names[] = {0};
static swig_lua_class _wrap_class_cl_contextArray = { "cl_contextArray", &SWIGTYPE_p_cl_contextArray,_wrap_new_cl_contextArray, swig_delete_cl_contextArray, swig_cl_contextArray_methods, swig_cl_contextArray_attributes, swig_cl_contextArray_bases, swig_cl_contextArray_base_names };

static int _wrap_new_cl_command_queueArray(lua_State* L) {
  int SWIG_arg = 0;
  int arg1 ;
  cl_command_queueArray *result = 0 ;
  
  SWIG_check_num_args("cl_command_queueArray",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("cl_command_queueArray",1,"int");
  arg1 = (int)lua_tonumber(L, 1);
  result = (cl_command_queueArray *)new_cl_command_queueArray(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_command_queueArray,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_command_queueArray___getitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queueArray *arg1 = (cl_command_queueArray *) 0 ;
  int arg2 ;
  cl_command_queue result;
  
  SWIG_check_num_args("getitem",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getitem",1,"cl_command_queueArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("getitem",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_command_queueArray,0))){
    SWIG_fail_ptr("cl_command_queueArray___getitem",1,SWIGTYPE_p_cl_command_queueArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (cl_command_queue)cl_command_queueArray_getitem(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_command_queue,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_command_queueArray___setitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queueArray *arg1 = (cl_command_queueArray *) 0 ;
  int arg2 ;
  cl_command_queue arg3 = (cl_command_queue) 0 ;
  
  SWIG_check_num_args("setitem",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setitem",1,"cl_command_queueArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("setitem",2,"int");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("setitem",3,"cl_command_queue");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_command_queueArray,0))){
    SWIG_fail_ptr("cl_command_queueArray___setitem",1,SWIGTYPE_p_cl_command_queueArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("cl_command_queueArray___setitem",3,SWIGTYPE_p__cl_command_queue);
  }
  
  cl_command_queueArray_setitem(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_command_queueArray_cast(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queueArray *arg1 = (cl_command_queueArray *) 0 ;
  cl_command_queue *result = 0 ;
  
  SWIG_check_num_args("cast",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cast",1,"cl_command_queueArray *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_command_queueArray,0))){
    SWIG_fail_ptr("cl_command_queueArray_cast",1,SWIGTYPE_p_cl_command_queueArray);
  }
  
  result = (cl_command_queue *)cl_command_queueArray_cast(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_p__cl_command_queue,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_command_queueArray_frompointer(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue *arg1 = (cl_command_queue *) 0 ;
  cl_command_queueArray *result = 0 ;
  
  SWIG_check_num_args("cl_command_queueArray_frompointer",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cl_command_queueArray_frompointer",1,"cl_command_queue *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_p__cl_command_queue,0))){
    SWIG_fail_ptr("cl_command_queueArray_frompointer",1,SWIGTYPE_p_p__cl_command_queue);
  }
  
  result = (cl_command_queueArray *)cl_command_queueArray_frompointer(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_command_queueArray,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_cl_command_queueArray(void *obj) {
cl_command_queueArray *arg1 = (cl_command_queueArray *) obj;
delete_cl_command_queueArray(arg1);
}
static swig_lua_method swig_cl_command_queueArray_methods[] = {
    {"__getitem", _wrap_cl_command_queueArray___getitem}, 
    {"__setitem", _wrap_cl_command_queueArray___setitem}, 
    {"cast", _wrap_cl_command_queueArray_cast}, 
    {0,0}
};
static swig_lua_attribute swig_cl_command_queueArray_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_cl_command_queueArray_bases[] = {0};
static const char *swig_cl_command_queueArray_base_names[] = {0};
static swig_lua_class _wrap_class_cl_command_queueArray = { "cl_command_queueArray", &SWIGTYPE_p_cl_command_queueArray,_wrap_new_cl_command_queueArray, swig_delete_cl_command_queueArray, swig_cl_command_queueArray_methods, swig_cl_command_queueArray_attributes, swig_cl_command_queueArray_bases, swig_cl_command_queueArray_base_names };

static int _wrap_new_cl_memArray(lua_State* L) {
  int SWIG_arg = 0;
  int arg1 ;
  cl_memArray *result = 0 ;
  
  SWIG_check_num_args("cl_memArray",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("cl_memArray",1,"int");
  arg1 = (int)lua_tonumber(L, 1);
  result = (cl_memArray *)new_cl_memArray(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_memArray,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_memArray___getitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_memArray *arg1 = (cl_memArray *) 0 ;
  int arg2 ;
  cl_mem result;
  
  SWIG_check_num_args("getitem",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getitem",1,"cl_memArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("getitem",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_memArray,0))){
    SWIG_fail_ptr("cl_memArray___getitem",1,SWIGTYPE_p_cl_memArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (cl_mem)cl_memArray_getitem(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_mem,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_memArray___setitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_memArray *arg1 = (cl_memArray *) 0 ;
  int arg2 ;
  cl_mem arg3 = (cl_mem) 0 ;
  
  SWIG_check_num_args("setitem",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setitem",1,"cl_memArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("setitem",2,"int");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("setitem",3,"cl_mem");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_memArray,0))){
    SWIG_fail_ptr("cl_memArray___setitem",1,SWIGTYPE_p_cl_memArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("cl_memArray___setitem",3,SWIGTYPE_p__cl_mem);
  }
  
  cl_memArray_setitem(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_memArray_cast(lua_State* L) {
  int SWIG_arg = 0;
  cl_memArray *arg1 = (cl_memArray *) 0 ;
  cl_mem *result = 0 ;
  
  SWIG_check_num_args("cast",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cast",1,"cl_memArray *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_memArray,0))){
    SWIG_fail_ptr("cl_memArray_cast",1,SWIGTYPE_p_cl_memArray);
  }
  
  result = (cl_mem *)cl_memArray_cast(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_p__cl_mem,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_memArray_frompointer(lua_State* L) {
  int SWIG_arg = 0;
  cl_mem *arg1 = (cl_mem *) 0 ;
  cl_memArray *result = 0 ;
  
  SWIG_check_num_args("cl_memArray_frompointer",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cl_memArray_frompointer",1,"cl_mem *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_p__cl_mem,0))){
    SWIG_fail_ptr("cl_memArray_frompointer",1,SWIGTYPE_p_p__cl_mem);
  }
  
  result = (cl_memArray *)cl_memArray_frompointer(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_memArray,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_cl_memArray(void *obj) {
cl_memArray *arg1 = (cl_memArray *) obj;
delete_cl_memArray(arg1);
}
static swig_lua_method swig_cl_memArray_methods[] = {
    {"__getitem", _wrap_cl_memArray___getitem}, 
    {"__setitem", _wrap_cl_memArray___setitem}, 
    {"cast", _wrap_cl_memArray_cast}, 
    {0,0}
};
static swig_lua_attribute swig_cl_memArray_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_cl_memArray_bases[] = {0};
static const char *swig_cl_memArray_base_names[] = {0};
static swig_lua_class _wrap_class_cl_memArray = { "cl_memArray", &SWIGTYPE_p_cl_memArray,_wrap_new_cl_memArray, swig_delete_cl_memArray, swig_cl_memArray_methods, swig_cl_memArray_attributes, swig_cl_memArray_bases, swig_cl_memArray_base_names };

static int _wrap_new_cl_programArray(lua_State* L) {
  int SWIG_arg = 0;
  int arg1 ;
  cl_programArray *result = 0 ;
  
  SWIG_check_num_args("cl_programArray",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("cl_programArray",1,"int");
  arg1 = (int)lua_tonumber(L, 1);
  result = (cl_programArray *)new_cl_programArray(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_programArray,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_programArray___getitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_programArray *arg1 = (cl_programArray *) 0 ;
  int arg2 ;
  cl_program result;
  
  SWIG_check_num_args("getitem",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getitem",1,"cl_programArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("getitem",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_programArray,0))){
    SWIG_fail_ptr("cl_programArray___getitem",1,SWIGTYPE_p_cl_programArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (cl_program)cl_programArray_getitem(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_program,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_programArray___setitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_programArray *arg1 = (cl_programArray *) 0 ;
  int arg2 ;
  cl_program arg3 = (cl_program) 0 ;
  
  SWIG_check_num_args("setitem",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setitem",1,"cl_programArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("setitem",2,"int");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("setitem",3,"cl_program");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_programArray,0))){
    SWIG_fail_ptr("cl_programArray___setitem",1,SWIGTYPE_p_cl_programArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p__cl_program,0))){
    SWIG_fail_ptr("cl_programArray___setitem",3,SWIGTYPE_p__cl_program);
  }
  
  cl_programArray_setitem(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_programArray_cast(lua_State* L) {
  int SWIG_arg = 0;
  cl_programArray *arg1 = (cl_programArray *) 0 ;
  cl_program *result = 0 ;
  
  SWIG_check_num_args("cast",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cast",1,"cl_programArray *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_programArray,0))){
    SWIG_fail_ptr("cl_programArray_cast",1,SWIGTYPE_p_cl_programArray);
  }
  
  result = (cl_program *)cl_programArray_cast(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_p__cl_program,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_programArray_frompointer(lua_State* L) {
  int SWIG_arg = 0;
  cl_program *arg1 = (cl_program *) 0 ;
  cl_programArray *result = 0 ;
  
  SWIG_check_num_args("cl_programArray_frompointer",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cl_programArray_frompointer",1,"cl_program *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_p__cl_program,0))){
    SWIG_fail_ptr("cl_programArray_frompointer",1,SWIGTYPE_p_p__cl_program);
  }
  
  result = (cl_programArray *)cl_programArray_frompointer(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_programArray,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_cl_programArray(void *obj) {
cl_programArray *arg1 = (cl_programArray *) obj;
delete_cl_programArray(arg1);
}
static swig_lua_method swig_cl_programArray_methods[] = {
    {"__getitem", _wrap_cl_programArray___getitem}, 
    {"__setitem", _wrap_cl_programArray___setitem}, 
    {"cast", _wrap_cl_programArray_cast}, 
    {0,0}
};
static swig_lua_attribute swig_cl_programArray_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_cl_programArray_bases[] = {0};
static const char *swig_cl_programArray_base_names[] = {0};
static swig_lua_class _wrap_class_cl_programArray = { "cl_programArray", &SWIGTYPE_p_cl_programArray,_wrap_new_cl_programArray, swig_delete_cl_programArray, swig_cl_programArray_methods, swig_cl_programArray_attributes, swig_cl_programArray_bases, swig_cl_programArray_base_names };

static int _wrap_new_cl_kernelArray(lua_State* L) {
  int SWIG_arg = 0;
  int arg1 ;
  cl_kernelArray *result = 0 ;
  
  SWIG_check_num_args("cl_kernelArray",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("cl_kernelArray",1,"int");
  arg1 = (int)lua_tonumber(L, 1);
  result = (cl_kernelArray *)new_cl_kernelArray(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_kernelArray,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_kernelArray___getitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_kernelArray *arg1 = (cl_kernelArray *) 0 ;
  int arg2 ;
  cl_kernel result;
  
  SWIG_check_num_args("getitem",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getitem",1,"cl_kernelArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("getitem",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_kernelArray,0))){
    SWIG_fail_ptr("cl_kernelArray___getitem",1,SWIGTYPE_p_cl_kernelArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (cl_kernel)cl_kernelArray_getitem(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_kernel,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_kernelArray___setitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_kernelArray *arg1 = (cl_kernelArray *) 0 ;
  int arg2 ;
  cl_kernel arg3 = (cl_kernel) 0 ;
  
  SWIG_check_num_args("setitem",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setitem",1,"cl_kernelArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("setitem",2,"int");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("setitem",3,"cl_kernel");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_kernelArray,0))){
    SWIG_fail_ptr("cl_kernelArray___setitem",1,SWIGTYPE_p_cl_kernelArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p__cl_kernel,0))){
    SWIG_fail_ptr("cl_kernelArray___setitem",3,SWIGTYPE_p__cl_kernel);
  }
  
  cl_kernelArray_setitem(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_kernelArray_cast(lua_State* L) {
  int SWIG_arg = 0;
  cl_kernelArray *arg1 = (cl_kernelArray *) 0 ;
  cl_kernel *result = 0 ;
  
  SWIG_check_num_args("cast",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cast",1,"cl_kernelArray *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_kernelArray,0))){
    SWIG_fail_ptr("cl_kernelArray_cast",1,SWIGTYPE_p_cl_kernelArray);
  }
  
  result = (cl_kernel *)cl_kernelArray_cast(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_p__cl_kernel,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_kernelArray_frompointer(lua_State* L) {
  int SWIG_arg = 0;
  cl_kernel *arg1 = (cl_kernel *) 0 ;
  cl_kernelArray *result = 0 ;
  
  SWIG_check_num_args("cl_kernelArray_frompointer",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cl_kernelArray_frompointer",1,"cl_kernel *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_p__cl_kernel,0))){
    SWIG_fail_ptr("cl_kernelArray_frompointer",1,SWIGTYPE_p_p__cl_kernel);
  }
  
  result = (cl_kernelArray *)cl_kernelArray_frompointer(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_kernelArray,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_cl_kernelArray(void *obj) {
cl_kernelArray *arg1 = (cl_kernelArray *) obj;
delete_cl_kernelArray(arg1);
}
static swig_lua_method swig_cl_kernelArray_methods[] = {
    {"__getitem", _wrap_cl_kernelArray___getitem}, 
    {"__setitem", _wrap_cl_kernelArray___setitem}, 
    {"cast", _wrap_cl_kernelArray_cast}, 
    {0,0}
};
static swig_lua_attribute swig_cl_kernelArray_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_cl_kernelArray_bases[] = {0};
static const char *swig_cl_kernelArray_base_names[] = {0};
static swig_lua_class _wrap_class_cl_kernelArray = { "cl_kernelArray", &SWIGTYPE_p_cl_kernelArray,_wrap_new_cl_kernelArray, swig_delete_cl_kernelArray, swig_cl_kernelArray_methods, swig_cl_kernelArray_attributes, swig_cl_kernelArray_bases, swig_cl_kernelArray_base_names };

static int _wrap_new_cl_eventArray(lua_State* L) {
  int SWIG_arg = 0;
  int arg1 ;
  cl_eventArray *result = 0 ;
  
  SWIG_check_num_args("cl_eventArray",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("cl_eventArray",1,"int");
  arg1 = (int)lua_tonumber(L, 1);
  result = (cl_eventArray *)new_cl_eventArray(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_eventArray,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_eventArray___getitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_eventArray *arg1 = (cl_eventArray *) 0 ;
  int arg2 ;
  cl_event result;
  
  SWIG_check_num_args("getitem",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getitem",1,"cl_eventArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("getitem",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_eventArray,0))){
    SWIG_fail_ptr("cl_eventArray___getitem",1,SWIGTYPE_p_cl_eventArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (cl_event)cl_eventArray_getitem(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_event,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_eventArray___setitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_eventArray *arg1 = (cl_eventArray *) 0 ;
  int arg2 ;
  cl_event arg3 = (cl_event) 0 ;
  
  SWIG_check_num_args("setitem",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setitem",1,"cl_eventArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("setitem",2,"int");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("setitem",3,"cl_event");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_eventArray,0))){
    SWIG_fail_ptr("cl_eventArray___setitem",1,SWIGTYPE_p_cl_eventArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p__cl_event,0))){
    SWIG_fail_ptr("cl_eventArray___setitem",3,SWIGTYPE_p__cl_event);
  }
  
  cl_eventArray_setitem(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_eventArray_cast(lua_State* L) {
  int SWIG_arg = 0;
  cl_eventArray *arg1 = (cl_eventArray *) 0 ;
  cl_event *result = 0 ;
  
  SWIG_check_num_args("cast",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cast",1,"cl_eventArray *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_eventArray,0))){
    SWIG_fail_ptr("cl_eventArray_cast",1,SWIGTYPE_p_cl_eventArray);
  }
  
  result = (cl_event *)cl_eventArray_cast(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_p__cl_event,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_eventArray_frompointer(lua_State* L) {
  int SWIG_arg = 0;
  cl_event *arg1 = (cl_event *) 0 ;
  cl_eventArray *result = 0 ;
  
  SWIG_check_num_args("cl_eventArray_frompointer",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cl_eventArray_frompointer",1,"cl_event *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("cl_eventArray_frompointer",1,SWIGTYPE_p_p__cl_event);
  }
  
  result = (cl_eventArray *)cl_eventArray_frompointer(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_eventArray,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_cl_eventArray(void *obj) {
cl_eventArray *arg1 = (cl_eventArray *) obj;
delete_cl_eventArray(arg1);
}
static swig_lua_method swig_cl_eventArray_methods[] = {
    {"__getitem", _wrap_cl_eventArray___getitem}, 
    {"__setitem", _wrap_cl_eventArray___setitem}, 
    {"cast", _wrap_cl_eventArray_cast}, 
    {0,0}
};
static swig_lua_attribute swig_cl_eventArray_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_cl_eventArray_bases[] = {0};
static const char *swig_cl_eventArray_base_names[] = {0};
static swig_lua_class _wrap_class_cl_eventArray = { "cl_eventArray", &SWIGTYPE_p_cl_eventArray,_wrap_new_cl_eventArray, swig_delete_cl_eventArray, swig_cl_eventArray_methods, swig_cl_eventArray_attributes, swig_cl_eventArray_bases, swig_cl_eventArray_base_names };

static int _wrap_new_cl_samplerArray(lua_State* L) {
  int SWIG_arg = 0;
  int arg1 ;
  cl_samplerArray *result = 0 ;
  
  SWIG_check_num_args("cl_samplerArray",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("cl_samplerArray",1,"int");
  arg1 = (int)lua_tonumber(L, 1);
  result = (cl_samplerArray *)new_cl_samplerArray(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_samplerArray,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_samplerArray___getitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_samplerArray *arg1 = (cl_samplerArray *) 0 ;
  int arg2 ;
  cl_sampler result;
  
  SWIG_check_num_args("getitem",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getitem",1,"cl_samplerArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("getitem",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_samplerArray,0))){
    SWIG_fail_ptr("cl_samplerArray___getitem",1,SWIGTYPE_p_cl_samplerArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (cl_sampler)cl_samplerArray_getitem(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_sampler,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_samplerArray___setitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_samplerArray *arg1 = (cl_samplerArray *) 0 ;
  int arg2 ;
  cl_sampler arg3 = (cl_sampler) 0 ;
  
  SWIG_check_num_args("setitem",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setitem",1,"cl_samplerArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("setitem",2,"int");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("setitem",3,"cl_sampler");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_samplerArray,0))){
    SWIG_fail_ptr("cl_samplerArray___setitem",1,SWIGTYPE_p_cl_samplerArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p__cl_sampler,0))){
    SWIG_fail_ptr("cl_samplerArray___setitem",3,SWIGTYPE_p__cl_sampler);
  }
  
  cl_samplerArray_setitem(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_samplerArray_cast(lua_State* L) {
  int SWIG_arg = 0;
  cl_samplerArray *arg1 = (cl_samplerArray *) 0 ;
  cl_sampler *result = 0 ;
  
  SWIG_check_num_args("cast",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cast",1,"cl_samplerArray *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_samplerArray,0))){
    SWIG_fail_ptr("cl_samplerArray_cast",1,SWIGTYPE_p_cl_samplerArray);
  }
  
  result = (cl_sampler *)cl_samplerArray_cast(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_p__cl_sampler,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_samplerArray_frompointer(lua_State* L) {
  int SWIG_arg = 0;
  cl_sampler *arg1 = (cl_sampler *) 0 ;
  cl_samplerArray *result = 0 ;
  
  SWIG_check_num_args("cl_samplerArray_frompointer",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cl_samplerArray_frompointer",1,"cl_sampler *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_p__cl_sampler,0))){
    SWIG_fail_ptr("cl_samplerArray_frompointer",1,SWIGTYPE_p_p__cl_sampler);
  }
  
  result = (cl_samplerArray *)cl_samplerArray_frompointer(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_samplerArray,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_cl_samplerArray(void *obj) {
cl_samplerArray *arg1 = (cl_samplerArray *) obj;
delete_cl_samplerArray(arg1);
}
static swig_lua_method swig_cl_samplerArray_methods[] = {
    {"__getitem", _wrap_cl_samplerArray___getitem}, 
    {"__setitem", _wrap_cl_samplerArray___setitem}, 
    {"cast", _wrap_cl_samplerArray_cast}, 
    {0,0}
};
static swig_lua_attribute swig_cl_samplerArray_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_cl_samplerArray_bases[] = {0};
static const char *swig_cl_samplerArray_base_names[] = {0};
static swig_lua_class _wrap_class_cl_samplerArray = { "cl_samplerArray", &SWIGTYPE_p_cl_samplerArray,_wrap_new_cl_samplerArray, swig_delete_cl_samplerArray, swig_cl_samplerArray_methods, swig_cl_samplerArray_attributes, swig_cl_samplerArray_bases, swig_cl_samplerArray_base_names };

static int _wrap_new_cl_ucharArray(lua_State* L) {
  int SWIG_arg = 0;
  int arg1 ;
  cl_ucharArray *result = 0 ;
  
  SWIG_check_num_args("cl_ucharArray",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("cl_ucharArray",1,"int");
  arg1 = (int)lua_tonumber(L, 1);
  result = (cl_ucharArray *)new_cl_ucharArray(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_ucharArray,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_ucharArray___getitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_ucharArray *arg1 = (cl_ucharArray *) 0 ;
  int arg2 ;
  cl_uchar result;
  
  SWIG_check_num_args("getitem",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getitem",1,"cl_ucharArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("getitem",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_ucharArray,0))){
    SWIG_fail_ptr("cl_ucharArray___getitem",1,SWIGTYPE_p_cl_ucharArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (cl_uchar)cl_ucharArray_getitem(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_ucharArray___setitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_ucharArray *arg1 = (cl_ucharArray *) 0 ;
  int arg2 ;
  cl_uchar arg3 ;
  
  SWIG_check_num_args("setitem",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setitem",1,"cl_ucharArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("setitem",2,"int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("setitem",3,"cl_uchar");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_ucharArray,0))){
    SWIG_fail_ptr("cl_ucharArray___setitem",1,SWIGTYPE_p_cl_ucharArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (cl_uchar)lua_tonumber(L, 3);
  cl_ucharArray_setitem(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_ucharArray_cast(lua_State* L) {
  int SWIG_arg = 0;
  cl_ucharArray *arg1 = (cl_ucharArray *) 0 ;
  cl_uchar *result = 0 ;
  
  SWIG_check_num_args("cast",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cast",1,"cl_ucharArray *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_ucharArray,0))){
    SWIG_fail_ptr("cl_ucharArray_cast",1,SWIGTYPE_p_cl_ucharArray);
  }
  
  result = (cl_uchar *)cl_ucharArray_cast(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_unsigned_char,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_ucharArray_frompointer(lua_State* L) {
  int SWIG_arg = 0;
  cl_uchar *arg1 = (cl_uchar *) 0 ;
  cl_ucharArray *result = 0 ;
  
  SWIG_check_num_args("cl_ucharArray_frompointer",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cl_ucharArray_frompointer",1,"cl_uchar *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_unsigned_char,0))){
    SWIG_fail_ptr("cl_ucharArray_frompointer",1,SWIGTYPE_p_unsigned_char);
  }
  
  result = (cl_ucharArray *)cl_ucharArray_frompointer(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_ucharArray,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_cl_ucharArray(void *obj) {
cl_ucharArray *arg1 = (cl_ucharArray *) obj;
delete_cl_ucharArray(arg1);
}
static swig_lua_method swig_cl_ucharArray_methods[] = {
    {"__getitem", _wrap_cl_ucharArray___getitem}, 
    {"__setitem", _wrap_cl_ucharArray___setitem}, 
    {"cast", _wrap_cl_ucharArray_cast}, 
    {0,0}
};
static swig_lua_attribute swig_cl_ucharArray_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_cl_ucharArray_bases[] = {0};
static const char *swig_cl_ucharArray_base_names[] = {0};
static swig_lua_class _wrap_class_cl_ucharArray = { "cl_ucharArray", &SWIGTYPE_p_cl_ucharArray,_wrap_new_cl_ucharArray, swig_delete_cl_ucharArray, swig_cl_ucharArray_methods, swig_cl_ucharArray_attributes, swig_cl_ucharArray_bases, swig_cl_ucharArray_base_names };

static int _wrap_new_cl_charArray(lua_State* L) {
  int SWIG_arg = 0;
  int arg1 ;
  cl_charArray *result = 0 ;
  
  SWIG_check_num_args("cl_charArray",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("cl_charArray",1,"int");
  arg1 = (int)lua_tonumber(L, 1);
  result = (cl_charArray *)new_cl_charArray(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_charArray,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_charArray___getitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_charArray *arg1 = (cl_charArray *) 0 ;
  int arg2 ;
  cl_char result;
  
  SWIG_check_num_args("getitem",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getitem",1,"cl_charArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("getitem",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_charArray,0))){
    SWIG_fail_ptr("cl_charArray___getitem",1,SWIGTYPE_p_cl_charArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (cl_char)cl_charArray_getitem(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_charArray___setitem(lua_State* L) {
  int SWIG_arg = 0;
  cl_charArray *arg1 = (cl_charArray *) 0 ;
  int arg2 ;
  cl_char arg3 ;
  
  SWIG_check_num_args("setitem",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setitem",1,"cl_charArray *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("setitem",2,"int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("setitem",3,"cl_char");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_charArray,0))){
    SWIG_fail_ptr("cl_charArray___setitem",1,SWIGTYPE_p_cl_charArray);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  arg3 = (cl_char)lua_tonumber(L, 3);
  cl_charArray_setitem(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_charArray_cast(lua_State* L) {
  int SWIG_arg = 0;
  cl_charArray *arg1 = (cl_charArray *) 0 ;
  cl_char *result = 0 ;
  
  SWIG_check_num_args("cast",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cast",1,"cl_charArray *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_cl_charArray,0))){
    SWIG_fail_ptr("cl_charArray_cast",1,SWIGTYPE_p_cl_charArray);
  }
  
  result = (cl_char *)cl_charArray_cast(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_signed_char,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_charArray_frompointer(lua_State* L) {
  int SWIG_arg = 0;
  cl_char *arg1 = (cl_char *) 0 ;
  cl_charArray *result = 0 ;
  
  SWIG_check_num_args("cl_charArray_frompointer",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cl_charArray_frompointer",1,"cl_char *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_signed_char,0))){
    SWIG_fail_ptr("cl_charArray_frompointer",1,SWIGTYPE_p_signed_char);
  }
  
  result = (cl_charArray *)cl_charArray_frompointer(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_cl_charArray,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_cl_charArray(void *obj) {
cl_charArray *arg1 = (cl_charArray *) obj;
delete_cl_charArray(arg1);
}
static swig_lua_method swig_cl_charArray_methods[] = {
    {"__getitem", _wrap_cl_charArray___getitem}, 
    {"__setitem", _wrap_cl_charArray___setitem}, 
    {"cast", _wrap_cl_charArray_cast}, 
    {0,0}
};
static swig_lua_attribute swig_cl_charArray_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_cl_charArray_bases[] = {0};
static const char *swig_cl_charArray_base_names[] = {0};
static swig_lua_class _wrap_class_cl_charArray = { "cl_charArray", &SWIGTYPE_p_cl_charArray,_wrap_new_cl_charArray, swig_delete_cl_charArray, swig_cl_charArray_methods, swig_cl_charArray_attributes, swig_cl_charArray_bases, swig_cl_charArray_base_names };

static int _wrap_cl_image_format_image_channel_order_set(lua_State* L) {
  int SWIG_arg = 0;
  cl_image_format *arg1 = (cl_image_format *) 0 ;
  cl_channel_order arg2 ;
  
  SWIG_check_num_args("image_channel_order",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("image_channel_order",1,"cl_image_format *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("image_channel_order",2,"cl_channel_order");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_image_format,0))){
    SWIG_fail_ptr("cl_image_format_image_channel_order_set",1,SWIGTYPE_p__cl_image_format);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_channel_order)lua_tonumber(L, 2);
  if (arg1) (arg1)->image_channel_order = arg2;
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_image_format_image_channel_order_get(lua_State* L) {
  int SWIG_arg = 0;
  cl_image_format *arg1 = (cl_image_format *) 0 ;
  cl_channel_order result;
  
  SWIG_check_num_args("image_channel_order",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("image_channel_order",1,"cl_image_format *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_image_format,0))){
    SWIG_fail_ptr("cl_image_format_image_channel_order_get",1,SWIGTYPE_p__cl_image_format);
  }
  
  result = (cl_channel_order) ((arg1)->image_channel_order);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_image_format_image_channel_data_type_set(lua_State* L) {
  int SWIG_arg = 0;
  cl_image_format *arg1 = (cl_image_format *) 0 ;
  cl_channel_type arg2 ;
  
  SWIG_check_num_args("image_channel_data_type",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("image_channel_data_type",1,"cl_image_format *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("image_channel_data_type",2,"cl_channel_type");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_image_format,0))){
    SWIG_fail_ptr("cl_image_format_image_channel_data_type_set",1,SWIGTYPE_p__cl_image_format);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_channel_type)lua_tonumber(L, 2);
  if (arg1) (arg1)->image_channel_data_type = arg2;
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_cl_image_format_image_channel_data_type_get(lua_State* L) {
  int SWIG_arg = 0;
  cl_image_format *arg1 = (cl_image_format *) 0 ;
  cl_channel_type result;
  
  SWIG_check_num_args("image_channel_data_type",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("image_channel_data_type",1,"cl_image_format *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_image_format,0))){
    SWIG_fail_ptr("cl_image_format_image_channel_data_type_get",1,SWIGTYPE_p__cl_image_format);
  }
  
  result = (cl_channel_type) ((arg1)->image_channel_data_type);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static swig_lua_method swig_cl_image_format_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_cl_image_format_attributes[] = {
    { "image_channel_order", _wrap_cl_image_format_image_channel_order_get, _wrap_cl_image_format_image_channel_order_set},
    { "image_channel_data_type", _wrap_cl_image_format_image_channel_data_type_get, _wrap_cl_image_format_image_channel_data_type_set},
    {0,0,0}
};
static swig_lua_class *swig_cl_image_format_bases[] = {0};
static const char *swig_cl_image_format_base_names[] = {0};
static swig_lua_class _wrap_class_cl_image_format = { "cl_image_format", &SWIGTYPE_p__cl_image_format,0,0, swig_cl_image_format_methods, swig_cl_image_format_attributes, swig_cl_image_format_bases, swig_cl_image_format_base_names };

static int _wrap_clGetPlatformIDs(lua_State* L) {
  int SWIG_arg = 0;
  cl_uint arg1 ;
  cl_platform_id *arg2 = (cl_platform_id *) 0 ;
  cl_uint *arg3 = (cl_uint *) 0 ;
  cl_uint temp3 ;
  cl_int result;
  
  arg3 = &temp3; 
  SWIG_check_num_args("clGetPlatformIDs",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("clGetPlatformIDs",1,"cl_uint");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clGetPlatformIDs",2,"cl_platform_id *");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (cl_uint)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_p__cl_platform_id,0))){
    SWIG_fail_ptr("clGetPlatformIDs",2,SWIGTYPE_p_p__cl_platform_id);
  }
  
  result = (cl_int)clGetPlatformIDs(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg3); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clGetPlatformInfo(lua_State* L) {
  int SWIG_arg = 0;
  cl_platform_id arg1 = (cl_platform_id) 0 ;
  cl_platform_info arg2 ;
  size_t arg3 ;
  void *arg4 = (void *) 0 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t temp5 ;
  cl_int result;
  
  arg5 = &temp5; 
  SWIG_check_num_args("clGetPlatformInfo",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clGetPlatformInfo",1,"cl_platform_id");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clGetPlatformInfo",2,"cl_platform_info");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clGetPlatformInfo",3,"size_t");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clGetPlatformInfo",4,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_platform_id,0))){
    SWIG_fail_ptr("clGetPlatformInfo",1,SWIGTYPE_p__cl_platform_id);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_platform_info)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (size_t)lua_tonumber(L, 3);
  arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"clGetPlatformInfo");
  result = (cl_int)clGetPlatformInfo(arg1,arg2,arg3,arg4,arg5);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clGetDeviceIDs(lua_State* L) {
  int SWIG_arg = 0;
  cl_platform_id arg1 = (cl_platform_id) 0 ;
  cl_device_type arg2 ;
  cl_uint arg3 ;
  cl_device_id *arg4 = (cl_device_id *) 0 ;
  cl_uint *arg5 = (cl_uint *) 0 ;
  cl_uint temp5 ;
  cl_int result;
  
  arg5 = &temp5; 
  SWIG_check_num_args("clGetDeviceIDs",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clGetDeviceIDs",1,"cl_platform_id");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clGetDeviceIDs",2,"cl_device_type");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clGetDeviceIDs",3,"cl_uint");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clGetDeviceIDs",4,"cl_device_id *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_platform_id,0))){
    SWIG_fail_ptr("clGetDeviceIDs",1,SWIGTYPE_p__cl_platform_id);
  }
  
  arg2 = (cl_device_type)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (cl_uint)lua_tonumber(L, 3);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_p__cl_device_id,0))){
    SWIG_fail_ptr("clGetDeviceIDs",4,SWIGTYPE_p_p__cl_device_id);
  }
  
  result = (cl_int)clGetDeviceIDs(arg1,arg2,arg3,arg4,arg5);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clGetDeviceInfo(lua_State* L) {
  int SWIG_arg = 0;
  cl_device_id arg1 = (cl_device_id) 0 ;
  cl_device_info arg2 ;
  size_t arg3 ;
  void *arg4 = (void *) 0 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t temp5 ;
  cl_int result;
  
  arg5 = &temp5; 
  SWIG_check_num_args("clGetDeviceInfo",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clGetDeviceInfo",1,"cl_device_id");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clGetDeviceInfo",2,"cl_device_info");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clGetDeviceInfo",3,"size_t");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clGetDeviceInfo",4,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_device_id,0))){
    SWIG_fail_ptr("clGetDeviceInfo",1,SWIGTYPE_p__cl_device_id);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_device_info)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (size_t)lua_tonumber(L, 3);
  arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"clGetDeviceInfo");
  result = (cl_int)clGetDeviceInfo(arg1,arg2,arg3,arg4,arg5);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clCreateContext(lua_State* L) {
  int SWIG_arg = 0;
  cl_context_properties *arg1 = (cl_context_properties *) 0 ;
  cl_uint arg2 ;
  cl_device_id *arg3 = (cl_device_id *) 0 ;
  void (*arg4)(char const *,void const *,size_t,void *) = (void (*)(char const *,void const *,size_t,void *)) 0 ;
  void *arg5 = (void *) 0 ;
  cl_int *arg6 = (cl_int *) 0 ;
  cl_int temp6 ;
  cl_context result;
  
  arg6 = &temp6; 
  SWIG_check_num_args("clCreateContext",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clCreateContext",1,"cl_context_properties const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clCreateContext",2,"cl_uint");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("clCreateContext",3,"cl_device_id const *");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clCreateContext",4,"void (*)(char const *,void const *,size_t,void *)");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("clCreateContext",5,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_intptr_t,0))){
    SWIG_fail_ptr("clCreateContext",1,SWIGTYPE_p_intptr_t);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_uint)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_p__cl_device_id,0))){
    SWIG_fail_ptr("clCreateContext",3,SWIGTYPE_p_p__cl_device_id);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_f_p_q_const__char_p_q_const__void_unsigned_int_p_void__void,0))){
    SWIG_fail_ptr("clCreateContext",4,SWIGTYPE_p_f_p_q_const__char_p_q_const__void_unsigned_int_p_void__void);
  }
  
  arg5=(void *)SWIG_MustGetPtr(L,5,0,0,5,"clCreateContext");
  result = (cl_context)clCreateContext((intptr_t const *)arg1,arg2,(_cl_device_id *const *)arg3,arg4,arg5,arg6);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_context,0); SWIG_arg++; 
  lua_pushnumber(L, (lua_Number) *arg6); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clCreateContextFromType(lua_State* L) {
  int SWIG_arg = 0;
  cl_context_properties *arg1 = (cl_context_properties *) 0 ;
  cl_device_type arg2 ;
  void (*arg3)(char const *,void const *,size_t,void *) = (void (*)(char const *,void const *,size_t,void *)) 0 ;
  void *arg4 = (void *) 0 ;
  cl_int *arg5 = (cl_int *) 0 ;
  cl_int temp5 ;
  cl_context result;
  
  arg5 = &temp5; 
  SWIG_check_num_args("clCreateContextFromType",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clCreateContextFromType",1,"cl_context_properties const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clCreateContextFromType",2,"cl_device_type");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("clCreateContextFromType",3,"void (*)(char const *,void const *,size_t,void *)");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clCreateContextFromType",4,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_intptr_t,0))){
    SWIG_fail_ptr("clCreateContextFromType",1,SWIGTYPE_p_intptr_t);
  }
  
  arg2 = (cl_device_type)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_f_p_q_const__char_p_q_const__void_unsigned_int_p_void__void,0))){
    SWIG_fail_ptr("clCreateContextFromType",3,SWIGTYPE_p_f_p_q_const__char_p_q_const__void_unsigned_int_p_void__void);
  }
  
  arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"clCreateContextFromType");
  result = (cl_context)clCreateContextFromType((intptr_t const *)arg1,arg2,arg3,arg4,arg5);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_context,0); SWIG_arg++; 
  lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clRetainContext(lua_State* L) {
  int SWIG_arg = 0;
  cl_context arg1 = (cl_context) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clRetainContext",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clRetainContext",1,"cl_context");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_context,0))){
    SWIG_fail_ptr("clRetainContext",1,SWIGTYPE_p__cl_context);
  }
  
  result = (cl_int)clRetainContext(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clReleaseContext(lua_State* L) {
  int SWIG_arg = 0;
  cl_context arg1 = (cl_context) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clReleaseContext",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clReleaseContext",1,"cl_context");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_context,0))){
    SWIG_fail_ptr("clReleaseContext",1,SWIGTYPE_p__cl_context);
  }
  
  result = (cl_int)clReleaseContext(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clGetContextInfo(lua_State* L) {
  int SWIG_arg = 0;
  cl_context arg1 = (cl_context) 0 ;
  cl_context_info arg2 ;
  size_t arg3 ;
  void *arg4 = (void *) 0 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t temp5 ;
  cl_int result;
  
  arg5 = &temp5; 
  SWIG_check_num_args("clGetContextInfo",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clGetContextInfo",1,"cl_context");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clGetContextInfo",2,"cl_context_info");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clGetContextInfo",3,"size_t");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clGetContextInfo",4,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_context,0))){
    SWIG_fail_ptr("clGetContextInfo",1,SWIGTYPE_p__cl_context);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_context_info)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (size_t)lua_tonumber(L, 3);
  arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"clGetContextInfo");
  result = (cl_int)clGetContextInfo(arg1,arg2,arg3,arg4,arg5);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clCreateCommandQueue(lua_State* L) {
  int SWIG_arg = 0;
  cl_context arg1 = (cl_context) 0 ;
  cl_device_id arg2 = (cl_device_id) 0 ;
  cl_command_queue_properties arg3 ;
  cl_int *arg4 = (cl_int *) 0 ;
  cl_int temp4 ;
  cl_command_queue result;
  
  arg4 = &temp4; 
  SWIG_check_num_args("clCreateCommandQueue",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clCreateCommandQueue",1,"cl_context");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clCreateCommandQueue",2,"cl_device_id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clCreateCommandQueue",3,"cl_command_queue_properties");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_context,0))){
    SWIG_fail_ptr("clCreateCommandQueue",1,SWIGTYPE_p__cl_context);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p__cl_device_id,0))){
    SWIG_fail_ptr("clCreateCommandQueue",2,SWIGTYPE_p__cl_device_id);
  }
  
  arg3 = (cl_command_queue_properties)lua_tonumber(L, 3);
  result = (cl_command_queue)clCreateCommandQueue(arg1,arg2,arg3,arg4);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_command_queue,0); SWIG_arg++; 
  lua_pushnumber(L, (lua_Number) *arg4); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clRetainCommandQueue(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clRetainCommandQueue",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clRetainCommandQueue",1,"cl_command_queue");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clRetainCommandQueue",1,SWIGTYPE_p__cl_command_queue);
  }
  
  result = (cl_int)clRetainCommandQueue(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clReleaseCommandQueue(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clReleaseCommandQueue",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clReleaseCommandQueue",1,"cl_command_queue");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clReleaseCommandQueue",1,SWIGTYPE_p__cl_command_queue);
  }
  
  result = (cl_int)clReleaseCommandQueue(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clGetCommandQueueInfo(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_command_queue_info arg2 ;
  size_t arg3 ;
  void *arg4 = (void *) 0 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t temp5 ;
  cl_int result;
  
  arg5 = &temp5; 
  SWIG_check_num_args("clGetCommandQueueInfo",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clGetCommandQueueInfo",1,"cl_command_queue");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clGetCommandQueueInfo",2,"cl_command_queue_info");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clGetCommandQueueInfo",3,"size_t");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clGetCommandQueueInfo",4,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clGetCommandQueueInfo",1,SWIGTYPE_p__cl_command_queue);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_command_queue_info)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (size_t)lua_tonumber(L, 3);
  arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"clGetCommandQueueInfo");
  result = (cl_int)clGetCommandQueueInfo(arg1,arg2,arg3,arg4,arg5);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clSetCommandQueueProperty(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_command_queue_properties arg2 ;
  cl_bool arg3 ;
  cl_command_queue_properties *arg4 = (cl_command_queue_properties *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clSetCommandQueueProperty",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clSetCommandQueueProperty",1,"cl_command_queue");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clSetCommandQueueProperty",2,"cl_command_queue_properties");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clSetCommandQueueProperty",3,"cl_bool");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clSetCommandQueueProperty",4,"cl_command_queue_properties *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clSetCommandQueueProperty",1,SWIGTYPE_p__cl_command_queue);
  }
  
  arg2 = (cl_command_queue_properties)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (cl_bool)lua_tonumber(L, 3);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_unsigned_long_long,0))){
    SWIG_fail_ptr("clSetCommandQueueProperty",4,SWIGTYPE_p_unsigned_long_long);
  }
  
  result = (cl_int)clSetCommandQueueProperty(arg1,arg2,arg3,arg4);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clCreateBuffer(lua_State* L) {
  int SWIG_arg = 0;
  cl_context arg1 = (cl_context) 0 ;
  cl_mem_flags arg2 ;
  size_t arg3 ;
  void *arg4 = (void *) 0 ;
  cl_int *arg5 = (cl_int *) 0 ;
  cl_int temp5 ;
  cl_mem result;
  
  arg5 = &temp5; 
  SWIG_check_num_args("clCreateBuffer",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clCreateBuffer",1,"cl_context");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clCreateBuffer",2,"cl_mem_flags");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clCreateBuffer",3,"size_t");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clCreateBuffer",4,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_context,0))){
    SWIG_fail_ptr("clCreateBuffer",1,SWIGTYPE_p__cl_context);
  }
  
  arg2 = (cl_mem_flags)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (size_t)lua_tonumber(L, 3);
  arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"clCreateBuffer");
  result = (cl_mem)clCreateBuffer(arg1,arg2,arg3,arg4,arg5);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_mem,0); SWIG_arg++; 
  lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clCreateImage2D(lua_State* L) {
  int SWIG_arg = 0;
  cl_context arg1 = (cl_context) 0 ;
  cl_mem_flags arg2 ;
  cl_image_format *arg3 = (cl_image_format *) 0 ;
  size_t arg4 ;
  size_t arg5 ;
  size_t arg6 ;
  void *arg7 = (void *) 0 ;
  cl_int *arg8 = (cl_int *) 0 ;
  cl_int temp8 ;
  cl_mem result;
  
  arg8 = &temp8; 
  SWIG_check_num_args("clCreateImage2D",7,7)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clCreateImage2D",1,"cl_context");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clCreateImage2D",2,"cl_mem_flags");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("clCreateImage2D",3,"cl_image_format const *");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("clCreateImage2D",4,"size_t");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("clCreateImage2D",5,"size_t");
  if(!lua_isnumber(L,6)) SWIG_fail_arg("clCreateImage2D",6,"size_t");
  if(!SWIG_isptrtype(L,7)) SWIG_fail_arg("clCreateImage2D",7,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_context,0))){
    SWIG_fail_ptr("clCreateImage2D",1,SWIGTYPE_p__cl_context);
  }
  
  arg2 = (cl_mem_flags)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p__cl_image_format,0))){
    SWIG_fail_ptr("clCreateImage2D",3,SWIGTYPE_p__cl_image_format);
  }
  
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (size_t)lua_tonumber(L, 4);
  SWIG_contract_assert((lua_tonumber(L,5)>=0),"number must not be negative")
  arg5 = (size_t)lua_tonumber(L, 5);
  SWIG_contract_assert((lua_tonumber(L,6)>=0),"number must not be negative")
  arg6 = (size_t)lua_tonumber(L, 6);
  arg7=(void *)SWIG_MustGetPtr(L,7,0,0,7,"clCreateImage2D");
  result = (cl_mem)clCreateImage2D(arg1,arg2,(_cl_image_format const *)arg3,arg4,arg5,arg6,arg7,arg8);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_mem,0); SWIG_arg++; 
  lua_pushnumber(L, (lua_Number) *arg8); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clCreateImage3D(lua_State* L) {
  int SWIG_arg = 0;
  cl_context arg1 = (cl_context) 0 ;
  cl_mem_flags arg2 ;
  cl_image_format *arg3 = (cl_image_format *) 0 ;
  size_t arg4 ;
  size_t arg5 ;
  size_t arg6 ;
  size_t arg7 ;
  size_t arg8 ;
  void *arg9 = (void *) 0 ;
  cl_int *arg10 = (cl_int *) 0 ;
  cl_int temp10 ;
  cl_mem result;
  
  arg10 = &temp10; 
  SWIG_check_num_args("clCreateImage3D",9,9)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clCreateImage3D",1,"cl_context");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clCreateImage3D",2,"cl_mem_flags");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("clCreateImage3D",3,"cl_image_format const *");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("clCreateImage3D",4,"size_t");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("clCreateImage3D",5,"size_t");
  if(!lua_isnumber(L,6)) SWIG_fail_arg("clCreateImage3D",6,"size_t");
  if(!lua_isnumber(L,7)) SWIG_fail_arg("clCreateImage3D",7,"size_t");
  if(!lua_isnumber(L,8)) SWIG_fail_arg("clCreateImage3D",8,"size_t");
  if(!SWIG_isptrtype(L,9)) SWIG_fail_arg("clCreateImage3D",9,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_context,0))){
    SWIG_fail_ptr("clCreateImage3D",1,SWIGTYPE_p__cl_context);
  }
  
  arg2 = (cl_mem_flags)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p__cl_image_format,0))){
    SWIG_fail_ptr("clCreateImage3D",3,SWIGTYPE_p__cl_image_format);
  }
  
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (size_t)lua_tonumber(L, 4);
  SWIG_contract_assert((lua_tonumber(L,5)>=0),"number must not be negative")
  arg5 = (size_t)lua_tonumber(L, 5);
  SWIG_contract_assert((lua_tonumber(L,6)>=0),"number must not be negative")
  arg6 = (size_t)lua_tonumber(L, 6);
  SWIG_contract_assert((lua_tonumber(L,7)>=0),"number must not be negative")
  arg7 = (size_t)lua_tonumber(L, 7);
  SWIG_contract_assert((lua_tonumber(L,8)>=0),"number must not be negative")
  arg8 = (size_t)lua_tonumber(L, 8);
  arg9=(void *)SWIG_MustGetPtr(L,9,0,0,9,"clCreateImage3D");
  result = (cl_mem)clCreateImage3D(arg1,arg2,(_cl_image_format const *)arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_mem,0); SWIG_arg++; 
  lua_pushnumber(L, (lua_Number) *arg10); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clRetainMemObject(lua_State* L) {
  int SWIG_arg = 0;
  cl_mem arg1 = (cl_mem) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clRetainMemObject",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clRetainMemObject",1,"cl_mem");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clRetainMemObject",1,SWIGTYPE_p__cl_mem);
  }
  
  result = (cl_int)clRetainMemObject(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clReleaseMemObject(lua_State* L) {
  int SWIG_arg = 0;
  cl_mem arg1 = (cl_mem) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clReleaseMemObject",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clReleaseMemObject",1,"cl_mem");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clReleaseMemObject",1,SWIGTYPE_p__cl_mem);
  }
  
  result = (cl_int)clReleaseMemObject(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clGetSupportedImageFormats(lua_State* L) {
  int SWIG_arg = 0;
  cl_context arg1 = (cl_context) 0 ;
  cl_mem_flags arg2 ;
  cl_mem_object_type arg3 ;
  cl_uint arg4 ;
  cl_image_format *arg5 = (cl_image_format *) 0 ;
  cl_uint *arg6 = (cl_uint *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clGetSupportedImageFormats",6,6)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clGetSupportedImageFormats",1,"cl_context");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clGetSupportedImageFormats",2,"cl_mem_flags");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clGetSupportedImageFormats",3,"cl_mem_object_type");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("clGetSupportedImageFormats",4,"cl_uint");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("clGetSupportedImageFormats",5,"cl_image_format *");
  if(!SWIG_isptrtype(L,6)) SWIG_fail_arg("clGetSupportedImageFormats",6,"cl_uint *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_context,0))){
    SWIG_fail_ptr("clGetSupportedImageFormats",1,SWIGTYPE_p__cl_context);
  }
  
  arg2 = (cl_mem_flags)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (cl_mem_object_type)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (cl_uint)lua_tonumber(L, 4);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p__cl_image_format,0))){
    SWIG_fail_ptr("clGetSupportedImageFormats",5,SWIGTYPE_p__cl_image_format);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,6,(void**)&arg6,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clGetSupportedImageFormats",6,SWIGTYPE_p_unsigned_int);
  }
  
  result = (cl_int)clGetSupportedImageFormats(arg1,arg2,arg3,arg4,arg5,arg6);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clGetMemObjectInfo(lua_State* L) {
  int SWIG_arg = 0;
  cl_mem arg1 = (cl_mem) 0 ;
  cl_mem_info arg2 ;
  size_t arg3 ;
  void *arg4 = (void *) 0 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t temp5 ;
  cl_int result;
  
  arg5 = &temp5; 
  SWIG_check_num_args("clGetMemObjectInfo",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clGetMemObjectInfo",1,"cl_mem");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clGetMemObjectInfo",2,"cl_mem_info");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clGetMemObjectInfo",3,"size_t");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clGetMemObjectInfo",4,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clGetMemObjectInfo",1,SWIGTYPE_p__cl_mem);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_mem_info)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (size_t)lua_tonumber(L, 3);
  arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"clGetMemObjectInfo");
  result = (cl_int)clGetMemObjectInfo(arg1,arg2,arg3,arg4,arg5);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clGetImageInfo(lua_State* L) {
  int SWIG_arg = 0;
  cl_mem arg1 = (cl_mem) 0 ;
  cl_image_info arg2 ;
  size_t arg3 ;
  void *arg4 = (void *) 0 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t temp5 ;
  cl_int result;
  
  arg5 = &temp5; 
  SWIG_check_num_args("clGetImageInfo",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clGetImageInfo",1,"cl_mem");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clGetImageInfo",2,"cl_image_info");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clGetImageInfo",3,"size_t");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clGetImageInfo",4,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clGetImageInfo",1,SWIGTYPE_p__cl_mem);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_image_info)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (size_t)lua_tonumber(L, 3);
  arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"clGetImageInfo");
  result = (cl_int)clGetImageInfo(arg1,arg2,arg3,arg4,arg5);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clCreateSampler(lua_State* L) {
  int SWIG_arg = 0;
  cl_context arg1 = (cl_context) 0 ;
  cl_bool arg2 ;
  cl_addressing_mode arg3 ;
  cl_filter_mode arg4 ;
  cl_int *arg5 = (cl_int *) 0 ;
  cl_int temp5 ;
  cl_sampler result;
  
  arg5 = &temp5; 
  SWIG_check_num_args("clCreateSampler",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clCreateSampler",1,"cl_context");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clCreateSampler",2,"cl_bool");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clCreateSampler",3,"cl_addressing_mode");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("clCreateSampler",4,"cl_filter_mode");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_context,0))){
    SWIG_fail_ptr("clCreateSampler",1,SWIGTYPE_p__cl_context);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_bool)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (cl_addressing_mode)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (cl_filter_mode)lua_tonumber(L, 4);
  result = (cl_sampler)clCreateSampler(arg1,arg2,arg3,arg4,arg5);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_sampler,0); SWIG_arg++; 
  lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clRetainSampler(lua_State* L) {
  int SWIG_arg = 0;
  cl_sampler arg1 = (cl_sampler) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clRetainSampler",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clRetainSampler",1,"cl_sampler");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_sampler,0))){
    SWIG_fail_ptr("clRetainSampler",1,SWIGTYPE_p__cl_sampler);
  }
  
  result = (cl_int)clRetainSampler(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clReleaseSampler(lua_State* L) {
  int SWIG_arg = 0;
  cl_sampler arg1 = (cl_sampler) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clReleaseSampler",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clReleaseSampler",1,"cl_sampler");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_sampler,0))){
    SWIG_fail_ptr("clReleaseSampler",1,SWIGTYPE_p__cl_sampler);
  }
  
  result = (cl_int)clReleaseSampler(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clGetSamplerInfo(lua_State* L) {
  int SWIG_arg = 0;
  cl_sampler arg1 = (cl_sampler) 0 ;
  cl_sampler_info arg2 ;
  size_t arg3 ;
  void *arg4 = (void *) 0 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t temp5 ;
  cl_int result;
  
  arg5 = &temp5; 
  SWIG_check_num_args("clGetSamplerInfo",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clGetSamplerInfo",1,"cl_sampler");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clGetSamplerInfo",2,"cl_sampler_info");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clGetSamplerInfo",3,"size_t");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clGetSamplerInfo",4,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_sampler,0))){
    SWIG_fail_ptr("clGetSamplerInfo",1,SWIGTYPE_p__cl_sampler);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_sampler_info)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (size_t)lua_tonumber(L, 3);
  arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"clGetSamplerInfo");
  result = (cl_int)clGetSamplerInfo(arg1,arg2,arg3,arg4,arg5);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clCreateProgramWithSource(lua_State* L) {
  int SWIG_arg = 0;
  cl_context arg1 = (cl_context) 0 ;
  cl_uint arg2 ;
  char **arg3 = (char **) 0 ;
  size_t *arg4 = (size_t *) 0 ;
  cl_int *arg5 = (cl_int *) 0 ;
  cl_int temp5 ;
  cl_program result;
  
  arg5 = &temp5; 
  SWIG_check_num_args("clCreateProgramWithSource",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clCreateProgramWithSource",1,"cl_context");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clCreateProgramWithSource",2,"cl_uint");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("clCreateProgramWithSource",3,"char const **");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clCreateProgramWithSource",4,"size_t const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_context,0))){
    SWIG_fail_ptr("clCreateProgramWithSource",1,SWIGTYPE_p__cl_context);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_uint)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_p_char,0))){
    SWIG_fail_ptr("clCreateProgramWithSource",3,SWIGTYPE_p_p_char);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clCreateProgramWithSource",4,SWIGTYPE_p_unsigned_int);
  }
  
  result = (cl_program)clCreateProgramWithSource(arg1,arg2,(char const **)arg3,(unsigned int const *)arg4,arg5);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_program,0); SWIG_arg++; 
  lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clCreateProgramWithBinary(lua_State* L) {
  int SWIG_arg = 0;
  cl_context arg1 = (cl_context) 0 ;
  cl_uint arg2 ;
  cl_device_id *arg3 = (cl_device_id *) 0 ;
  size_t *arg4 = (size_t *) 0 ;
  unsigned char **arg5 = (unsigned char **) 0 ;
  cl_int *arg6 = (cl_int *) 0 ;
  cl_int *arg7 = (cl_int *) 0 ;
  cl_int temp7 ;
  cl_program result;
  
  arg7 = &temp7; 
  SWIG_check_num_args("clCreateProgramWithBinary",6,6)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clCreateProgramWithBinary",1,"cl_context");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clCreateProgramWithBinary",2,"cl_uint");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("clCreateProgramWithBinary",3,"cl_device_id const *");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clCreateProgramWithBinary",4,"size_t const *");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("clCreateProgramWithBinary",5,"unsigned char const **");
  if(!SWIG_isptrtype(L,6)) SWIG_fail_arg("clCreateProgramWithBinary",6,"cl_int *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_context,0))){
    SWIG_fail_ptr("clCreateProgramWithBinary",1,SWIGTYPE_p__cl_context);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_uint)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_p__cl_device_id,0))){
    SWIG_fail_ptr("clCreateProgramWithBinary",3,SWIGTYPE_p_p__cl_device_id);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clCreateProgramWithBinary",4,SWIGTYPE_p_unsigned_int);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_p_unsigned_char,0))){
    SWIG_fail_ptr("clCreateProgramWithBinary",5,SWIGTYPE_p_p_unsigned_char);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,6,(void**)&arg6,SWIGTYPE_p_int,0))){
    SWIG_fail_ptr("clCreateProgramWithBinary",6,SWIGTYPE_p_int);
  }
  
  result = (cl_program)clCreateProgramWithBinary(arg1,arg2,(_cl_device_id *const *)arg3,(unsigned int const *)arg4,(unsigned char const **)arg5,arg6,arg7);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_program,0); SWIG_arg++; 
  lua_pushnumber(L, (lua_Number) *arg7); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clRetainProgram(lua_State* L) {
  int SWIG_arg = 0;
  cl_program arg1 = (cl_program) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clRetainProgram",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clRetainProgram",1,"cl_program");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_program,0))){
    SWIG_fail_ptr("clRetainProgram",1,SWIGTYPE_p__cl_program);
  }
  
  result = (cl_int)clRetainProgram(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clReleaseProgram(lua_State* L) {
  int SWIG_arg = 0;
  cl_program arg1 = (cl_program) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clReleaseProgram",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clReleaseProgram",1,"cl_program");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_program,0))){
    SWIG_fail_ptr("clReleaseProgram",1,SWIGTYPE_p__cl_program);
  }
  
  result = (cl_int)clReleaseProgram(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clBuildProgram(lua_State* L) {
  int SWIG_arg = 0;
  cl_program arg1 = (cl_program) 0 ;
  cl_uint arg2 ;
  cl_device_id *arg3 = (cl_device_id *) 0 ;
  char *arg4 = (char *) 0 ;
  void (*arg5)(cl_program,void *) = (void (*)(cl_program,void *)) 0 ;
  void *arg6 = (void *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clBuildProgram",6,6)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clBuildProgram",1,"cl_program");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clBuildProgram",2,"cl_uint");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("clBuildProgram",3,"cl_device_id const *");
  if(!lua_isstring(L,4)) SWIG_fail_arg("clBuildProgram",4,"char const *");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("clBuildProgram",5,"void (*)(cl_program,void *)");
  if(!SWIG_isptrtype(L,6)) SWIG_fail_arg("clBuildProgram",6,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_program,0))){
    SWIG_fail_ptr("clBuildProgram",1,SWIGTYPE_p__cl_program);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_uint)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_p__cl_device_id,0))){
    SWIG_fail_ptr("clBuildProgram",3,SWIGTYPE_p_p__cl_device_id);
  }
  
  arg4 = (char *)lua_tostring(L, 4);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_f_p__cl_program_p_void__void,0))){
    SWIG_fail_ptr("clBuildProgram",5,SWIGTYPE_p_f_p__cl_program_p_void__void);
  }
  
  arg6=(void *)SWIG_MustGetPtr(L,6,0,0,6,"clBuildProgram");
  result = (cl_int)clBuildProgram(arg1,arg2,(_cl_device_id *const *)arg3,(char const *)arg4,arg5,arg6);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clUnloadCompiler(lua_State* L) {
  int SWIG_arg = 0;
  cl_int result;
  
  SWIG_check_num_args("clUnloadCompiler",0,0)
  result = (cl_int)clUnloadCompiler();
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clGetProgramInfo(lua_State* L) {
  int SWIG_arg = 0;
  cl_program arg1 = (cl_program) 0 ;
  cl_program_info arg2 ;
  size_t arg3 ;
  void *arg4 = (void *) 0 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t temp5 ;
  cl_int result;
  
  arg5 = &temp5; 
  SWIG_check_num_args("clGetProgramInfo",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clGetProgramInfo",1,"cl_program");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clGetProgramInfo",2,"cl_program_info");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clGetProgramInfo",3,"size_t");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clGetProgramInfo",4,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_program,0))){
    SWIG_fail_ptr("clGetProgramInfo",1,SWIGTYPE_p__cl_program);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_program_info)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (size_t)lua_tonumber(L, 3);
  arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"clGetProgramInfo");
  result = (cl_int)clGetProgramInfo(arg1,arg2,arg3,arg4,arg5);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clGetProgramBuildInfo(lua_State* L) {
  int SWIG_arg = 0;
  cl_program arg1 = (cl_program) 0 ;
  cl_device_id arg2 = (cl_device_id) 0 ;
  cl_program_build_info arg3 ;
  size_t arg4 ;
  void *arg5 = (void *) 0 ;
  size_t *arg6 = (size_t *) 0 ;
  size_t temp6 ;
  cl_int result;
  
  arg6 = &temp6; 
  SWIG_check_num_args("clGetProgramBuildInfo",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clGetProgramBuildInfo",1,"cl_program");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clGetProgramBuildInfo",2,"cl_device_id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clGetProgramBuildInfo",3,"cl_program_build_info");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("clGetProgramBuildInfo",4,"size_t");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("clGetProgramBuildInfo",5,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_program,0))){
    SWIG_fail_ptr("clGetProgramBuildInfo",1,SWIGTYPE_p__cl_program);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p__cl_device_id,0))){
    SWIG_fail_ptr("clGetProgramBuildInfo",2,SWIGTYPE_p__cl_device_id);
  }
  
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (cl_program_build_info)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (size_t)lua_tonumber(L, 4);
  arg5=(void *)SWIG_MustGetPtr(L,5,0,0,5,"clGetProgramBuildInfo");
  result = (cl_int)clGetProgramBuildInfo(arg1,arg2,arg3,arg4,arg5,arg6);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg6); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clCreateKernel(lua_State* L) {
  int SWIG_arg = 0;
  cl_program arg1 = (cl_program) 0 ;
  char *arg2 = (char *) 0 ;
  cl_int *arg3 = (cl_int *) 0 ;
  cl_int temp3 ;
  cl_kernel result;
  
  arg3 = &temp3; 
  SWIG_check_num_args("clCreateKernel",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clCreateKernel",1,"cl_program");
  if(!lua_isstring(L,2)) SWIG_fail_arg("clCreateKernel",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_program,0))){
    SWIG_fail_ptr("clCreateKernel",1,SWIGTYPE_p__cl_program);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  result = (cl_kernel)clCreateKernel(arg1,(char const *)arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_kernel,0); SWIG_arg++; 
  lua_pushnumber(L, (lua_Number) *arg3); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clCreateKernelsInProgram(lua_State* L) {
  int SWIG_arg = 0;
  cl_program arg1 = (cl_program) 0 ;
  cl_uint arg2 ;
  cl_kernel *arg3 = (cl_kernel *) 0 ;
  cl_uint *arg4 = (cl_uint *) 0 ;
  cl_uint temp4 ;
  cl_int result;
  
  arg4 = &temp4; 
  SWIG_check_num_args("clCreateKernelsInProgram",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clCreateKernelsInProgram",1,"cl_program");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clCreateKernelsInProgram",2,"cl_uint");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("clCreateKernelsInProgram",3,"cl_kernel *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_program,0))){
    SWIG_fail_ptr("clCreateKernelsInProgram",1,SWIGTYPE_p__cl_program);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_uint)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_p__cl_kernel,0))){
    SWIG_fail_ptr("clCreateKernelsInProgram",3,SWIGTYPE_p_p__cl_kernel);
  }
  
  result = (cl_int)clCreateKernelsInProgram(arg1,arg2,arg3,arg4);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg4); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clRetainKernel(lua_State* L) {
  int SWIG_arg = 0;
  cl_kernel arg1 = (cl_kernel) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clRetainKernel",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clRetainKernel",1,"cl_kernel");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_kernel,0))){
    SWIG_fail_ptr("clRetainKernel",1,SWIGTYPE_p__cl_kernel);
  }
  
  result = (cl_int)clRetainKernel(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clReleaseKernel(lua_State* L) {
  int SWIG_arg = 0;
  cl_kernel arg1 = (cl_kernel) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clReleaseKernel",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clReleaseKernel",1,"cl_kernel");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_kernel,0))){
    SWIG_fail_ptr("clReleaseKernel",1,SWIGTYPE_p__cl_kernel);
  }
  
  result = (cl_int)clReleaseKernel(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clSetKernelArg(lua_State* L) {
  int SWIG_arg = 0;
  cl_kernel arg1 = (cl_kernel) 0 ;
  cl_uint arg2 ;
  size_t arg3 ;
  void *arg4 = (void *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clSetKernelArg",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clSetKernelArg",1,"cl_kernel");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clSetKernelArg",2,"cl_uint");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clSetKernelArg",3,"size_t");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clSetKernelArg",4,"void const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_kernel,0))){
    SWIG_fail_ptr("clSetKernelArg",1,SWIGTYPE_p__cl_kernel);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_uint)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (size_t)lua_tonumber(L, 3);
  arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"clSetKernelArg");
  result = (cl_int)clSetKernelArg(arg1,arg2,arg3,(void const *)arg4);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clGetKernelInfo(lua_State* L) {
  int SWIG_arg = 0;
  cl_kernel arg1 = (cl_kernel) 0 ;
  cl_kernel_info arg2 ;
  size_t arg3 ;
  void *arg4 = (void *) 0 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t temp5 ;
  cl_int result;
  
  arg5 = &temp5; 
  SWIG_check_num_args("clGetKernelInfo",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clGetKernelInfo",1,"cl_kernel");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clGetKernelInfo",2,"cl_kernel_info");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clGetKernelInfo",3,"size_t");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clGetKernelInfo",4,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_kernel,0))){
    SWIG_fail_ptr("clGetKernelInfo",1,SWIGTYPE_p__cl_kernel);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_kernel_info)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (size_t)lua_tonumber(L, 3);
  arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"clGetKernelInfo");
  result = (cl_int)clGetKernelInfo(arg1,arg2,arg3,arg4,arg5);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clGetKernelWorkGroupInfo(lua_State* L) {
  int SWIG_arg = 0;
  cl_kernel arg1 = (cl_kernel) 0 ;
  cl_device_id arg2 = (cl_device_id) 0 ;
  cl_kernel_work_group_info arg3 ;
  size_t arg4 ;
  void *arg5 = (void *) 0 ;
  size_t *arg6 = (size_t *) 0 ;
  size_t temp6 ;
  cl_int result;
  
  arg6 = &temp6; 
  SWIG_check_num_args("clGetKernelWorkGroupInfo",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clGetKernelWorkGroupInfo",1,"cl_kernel");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clGetKernelWorkGroupInfo",2,"cl_device_id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clGetKernelWorkGroupInfo",3,"cl_kernel_work_group_info");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("clGetKernelWorkGroupInfo",4,"size_t");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("clGetKernelWorkGroupInfo",5,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_kernel,0))){
    SWIG_fail_ptr("clGetKernelWorkGroupInfo",1,SWIGTYPE_p__cl_kernel);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p__cl_device_id,0))){
    SWIG_fail_ptr("clGetKernelWorkGroupInfo",2,SWIGTYPE_p__cl_device_id);
  }
  
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (cl_kernel_work_group_info)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (size_t)lua_tonumber(L, 4);
  arg5=(void *)SWIG_MustGetPtr(L,5,0,0,5,"clGetKernelWorkGroupInfo");
  result = (cl_int)clGetKernelWorkGroupInfo(arg1,arg2,arg3,arg4,arg5,arg6);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg6); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clWaitForEvents(lua_State* L) {
  int SWIG_arg = 0;
  cl_uint arg1 ;
  cl_event *arg2 = (cl_event *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clWaitForEvents",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("clWaitForEvents",1,"cl_uint");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clWaitForEvents",2,"cl_event const *");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (cl_uint)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clWaitForEvents",2,SWIGTYPE_p_p__cl_event);
  }
  
  result = (cl_int)clWaitForEvents(arg1,(_cl_event *const *)arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clGetEventInfo(lua_State* L) {
  int SWIG_arg = 0;
  cl_event arg1 = (cl_event) 0 ;
  cl_event_info arg2 ;
  size_t arg3 ;
  void *arg4 = (void *) 0 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t temp5 ;
  cl_int result;
  
  arg5 = &temp5; 
  SWIG_check_num_args("clGetEventInfo",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clGetEventInfo",1,"cl_event");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clGetEventInfo",2,"cl_event_info");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clGetEventInfo",3,"size_t");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clGetEventInfo",4,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_event,0))){
    SWIG_fail_ptr("clGetEventInfo",1,SWIGTYPE_p__cl_event);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_event_info)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (size_t)lua_tonumber(L, 3);
  arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"clGetEventInfo");
  result = (cl_int)clGetEventInfo(arg1,arg2,arg3,arg4,arg5);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clRetainEvent(lua_State* L) {
  int SWIG_arg = 0;
  cl_event arg1 = (cl_event) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clRetainEvent",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clRetainEvent",1,"cl_event");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_event,0))){
    SWIG_fail_ptr("clRetainEvent",1,SWIGTYPE_p__cl_event);
  }
  
  result = (cl_int)clRetainEvent(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clReleaseEvent(lua_State* L) {
  int SWIG_arg = 0;
  cl_event arg1 = (cl_event) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clReleaseEvent",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clReleaseEvent",1,"cl_event");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_event,0))){
    SWIG_fail_ptr("clReleaseEvent",1,SWIGTYPE_p__cl_event);
  }
  
  result = (cl_int)clReleaseEvent(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clGetEventProfilingInfo(lua_State* L) {
  int SWIG_arg = 0;
  cl_event arg1 = (cl_event) 0 ;
  cl_profiling_info arg2 ;
  size_t arg3 ;
  void *arg4 = (void *) 0 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t temp5 ;
  cl_int result;
  
  arg5 = &temp5; 
  SWIG_check_num_args("clGetEventProfilingInfo",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clGetEventProfilingInfo",1,"cl_event");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clGetEventProfilingInfo",2,"cl_profiling_info");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clGetEventProfilingInfo",3,"size_t");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clGetEventProfilingInfo",4,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_event,0))){
    SWIG_fail_ptr("clGetEventProfilingInfo",1,SWIGTYPE_p__cl_event);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_profiling_info)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (size_t)lua_tonumber(L, 3);
  arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"clGetEventProfilingInfo");
  result = (cl_int)clGetEventProfilingInfo(arg1,arg2,arg3,arg4,arg5);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clFlush(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clFlush",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clFlush",1,"cl_command_queue");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clFlush",1,SWIGTYPE_p__cl_command_queue);
  }
  
  result = (cl_int)clFlush(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clFinish(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clFinish",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clFinish",1,"cl_command_queue");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clFinish",1,SWIGTYPE_p__cl_command_queue);
  }
  
  result = (cl_int)clFinish(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueReadBuffer(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_mem arg2 = (cl_mem) 0 ;
  cl_bool arg3 ;
  size_t arg4 ;
  size_t arg5 ;
  void *arg6 = (void *) 0 ;
  cl_uint arg7 ;
  cl_event *arg8 = (cl_event *) 0 ;
  cl_event *arg9 = (cl_event *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clEnqueueReadBuffer",9,9)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueReadBuffer",1,"cl_command_queue");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clEnqueueReadBuffer",2,"cl_mem");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clEnqueueReadBuffer",3,"cl_bool");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("clEnqueueReadBuffer",4,"size_t");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("clEnqueueReadBuffer",5,"size_t");
  if(!SWIG_isptrtype(L,6)) SWIG_fail_arg("clEnqueueReadBuffer",6,"void *");
  if(!lua_isnumber(L,7)) SWIG_fail_arg("clEnqueueReadBuffer",7,"cl_uint");
  if(!SWIG_isptrtype(L,8)) SWIG_fail_arg("clEnqueueReadBuffer",8,"cl_event const *");
  if(!SWIG_isptrtype(L,9)) SWIG_fail_arg("clEnqueueReadBuffer",9,"cl_event *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueReadBuffer",1,SWIGTYPE_p__cl_command_queue);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clEnqueueReadBuffer",2,SWIGTYPE_p__cl_mem);
  }
  
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (cl_bool)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (size_t)lua_tonumber(L, 4);
  SWIG_contract_assert((lua_tonumber(L,5)>=0),"number must not be negative")
  arg5 = (size_t)lua_tonumber(L, 5);
  arg6=(void *)SWIG_MustGetPtr(L,6,0,0,6,"clEnqueueReadBuffer");
  SWIG_contract_assert((lua_tonumber(L,7)>=0),"number must not be negative")
  arg7 = (cl_uint)lua_tonumber(L, 7);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,8,(void**)&arg8,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueReadBuffer",8,SWIGTYPE_p_p__cl_event);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,9,(void**)&arg9,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueReadBuffer",9,SWIGTYPE_p_p__cl_event);
  }
  
  result = (cl_int)clEnqueueReadBuffer(arg1,arg2,arg3,arg4,arg5,arg6,arg7,(_cl_event *const *)arg8,arg9);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueWriteBuffer(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_mem arg2 = (cl_mem) 0 ;
  cl_bool arg3 ;
  size_t arg4 ;
  size_t arg5 ;
  void *arg6 = (void *) 0 ;
  cl_uint arg7 ;
  cl_event *arg8 = (cl_event *) 0 ;
  cl_event *arg9 = (cl_event *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clEnqueueWriteBuffer",9,9)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueWriteBuffer",1,"cl_command_queue");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clEnqueueWriteBuffer",2,"cl_mem");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clEnqueueWriteBuffer",3,"cl_bool");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("clEnqueueWriteBuffer",4,"size_t");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("clEnqueueWriteBuffer",5,"size_t");
  if(!SWIG_isptrtype(L,6)) SWIG_fail_arg("clEnqueueWriteBuffer",6,"void const *");
  if(!lua_isnumber(L,7)) SWIG_fail_arg("clEnqueueWriteBuffer",7,"cl_uint");
  if(!SWIG_isptrtype(L,8)) SWIG_fail_arg("clEnqueueWriteBuffer",8,"cl_event const *");
  if(!SWIG_isptrtype(L,9)) SWIG_fail_arg("clEnqueueWriteBuffer",9,"cl_event *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueWriteBuffer",1,SWIGTYPE_p__cl_command_queue);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clEnqueueWriteBuffer",2,SWIGTYPE_p__cl_mem);
  }
  
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (cl_bool)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (size_t)lua_tonumber(L, 4);
  SWIG_contract_assert((lua_tonumber(L,5)>=0),"number must not be negative")
  arg5 = (size_t)lua_tonumber(L, 5);
  arg6=(void *)SWIG_MustGetPtr(L,6,0,0,6,"clEnqueueWriteBuffer");
  SWIG_contract_assert((lua_tonumber(L,7)>=0),"number must not be negative")
  arg7 = (cl_uint)lua_tonumber(L, 7);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,8,(void**)&arg8,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueWriteBuffer",8,SWIGTYPE_p_p__cl_event);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,9,(void**)&arg9,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueWriteBuffer",9,SWIGTYPE_p_p__cl_event);
  }
  
  result = (cl_int)clEnqueueWriteBuffer(arg1,arg2,arg3,arg4,arg5,(void const *)arg6,arg7,(_cl_event *const *)arg8,arg9);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueCopyBuffer(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_mem arg2 = (cl_mem) 0 ;
  cl_mem arg3 = (cl_mem) 0 ;
  size_t arg4 ;
  size_t arg5 ;
  size_t arg6 ;
  cl_uint arg7 ;
  cl_event *arg8 = (cl_event *) 0 ;
  cl_event *arg9 = (cl_event *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clEnqueueCopyBuffer",9,9)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueCopyBuffer",1,"cl_command_queue");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clEnqueueCopyBuffer",2,"cl_mem");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("clEnqueueCopyBuffer",3,"cl_mem");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("clEnqueueCopyBuffer",4,"size_t");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("clEnqueueCopyBuffer",5,"size_t");
  if(!lua_isnumber(L,6)) SWIG_fail_arg("clEnqueueCopyBuffer",6,"size_t");
  if(!lua_isnumber(L,7)) SWIG_fail_arg("clEnqueueCopyBuffer",7,"cl_uint");
  if(!SWIG_isptrtype(L,8)) SWIG_fail_arg("clEnqueueCopyBuffer",8,"cl_event const *");
  if(!SWIG_isptrtype(L,9)) SWIG_fail_arg("clEnqueueCopyBuffer",9,"cl_event *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueCopyBuffer",1,SWIGTYPE_p__cl_command_queue);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clEnqueueCopyBuffer",2,SWIGTYPE_p__cl_mem);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clEnqueueCopyBuffer",3,SWIGTYPE_p__cl_mem);
  }
  
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (size_t)lua_tonumber(L, 4);
  SWIG_contract_assert((lua_tonumber(L,5)>=0),"number must not be negative")
  arg5 = (size_t)lua_tonumber(L, 5);
  SWIG_contract_assert((lua_tonumber(L,6)>=0),"number must not be negative")
  arg6 = (size_t)lua_tonumber(L, 6);
  SWIG_contract_assert((lua_tonumber(L,7)>=0),"number must not be negative")
  arg7 = (cl_uint)lua_tonumber(L, 7);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,8,(void**)&arg8,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueCopyBuffer",8,SWIGTYPE_p_p__cl_event);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,9,(void**)&arg9,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueCopyBuffer",9,SWIGTYPE_p_p__cl_event);
  }
  
  result = (cl_int)clEnqueueCopyBuffer(arg1,arg2,arg3,arg4,arg5,arg6,arg7,(_cl_event *const *)arg8,arg9);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueReadImage(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_mem arg2 = (cl_mem) 0 ;
  cl_bool arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t arg6 ;
  size_t arg7 ;
  void *arg8 = (void *) 0 ;
  cl_uint arg9 ;
  cl_event *arg10 = (cl_event *) 0 ;
  cl_event *arg11 = (cl_event *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clEnqueueReadImage",11,11)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueReadImage",1,"cl_command_queue");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clEnqueueReadImage",2,"cl_mem");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clEnqueueReadImage",3,"cl_bool");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clEnqueueReadImage",4,"size_t const *");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("clEnqueueReadImage",5,"size_t const *");
  if(!lua_isnumber(L,6)) SWIG_fail_arg("clEnqueueReadImage",6,"size_t");
  if(!lua_isnumber(L,7)) SWIG_fail_arg("clEnqueueReadImage",7,"size_t");
  if(!SWIG_isptrtype(L,8)) SWIG_fail_arg("clEnqueueReadImage",8,"void *");
  if(!lua_isnumber(L,9)) SWIG_fail_arg("clEnqueueReadImage",9,"cl_uint");
  if(!SWIG_isptrtype(L,10)) SWIG_fail_arg("clEnqueueReadImage",10,"cl_event const *");
  if(!SWIG_isptrtype(L,11)) SWIG_fail_arg("clEnqueueReadImage",11,"cl_event *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueReadImage",1,SWIGTYPE_p__cl_command_queue);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clEnqueueReadImage",2,SWIGTYPE_p__cl_mem);
  }
  
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (cl_bool)lua_tonumber(L, 3);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clEnqueueReadImage",4,SWIGTYPE_p_unsigned_int);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clEnqueueReadImage",5,SWIGTYPE_p_unsigned_int);
  }
  
  SWIG_contract_assert((lua_tonumber(L,6)>=0),"number must not be negative")
  arg6 = (size_t)lua_tonumber(L, 6);
  SWIG_contract_assert((lua_tonumber(L,7)>=0),"number must not be negative")
  arg7 = (size_t)lua_tonumber(L, 7);
  arg8=(void *)SWIG_MustGetPtr(L,8,0,0,8,"clEnqueueReadImage");
  SWIG_contract_assert((lua_tonumber(L,9)>=0),"number must not be negative")
  arg9 = (cl_uint)lua_tonumber(L, 9);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,10,(void**)&arg10,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueReadImage",10,SWIGTYPE_p_p__cl_event);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,11,(void**)&arg11,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueReadImage",11,SWIGTYPE_p_p__cl_event);
  }
  
  result = (cl_int)clEnqueueReadImage(arg1,arg2,arg3,(unsigned int const *)arg4,(unsigned int const *)arg5,arg6,arg7,arg8,arg9,(_cl_event *const *)arg10,arg11);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueWriteImage(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_mem arg2 = (cl_mem) 0 ;
  cl_bool arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t arg6 ;
  size_t arg7 ;
  void *arg8 = (void *) 0 ;
  cl_uint arg9 ;
  cl_event *arg10 = (cl_event *) 0 ;
  cl_event *arg11 = (cl_event *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clEnqueueWriteImage",11,11)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueWriteImage",1,"cl_command_queue");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clEnqueueWriteImage",2,"cl_mem");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clEnqueueWriteImage",3,"cl_bool");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clEnqueueWriteImage",4,"size_t const *");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("clEnqueueWriteImage",5,"size_t const *");
  if(!lua_isnumber(L,6)) SWIG_fail_arg("clEnqueueWriteImage",6,"size_t");
  if(!lua_isnumber(L,7)) SWIG_fail_arg("clEnqueueWriteImage",7,"size_t");
  if(!SWIG_isptrtype(L,8)) SWIG_fail_arg("clEnqueueWriteImage",8,"void const *");
  if(!lua_isnumber(L,9)) SWIG_fail_arg("clEnqueueWriteImage",9,"cl_uint");
  if(!SWIG_isptrtype(L,10)) SWIG_fail_arg("clEnqueueWriteImage",10,"cl_event const *");
  if(!SWIG_isptrtype(L,11)) SWIG_fail_arg("clEnqueueWriteImage",11,"cl_event *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueWriteImage",1,SWIGTYPE_p__cl_command_queue);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clEnqueueWriteImage",2,SWIGTYPE_p__cl_mem);
  }
  
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (cl_bool)lua_tonumber(L, 3);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clEnqueueWriteImage",4,SWIGTYPE_p_unsigned_int);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clEnqueueWriteImage",5,SWIGTYPE_p_unsigned_int);
  }
  
  SWIG_contract_assert((lua_tonumber(L,6)>=0),"number must not be negative")
  arg6 = (size_t)lua_tonumber(L, 6);
  SWIG_contract_assert((lua_tonumber(L,7)>=0),"number must not be negative")
  arg7 = (size_t)lua_tonumber(L, 7);
  arg8=(void *)SWIG_MustGetPtr(L,8,0,0,8,"clEnqueueWriteImage");
  SWIG_contract_assert((lua_tonumber(L,9)>=0),"number must not be negative")
  arg9 = (cl_uint)lua_tonumber(L, 9);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,10,(void**)&arg10,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueWriteImage",10,SWIGTYPE_p_p__cl_event);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,11,(void**)&arg11,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueWriteImage",11,SWIGTYPE_p_p__cl_event);
  }
  
  result = (cl_int)clEnqueueWriteImage(arg1,arg2,arg3,(unsigned int const *)arg4,(unsigned int const *)arg5,arg6,arg7,(void const *)arg8,arg9,(_cl_event *const *)arg10,arg11);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueCopyImage(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_mem arg2 = (cl_mem) 0 ;
  cl_mem arg3 = (cl_mem) 0 ;
  size_t *arg4 = (size_t *) 0 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t *arg6 = (size_t *) 0 ;
  cl_uint arg7 ;
  cl_event *arg8 = (cl_event *) 0 ;
  cl_event *arg9 = (cl_event *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clEnqueueCopyImage",9,9)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueCopyImage",1,"cl_command_queue");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clEnqueueCopyImage",2,"cl_mem");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("clEnqueueCopyImage",3,"cl_mem");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clEnqueueCopyImage",4,"size_t const *");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("clEnqueueCopyImage",5,"size_t const *");
  if(!SWIG_isptrtype(L,6)) SWIG_fail_arg("clEnqueueCopyImage",6,"size_t const *");
  if(!lua_isnumber(L,7)) SWIG_fail_arg("clEnqueueCopyImage",7,"cl_uint");
  if(!SWIG_isptrtype(L,8)) SWIG_fail_arg("clEnqueueCopyImage",8,"cl_event const *");
  if(!SWIG_isptrtype(L,9)) SWIG_fail_arg("clEnqueueCopyImage",9,"cl_event *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueCopyImage",1,SWIGTYPE_p__cl_command_queue);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clEnqueueCopyImage",2,SWIGTYPE_p__cl_mem);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clEnqueueCopyImage",3,SWIGTYPE_p__cl_mem);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clEnqueueCopyImage",4,SWIGTYPE_p_unsigned_int);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clEnqueueCopyImage",5,SWIGTYPE_p_unsigned_int);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,6,(void**)&arg6,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clEnqueueCopyImage",6,SWIGTYPE_p_unsigned_int);
  }
  
  SWIG_contract_assert((lua_tonumber(L,7)>=0),"number must not be negative")
  arg7 = (cl_uint)lua_tonumber(L, 7);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,8,(void**)&arg8,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueCopyImage",8,SWIGTYPE_p_p__cl_event);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,9,(void**)&arg9,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueCopyImage",9,SWIGTYPE_p_p__cl_event);
  }
  
  result = (cl_int)clEnqueueCopyImage(arg1,arg2,arg3,(unsigned int const *)arg4,(unsigned int const *)arg5,(unsigned int const *)arg6,arg7,(_cl_event *const *)arg8,arg9);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueCopyImageToBuffer(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_mem arg2 = (cl_mem) 0 ;
  cl_mem arg3 = (cl_mem) 0 ;
  size_t *arg4 = (size_t *) 0 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t arg6 ;
  cl_uint arg7 ;
  cl_event *arg8 = (cl_event *) 0 ;
  cl_event *arg9 = (cl_event *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clEnqueueCopyImageToBuffer",9,9)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueCopyImageToBuffer",1,"cl_command_queue");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clEnqueueCopyImageToBuffer",2,"cl_mem");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("clEnqueueCopyImageToBuffer",3,"cl_mem");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clEnqueueCopyImageToBuffer",4,"size_t const *");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("clEnqueueCopyImageToBuffer",5,"size_t const *");
  if(!lua_isnumber(L,6)) SWIG_fail_arg("clEnqueueCopyImageToBuffer",6,"size_t");
  if(!lua_isnumber(L,7)) SWIG_fail_arg("clEnqueueCopyImageToBuffer",7,"cl_uint");
  if(!SWIG_isptrtype(L,8)) SWIG_fail_arg("clEnqueueCopyImageToBuffer",8,"cl_event const *");
  if(!SWIG_isptrtype(L,9)) SWIG_fail_arg("clEnqueueCopyImageToBuffer",9,"cl_event *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueCopyImageToBuffer",1,SWIGTYPE_p__cl_command_queue);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clEnqueueCopyImageToBuffer",2,SWIGTYPE_p__cl_mem);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clEnqueueCopyImageToBuffer",3,SWIGTYPE_p__cl_mem);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clEnqueueCopyImageToBuffer",4,SWIGTYPE_p_unsigned_int);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clEnqueueCopyImageToBuffer",5,SWIGTYPE_p_unsigned_int);
  }
  
  SWIG_contract_assert((lua_tonumber(L,6)>=0),"number must not be negative")
  arg6 = (size_t)lua_tonumber(L, 6);
  SWIG_contract_assert((lua_tonumber(L,7)>=0),"number must not be negative")
  arg7 = (cl_uint)lua_tonumber(L, 7);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,8,(void**)&arg8,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueCopyImageToBuffer",8,SWIGTYPE_p_p__cl_event);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,9,(void**)&arg9,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueCopyImageToBuffer",9,SWIGTYPE_p_p__cl_event);
  }
  
  result = (cl_int)clEnqueueCopyImageToBuffer(arg1,arg2,arg3,(unsigned int const *)arg4,(unsigned int const *)arg5,arg6,arg7,(_cl_event *const *)arg8,arg9);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueCopyBufferToImage(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_mem arg2 = (cl_mem) 0 ;
  cl_mem arg3 = (cl_mem) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t *arg6 = (size_t *) 0 ;
  cl_uint arg7 ;
  cl_event *arg8 = (cl_event *) 0 ;
  cl_event *arg9 = (cl_event *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clEnqueueCopyBufferToImage",9,9)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueCopyBufferToImage",1,"cl_command_queue");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clEnqueueCopyBufferToImage",2,"cl_mem");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("clEnqueueCopyBufferToImage",3,"cl_mem");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("clEnqueueCopyBufferToImage",4,"size_t");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("clEnqueueCopyBufferToImage",5,"size_t const *");
  if(!SWIG_isptrtype(L,6)) SWIG_fail_arg("clEnqueueCopyBufferToImage",6,"size_t const *");
  if(!lua_isnumber(L,7)) SWIG_fail_arg("clEnqueueCopyBufferToImage",7,"cl_uint");
  if(!SWIG_isptrtype(L,8)) SWIG_fail_arg("clEnqueueCopyBufferToImage",8,"cl_event const *");
  if(!SWIG_isptrtype(L,9)) SWIG_fail_arg("clEnqueueCopyBufferToImage",9,"cl_event *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueCopyBufferToImage",1,SWIGTYPE_p__cl_command_queue);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clEnqueueCopyBufferToImage",2,SWIGTYPE_p__cl_mem);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clEnqueueCopyBufferToImage",3,SWIGTYPE_p__cl_mem);
  }
  
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (size_t)lua_tonumber(L, 4);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clEnqueueCopyBufferToImage",5,SWIGTYPE_p_unsigned_int);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,6,(void**)&arg6,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clEnqueueCopyBufferToImage",6,SWIGTYPE_p_unsigned_int);
  }
  
  SWIG_contract_assert((lua_tonumber(L,7)>=0),"number must not be negative")
  arg7 = (cl_uint)lua_tonumber(L, 7);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,8,(void**)&arg8,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueCopyBufferToImage",8,SWIGTYPE_p_p__cl_event);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,9,(void**)&arg9,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueCopyBufferToImage",9,SWIGTYPE_p_p__cl_event);
  }
  
  result = (cl_int)clEnqueueCopyBufferToImage(arg1,arg2,arg3,arg4,(unsigned int const *)arg5,(unsigned int const *)arg6,arg7,(_cl_event *const *)arg8,arg9);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueMapBuffer(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_mem arg2 = (cl_mem) 0 ;
  cl_bool arg3 ;
  cl_map_flags arg4 ;
  size_t arg5 ;
  size_t arg6 ;
  cl_uint arg7 ;
  cl_event *arg8 = (cl_event *) 0 ;
  cl_event *arg9 = (cl_event *) 0 ;
  cl_int *arg10 = (cl_int *) 0 ;
  cl_int temp10 ;
  void *result = 0 ;
  
  arg10 = &temp10; 
  SWIG_check_num_args("clEnqueueMapBuffer",9,9)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueMapBuffer",1,"cl_command_queue");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clEnqueueMapBuffer",2,"cl_mem");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clEnqueueMapBuffer",3,"cl_bool");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("clEnqueueMapBuffer",4,"cl_map_flags");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("clEnqueueMapBuffer",5,"size_t");
  if(!lua_isnumber(L,6)) SWIG_fail_arg("clEnqueueMapBuffer",6,"size_t");
  if(!lua_isnumber(L,7)) SWIG_fail_arg("clEnqueueMapBuffer",7,"cl_uint");
  if(!SWIG_isptrtype(L,8)) SWIG_fail_arg("clEnqueueMapBuffer",8,"cl_event const *");
  if(!SWIG_isptrtype(L,9)) SWIG_fail_arg("clEnqueueMapBuffer",9,"cl_event *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueMapBuffer",1,SWIGTYPE_p__cl_command_queue);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clEnqueueMapBuffer",2,SWIGTYPE_p__cl_mem);
  }
  
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (cl_bool)lua_tonumber(L, 3);
  arg4 = (cl_map_flags)lua_tonumber(L, 4);
  SWIG_contract_assert((lua_tonumber(L,5)>=0),"number must not be negative")
  arg5 = (size_t)lua_tonumber(L, 5);
  SWIG_contract_assert((lua_tonumber(L,6)>=0),"number must not be negative")
  arg6 = (size_t)lua_tonumber(L, 6);
  SWIG_contract_assert((lua_tonumber(L,7)>=0),"number must not be negative")
  arg7 = (cl_uint)lua_tonumber(L, 7);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,8,(void**)&arg8,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueMapBuffer",8,SWIGTYPE_p_p__cl_event);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,9,(void**)&arg9,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueMapBuffer",9,SWIGTYPE_p_p__cl_event);
  }
  
  result = (void *)clEnqueueMapBuffer(arg1,arg2,arg3,arg4,arg5,arg6,arg7,(_cl_event *const *)arg8,arg9,arg10);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; 
  lua_pushnumber(L, (lua_Number) *arg10); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueMapImage(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_mem arg2 = (cl_mem) 0 ;
  cl_bool arg3 ;
  cl_map_flags arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t *arg6 = (size_t *) 0 ;
  size_t *arg7 = (size_t *) 0 ;
  size_t *arg8 = (size_t *) 0 ;
  cl_uint arg9 ;
  cl_event *arg10 = (cl_event *) 0 ;
  cl_event *arg11 = (cl_event *) 0 ;
  cl_int *arg12 = (cl_int *) 0 ;
  cl_int temp12 ;
  void *result = 0 ;
  
  arg12 = &temp12; 
  SWIG_check_num_args("clEnqueueMapImage",11,11)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueMapImage",1,"cl_command_queue");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clEnqueueMapImage",2,"cl_mem");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clEnqueueMapImage",3,"cl_bool");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("clEnqueueMapImage",4,"cl_map_flags");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("clEnqueueMapImage",5,"size_t const *");
  if(!SWIG_isptrtype(L,6)) SWIG_fail_arg("clEnqueueMapImage",6,"size_t const *");
  if(!SWIG_isptrtype(L,7)) SWIG_fail_arg("clEnqueueMapImage",7,"size_t *");
  if(!SWIG_isptrtype(L,8)) SWIG_fail_arg("clEnqueueMapImage",8,"size_t *");
  if(!lua_isnumber(L,9)) SWIG_fail_arg("clEnqueueMapImage",9,"cl_uint");
  if(!SWIG_isptrtype(L,10)) SWIG_fail_arg("clEnqueueMapImage",10,"cl_event const *");
  if(!SWIG_isptrtype(L,11)) SWIG_fail_arg("clEnqueueMapImage",11,"cl_event *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueMapImage",1,SWIGTYPE_p__cl_command_queue);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clEnqueueMapImage",2,SWIGTYPE_p__cl_mem);
  }
  
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (cl_bool)lua_tonumber(L, 3);
  arg4 = (cl_map_flags)lua_tonumber(L, 4);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clEnqueueMapImage",5,SWIGTYPE_p_unsigned_int);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,6,(void**)&arg6,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clEnqueueMapImage",6,SWIGTYPE_p_unsigned_int);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,7,(void**)&arg7,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clEnqueueMapImage",7,SWIGTYPE_p_unsigned_int);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,8,(void**)&arg8,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clEnqueueMapImage",8,SWIGTYPE_p_unsigned_int);
  }
  
  SWIG_contract_assert((lua_tonumber(L,9)>=0),"number must not be negative")
  arg9 = (cl_uint)lua_tonumber(L, 9);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,10,(void**)&arg10,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueMapImage",10,SWIGTYPE_p_p__cl_event);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,11,(void**)&arg11,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueMapImage",11,SWIGTYPE_p_p__cl_event);
  }
  
  result = (void *)clEnqueueMapImage(arg1,arg2,arg3,arg4,(unsigned int const *)arg5,(unsigned int const *)arg6,arg7,arg8,arg9,(_cl_event *const *)arg10,arg11,arg12);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; 
  lua_pushnumber(L, (lua_Number) *arg12); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueUnmapMemObject(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_mem arg2 = (cl_mem) 0 ;
  void *arg3 = (void *) 0 ;
  cl_uint arg4 ;
  cl_event *arg5 = (cl_event *) 0 ;
  cl_event *arg6 = (cl_event *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clEnqueueUnmapMemObject",6,6)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueUnmapMemObject",1,"cl_command_queue");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clEnqueueUnmapMemObject",2,"cl_mem");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("clEnqueueUnmapMemObject",3,"void *");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("clEnqueueUnmapMemObject",4,"cl_uint");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("clEnqueueUnmapMemObject",5,"cl_event const *");
  if(!SWIG_isptrtype(L,6)) SWIG_fail_arg("clEnqueueUnmapMemObject",6,"cl_event *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueUnmapMemObject",1,SWIGTYPE_p__cl_command_queue);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clEnqueueUnmapMemObject",2,SWIGTYPE_p__cl_mem);
  }
  
  arg3=(void *)SWIG_MustGetPtr(L,3,0,0,3,"clEnqueueUnmapMemObject");
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (cl_uint)lua_tonumber(L, 4);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueUnmapMemObject",5,SWIGTYPE_p_p__cl_event);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,6,(void**)&arg6,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueUnmapMemObject",6,SWIGTYPE_p_p__cl_event);
  }
  
  result = (cl_int)clEnqueueUnmapMemObject(arg1,arg2,arg3,arg4,(_cl_event *const *)arg5,arg6);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueNDRangeKernel(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_kernel arg2 = (cl_kernel) 0 ;
  cl_uint arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t *arg6 = (size_t *) 0 ;
  cl_uint arg7 ;
  cl_event *arg8 = (cl_event *) 0 ;
  cl_event *arg9 = (cl_event *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clEnqueueNDRangeKernel",9,9)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueNDRangeKernel",1,"cl_command_queue");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clEnqueueNDRangeKernel",2,"cl_kernel");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clEnqueueNDRangeKernel",3,"cl_uint");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clEnqueueNDRangeKernel",4,"size_t const *");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("clEnqueueNDRangeKernel",5,"size_t const *");
  if(!SWIG_isptrtype(L,6)) SWIG_fail_arg("clEnqueueNDRangeKernel",6,"size_t const *");
  if(!lua_isnumber(L,7)) SWIG_fail_arg("clEnqueueNDRangeKernel",7,"cl_uint");
  if(!SWIG_isptrtype(L,8)) SWIG_fail_arg("clEnqueueNDRangeKernel",8,"cl_event const *");
  if(!SWIG_isptrtype(L,9)) SWIG_fail_arg("clEnqueueNDRangeKernel",9,"cl_event *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueNDRangeKernel",1,SWIGTYPE_p__cl_command_queue);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p__cl_kernel,0))){
    SWIG_fail_ptr("clEnqueueNDRangeKernel",2,SWIGTYPE_p__cl_kernel);
  }
  
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (cl_uint)lua_tonumber(L, 3);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clEnqueueNDRangeKernel",4,SWIGTYPE_p_unsigned_int);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clEnqueueNDRangeKernel",5,SWIGTYPE_p_unsigned_int);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,6,(void**)&arg6,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clEnqueueNDRangeKernel",6,SWIGTYPE_p_unsigned_int);
  }
  
  SWIG_contract_assert((lua_tonumber(L,7)>=0),"number must not be negative")
  arg7 = (cl_uint)lua_tonumber(L, 7);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,8,(void**)&arg8,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueNDRangeKernel",8,SWIGTYPE_p_p__cl_event);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,9,(void**)&arg9,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueNDRangeKernel",9,SWIGTYPE_p_p__cl_event);
  }
  
  result = (cl_int)clEnqueueNDRangeKernel(arg1,arg2,arg3,(unsigned int const *)arg4,(unsigned int const *)arg5,(unsigned int const *)arg6,arg7,(_cl_event *const *)arg8,arg9);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueTask(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_kernel arg2 = (cl_kernel) 0 ;
  cl_uint arg3 ;
  cl_event *arg4 = (cl_event *) 0 ;
  cl_event *arg5 = (cl_event *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clEnqueueTask",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueTask",1,"cl_command_queue");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clEnqueueTask",2,"cl_kernel");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clEnqueueTask",3,"cl_uint");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clEnqueueTask",4,"cl_event const *");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("clEnqueueTask",5,"cl_event *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueTask",1,SWIGTYPE_p__cl_command_queue);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p__cl_kernel,0))){
    SWIG_fail_ptr("clEnqueueTask",2,SWIGTYPE_p__cl_kernel);
  }
  
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (cl_uint)lua_tonumber(L, 3);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueTask",4,SWIGTYPE_p_p__cl_event);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueTask",5,SWIGTYPE_p_p__cl_event);
  }
  
  result = (cl_int)clEnqueueTask(arg1,arg2,arg3,(_cl_event *const *)arg4,arg5);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueNativeKernel(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  void (*arg2)(void *) = (void (*)(void *)) 0 ;
  void *arg3 = (void *) 0 ;
  size_t arg4 ;
  cl_uint arg5 ;
  cl_mem *arg6 = (cl_mem *) 0 ;
  void **arg7 = (void **) 0 ;
  cl_uint arg8 ;
  cl_event *arg9 = (cl_event *) 0 ;
  cl_event *arg10 = (cl_event *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clEnqueueNativeKernel",10,10)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueNativeKernel",1,"cl_command_queue");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clEnqueueNativeKernel",2,"void (*)(void *)");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("clEnqueueNativeKernel",3,"void *");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("clEnqueueNativeKernel",4,"size_t");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("clEnqueueNativeKernel",5,"cl_uint");
  if(!SWIG_isptrtype(L,6)) SWIG_fail_arg("clEnqueueNativeKernel",6,"cl_mem const *");
  if(!SWIG_isptrtype(L,7)) SWIG_fail_arg("clEnqueueNativeKernel",7,"void const **");
  if(!lua_isnumber(L,8)) SWIG_fail_arg("clEnqueueNativeKernel",8,"cl_uint");
  if(!SWIG_isptrtype(L,9)) SWIG_fail_arg("clEnqueueNativeKernel",9,"cl_event const *");
  if(!SWIG_isptrtype(L,10)) SWIG_fail_arg("clEnqueueNativeKernel",10,"cl_event *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueNativeKernel",1,SWIGTYPE_p__cl_command_queue);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_f_p_void__void,0))){
    SWIG_fail_ptr("clEnqueueNativeKernel",2,SWIGTYPE_p_f_p_void__void);
  }
  
  arg3=(void *)SWIG_MustGetPtr(L,3,0,0,3,"clEnqueueNativeKernel");
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (size_t)lua_tonumber(L, 4);
  SWIG_contract_assert((lua_tonumber(L,5)>=0),"number must not be negative")
  arg5 = (cl_uint)lua_tonumber(L, 5);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,6,(void**)&arg6,SWIGTYPE_p_p__cl_mem,0))){
    SWIG_fail_ptr("clEnqueueNativeKernel",6,SWIGTYPE_p_p__cl_mem);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,7,(void**)&arg7,SWIGTYPE_p_p_void,0))){
    SWIG_fail_ptr("clEnqueueNativeKernel",7,SWIGTYPE_p_p_void);
  }
  
  SWIG_contract_assert((lua_tonumber(L,8)>=0),"number must not be negative")
  arg8 = (cl_uint)lua_tonumber(L, 8);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,9,(void**)&arg9,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueNativeKernel",9,SWIGTYPE_p_p__cl_event);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,10,(void**)&arg10,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueNativeKernel",10,SWIGTYPE_p_p__cl_event);
  }
  
  result = (cl_int)clEnqueueNativeKernel(arg1,arg2,arg3,arg4,arg5,(_cl_mem *const *)arg6,(void const **)arg7,arg8,(_cl_event *const *)arg9,arg10);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueMarker(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_event *arg2 = (cl_event *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clEnqueueMarker",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueMarker",1,"cl_command_queue");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clEnqueueMarker",2,"cl_event *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueMarker",1,SWIGTYPE_p__cl_command_queue);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueMarker",2,SWIGTYPE_p_p__cl_event);
  }
  
  result = (cl_int)clEnqueueMarker(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueWaitForEvents(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_uint arg2 ;
  cl_event *arg3 = (cl_event *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clEnqueueWaitForEvents",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueWaitForEvents",1,"cl_command_queue");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clEnqueueWaitForEvents",2,"cl_uint");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("clEnqueueWaitForEvents",3,"cl_event const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueWaitForEvents",1,SWIGTYPE_p__cl_command_queue);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_uint)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueWaitForEvents",3,SWIGTYPE_p_p__cl_event);
  }
  
  result = (cl_int)clEnqueueWaitForEvents(arg1,arg2,(_cl_event *const *)arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueBarrier(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clEnqueueBarrier",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueBarrier",1,"cl_command_queue");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueBarrier",1,SWIGTYPE_p__cl_command_queue);
  }
  
  result = (cl_int)clEnqueueBarrier(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clGetExtensionFunctionAddress(lua_State* L) {
  int SWIG_arg = 0;
  char *arg1 = (char *) 0 ;
  void *result = 0 ;
  
  SWIG_check_num_args("clGetExtensionFunctionAddress",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("clGetExtensionFunctionAddress",1,"char const *");
  arg1 = (char *)lua_tostring(L, 1);
  result = (void *)clGetExtensionFunctionAddress((char const *)arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clCreateFromGLBuffer(lua_State* L) {
  int SWIG_arg = 0;
  cl_context arg1 = (cl_context) 0 ;
  cl_mem_flags arg2 ;
  GLuint arg3 ;
  int *arg4 = (int *) 0 ;
  GLuint *argp3 ;
  int temp4 ;
  cl_mem result;
  
  arg4 = &temp4; 
  SWIG_check_num_args("clCreateFromGLBuffer",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clCreateFromGLBuffer",1,"cl_context");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clCreateFromGLBuffer",2,"cl_mem_flags");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("clCreateFromGLBuffer",3,"GLuint");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_context,0))){
    SWIG_fail_ptr("clCreateFromGLBuffer",1,SWIGTYPE_p__cl_context);
  }
  
  arg2 = (cl_mem_flags)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&argp3,SWIGTYPE_p_GLuint,0))){
    SWIG_fail_ptr("clCreateFromGLBuffer",3,SWIGTYPE_p_GLuint);
  }
  arg3 = *argp3;
  
  result = (cl_mem)clCreateFromGLBuffer(arg1,arg2,arg3,arg4);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_mem,0); SWIG_arg++; 
  lua_pushnumber(L, (lua_Number) *arg4); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clCreateFromGLTexture2D(lua_State* L) {
  int SWIG_arg = 0;
  cl_context arg1 = (cl_context) 0 ;
  cl_mem_flags arg2 ;
  GLenum arg3 ;
  GLint arg4 ;
  GLuint arg5 ;
  cl_int *arg6 = (cl_int *) 0 ;
  GLenum *argp3 ;
  GLuint *argp5 ;
  cl_int temp6 ;
  cl_mem result;
  
  arg6 = &temp6; 
  SWIG_check_num_args("clCreateFromGLTexture2D",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clCreateFromGLTexture2D",1,"cl_context");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clCreateFromGLTexture2D",2,"cl_mem_flags");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("clCreateFromGLTexture2D",3,"GLenum");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("clCreateFromGLTexture2D",4,"GLint");
  if(!lua_isuserdata(L,5)) SWIG_fail_arg("clCreateFromGLTexture2D",5,"GLuint");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_context,0))){
    SWIG_fail_ptr("clCreateFromGLTexture2D",1,SWIGTYPE_p__cl_context);
  }
  
  arg2 = (cl_mem_flags)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&argp3,SWIGTYPE_p_GLenum,0))){
    SWIG_fail_ptr("clCreateFromGLTexture2D",3,SWIGTYPE_p_GLenum);
  }
  arg3 = *argp3;
  
  arg4 = (GLint)lua_tonumber(L, 4);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&argp5,SWIGTYPE_p_GLuint,0))){
    SWIG_fail_ptr("clCreateFromGLTexture2D",5,SWIGTYPE_p_GLuint);
  }
  arg5 = *argp5;
  
  result = (cl_mem)clCreateFromGLTexture2D(arg1,arg2,arg3,arg4,arg5,arg6);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_mem,0); SWIG_arg++; 
  lua_pushnumber(L, (lua_Number) *arg6); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clCreateFromGLTexture3D(lua_State* L) {
  int SWIG_arg = 0;
  cl_context arg1 = (cl_context) 0 ;
  cl_mem_flags arg2 ;
  GLenum arg3 ;
  GLint arg4 ;
  GLuint arg5 ;
  cl_int *arg6 = (cl_int *) 0 ;
  GLenum *argp3 ;
  GLuint *argp5 ;
  cl_int temp6 ;
  cl_mem result;
  
  arg6 = &temp6; 
  SWIG_check_num_args("clCreateFromGLTexture3D",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clCreateFromGLTexture3D",1,"cl_context");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clCreateFromGLTexture3D",2,"cl_mem_flags");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("clCreateFromGLTexture3D",3,"GLenum");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("clCreateFromGLTexture3D",4,"GLint");
  if(!lua_isuserdata(L,5)) SWIG_fail_arg("clCreateFromGLTexture3D",5,"GLuint");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_context,0))){
    SWIG_fail_ptr("clCreateFromGLTexture3D",1,SWIGTYPE_p__cl_context);
  }
  
  arg2 = (cl_mem_flags)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&argp3,SWIGTYPE_p_GLenum,0))){
    SWIG_fail_ptr("clCreateFromGLTexture3D",3,SWIGTYPE_p_GLenum);
  }
  arg3 = *argp3;
  
  arg4 = (GLint)lua_tonumber(L, 4);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&argp5,SWIGTYPE_p_GLuint,0))){
    SWIG_fail_ptr("clCreateFromGLTexture3D",5,SWIGTYPE_p_GLuint);
  }
  arg5 = *argp5;
  
  result = (cl_mem)clCreateFromGLTexture3D(arg1,arg2,arg3,arg4,arg5,arg6);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_mem,0); SWIG_arg++; 
  lua_pushnumber(L, (lua_Number) *arg6); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clCreateFromGLRenderbuffer(lua_State* L) {
  int SWIG_arg = 0;
  cl_context arg1 = (cl_context) 0 ;
  cl_mem_flags arg2 ;
  GLuint arg3 ;
  cl_int *arg4 = (cl_int *) 0 ;
  GLuint *argp3 ;
  cl_int temp4 ;
  cl_mem result;
  
  arg4 = &temp4; 
  SWIG_check_num_args("clCreateFromGLRenderbuffer",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clCreateFromGLRenderbuffer",1,"cl_context");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clCreateFromGLRenderbuffer",2,"cl_mem_flags");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("clCreateFromGLRenderbuffer",3,"GLuint");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_context,0))){
    SWIG_fail_ptr("clCreateFromGLRenderbuffer",1,SWIGTYPE_p__cl_context);
  }
  
  arg2 = (cl_mem_flags)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&argp3,SWIGTYPE_p_GLuint,0))){
    SWIG_fail_ptr("clCreateFromGLRenderbuffer",3,SWIGTYPE_p_GLuint);
  }
  arg3 = *argp3;
  
  result = (cl_mem)clCreateFromGLRenderbuffer(arg1,arg2,arg3,arg4);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p__cl_mem,0); SWIG_arg++; 
  lua_pushnumber(L, (lua_Number) *arg4); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clGetGLObjectInfo(lua_State* L) {
  int SWIG_arg = 0;
  cl_mem arg1 = (cl_mem) 0 ;
  cl_gl_object_type *arg2 = (cl_gl_object_type *) 0 ;
  GLuint *arg3 = (GLuint *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clGetGLObjectInfo",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clGetGLObjectInfo",1,"cl_mem");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("clGetGLObjectInfo",2,"cl_gl_object_type *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("clGetGLObjectInfo",3,"GLuint *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clGetGLObjectInfo",1,SWIGTYPE_p__cl_mem);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_unsigned_int,0))){
    SWIG_fail_ptr("clGetGLObjectInfo",2,SWIGTYPE_p_unsigned_int);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_GLuint,0))){
    SWIG_fail_ptr("clGetGLObjectInfo",3,SWIGTYPE_p_GLuint);
  }
  
  result = (cl_int)clGetGLObjectInfo(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clGetGLTextureInfo(lua_State* L) {
  int SWIG_arg = 0;
  cl_mem arg1 = (cl_mem) 0 ;
  cl_gl_texture_info arg2 ;
  size_t arg3 ;
  void *arg4 = (void *) 0 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t temp5 ;
  cl_int result;
  
  arg5 = &temp5; 
  SWIG_check_num_args("clGetGLTextureInfo",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clGetGLTextureInfo",1,"cl_mem");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clGetGLTextureInfo",2,"cl_gl_texture_info");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("clGetGLTextureInfo",3,"size_t");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("clGetGLTextureInfo",4,"void *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_mem,0))){
    SWIG_fail_ptr("clGetGLTextureInfo",1,SWIGTYPE_p__cl_mem);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_gl_texture_info)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (size_t)lua_tonumber(L, 3);
  arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"clGetGLTextureInfo");
  result = (cl_int)clGetGLTextureInfo(arg1,arg2,arg3,arg4,arg5);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueAcquireGLObjects(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_uint arg2 ;
  cl_mem *arg3 = (cl_mem *) 0 ;
  cl_uint arg4 ;
  cl_event *arg5 = (cl_event *) 0 ;
  cl_event *arg6 = (cl_event *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clEnqueueAcquireGLObjects",6,6)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueAcquireGLObjects",1,"cl_command_queue");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clEnqueueAcquireGLObjects",2,"cl_uint");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("clEnqueueAcquireGLObjects",3,"cl_mem const *");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("clEnqueueAcquireGLObjects",4,"cl_uint");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("clEnqueueAcquireGLObjects",5,"cl_event const *");
  if(!SWIG_isptrtype(L,6)) SWIG_fail_arg("clEnqueueAcquireGLObjects",6,"cl_event *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueAcquireGLObjects",1,SWIGTYPE_p__cl_command_queue);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_uint)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_p__cl_mem,0))){
    SWIG_fail_ptr("clEnqueueAcquireGLObjects",3,SWIGTYPE_p_p__cl_mem);
  }
  
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (cl_uint)lua_tonumber(L, 4);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueAcquireGLObjects",5,SWIGTYPE_p_p__cl_event);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,6,(void**)&arg6,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueAcquireGLObjects",6,SWIGTYPE_p_p__cl_event);
  }
  
  result = (cl_int)clEnqueueAcquireGLObjects(arg1,arg2,(_cl_mem *const *)arg3,arg4,(_cl_event *const *)arg5,arg6);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_clEnqueueReleaseGLObjects(lua_State* L) {
  int SWIG_arg = 0;
  cl_command_queue arg1 = (cl_command_queue) 0 ;
  cl_uint arg2 ;
  cl_mem *arg3 = (cl_mem *) 0 ;
  cl_uint arg4 ;
  cl_event *arg5 = (cl_event *) 0 ;
  cl_event *arg6 = (cl_event *) 0 ;
  cl_int result;
  
  SWIG_check_num_args("clEnqueueReleaseGLObjects",6,6)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("clEnqueueReleaseGLObjects",1,"cl_command_queue");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("clEnqueueReleaseGLObjects",2,"cl_uint");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("clEnqueueReleaseGLObjects",3,"cl_mem const *");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("clEnqueueReleaseGLObjects",4,"cl_uint");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("clEnqueueReleaseGLObjects",5,"cl_event const *");
  if(!SWIG_isptrtype(L,6)) SWIG_fail_arg("clEnqueueReleaseGLObjects",6,"cl_event *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__cl_command_queue,0))){
    SWIG_fail_ptr("clEnqueueReleaseGLObjects",1,SWIGTYPE_p__cl_command_queue);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (cl_uint)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_p__cl_mem,0))){
    SWIG_fail_ptr("clEnqueueReleaseGLObjects",3,SWIGTYPE_p_p__cl_mem);
  }
  
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (cl_uint)lua_tonumber(L, 4);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueReleaseGLObjects",5,SWIGTYPE_p_p__cl_event);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,6,(void**)&arg6,SWIGTYPE_p_p__cl_event,0))){
    SWIG_fail_ptr("clEnqueueReleaseGLObjects",6,SWIGTYPE_p_p__cl_event);
  }
  
  result = (cl_int)clEnqueueReleaseGLObjects(arg1,arg2,(_cl_mem *const *)arg3,arg4,(_cl_event *const *)arg5,arg6);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigbinstring(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  size_t arg2 ;
  char **arg3 = (char **) 0 ;
  size_t *arg4 = (size_t *) 0 ;
  char *btemp3 ;
  size_t stemp3 ;
  
  {
    arg3 = &btemp3;
    arg4 = &stemp3;
  }
  SWIG_check_num_args("swigbinstring",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigbinstring",1,"void *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("swigbinstring",2,"size_t");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigbinstring");
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (size_t)lua_tonumber(L, 2);
  swigbinstring(arg1,arg2,arg3,arg4);
  
  {
    lua_pushlstring(L,*arg3,*arg4); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigstring(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("swigstring",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigstring",1,"void *");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigstring");
  result = (char *)swigstring(arg1);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_int__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  int arg2 ;
  int result;
  
  SWIG_check_num_args("swigptr_to<(int)>",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(int)>",1,"void *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("swigptr_to<(int)>",2,"int");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_int");
  arg2 = (int)lua_tonumber(L, 2);
  result = (int)swigptr_to< int >(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_int__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  int result;
  
  SWIG_check_num_args("swigptr_to<(int)>",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(int)>",1,"void *");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_int");
  result = (int)swigptr_to< int >(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_int(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_swigto_int__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_swigto_int__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'swigto_int'\n"
    "  Possible C/C++ prototypes are:\n"
    "    swigptr_to< int >(void *,int)\n"
    "    swigptr_to< int >(void *)\n");
  lua_error(L);return 0;
}


static int _wrap_swigto_uint__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  int arg2 ;
  unsigned int result;
  
  SWIG_check_num_args("swigptr_to<(unsigned int)>",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(unsigned int)>",1,"void *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("swigptr_to<(unsigned int)>",2,"int");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_uint");
  arg2 = (int)lua_tonumber(L, 2);
  result = (unsigned int)swigptr_to< unsigned int >(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_uint__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  unsigned int result;
  
  SWIG_check_num_args("swigptr_to<(unsigned int)>",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(unsigned int)>",1,"void *");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_uint");
  result = (unsigned int)swigptr_to< unsigned int >(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_uint(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_swigto_uint__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_swigto_uint__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'swigto_uint'\n"
    "  Possible C/C++ prototypes are:\n"
    "    swigptr_to< unsigned int >(void *,int)\n"
    "    swigptr_to< unsigned int >(void *)\n");
  lua_error(L);return 0;
}


static int _wrap_swigto_char__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  int arg2 ;
  char result;
  
  SWIG_check_num_args("swigptr_to<(char)>",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(char)>",1,"void *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("swigptr_to<(char)>",2,"int");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_char");
  arg2 = (int)lua_tonumber(L, 2);
  result = (char)swigptr_to< char >(arg1,arg2);
  lua_pushfstring(L,"%c",result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_char__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  char result;
  
  SWIG_check_num_args("swigptr_to<(char)>",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(char)>",1,"void *");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_char");
  result = (char)swigptr_to< char >(arg1);
  lua_pushfstring(L,"%c",result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_char(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_swigto_char__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_swigto_char__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'swigto_char'\n"
    "  Possible C/C++ prototypes are:\n"
    "    swigptr_to< char >(void *,int)\n"
    "    swigptr_to< char >(void *)\n");
  lua_error(L);return 0;
}


static int _wrap_swigto_uchar__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  int arg2 ;
  unsigned char result;
  
  SWIG_check_num_args("swigptr_to<(unsigned char)>",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(unsigned char)>",1,"void *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("swigptr_to<(unsigned char)>",2,"int");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_uchar");
  arg2 = (int)lua_tonumber(L, 2);
  result = (unsigned char)swigptr_to< unsigned char >(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_uchar__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  unsigned char result;
  
  SWIG_check_num_args("swigptr_to<(unsigned char)>",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(unsigned char)>",1,"void *");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_uchar");
  result = (unsigned char)swigptr_to< unsigned char >(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_uchar(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_swigto_uchar__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_swigto_uchar__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'swigto_uchar'\n"
    "  Possible C/C++ prototypes are:\n"
    "    swigptr_to< unsigned char >(void *,int)\n"
    "    swigptr_to< unsigned char >(void *)\n");
  lua_error(L);return 0;
}


static int _wrap_swigto_short__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  int arg2 ;
  short result;
  
  SWIG_check_num_args("swigptr_to<(short)>",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(short)>",1,"void *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("swigptr_to<(short)>",2,"int");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_short");
  arg2 = (int)lua_tonumber(L, 2);
  result = (short)swigptr_to< short >(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_short__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  short result;
  
  SWIG_check_num_args("swigptr_to<(short)>",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(short)>",1,"void *");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_short");
  result = (short)swigptr_to< short >(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_short(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_swigto_short__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_swigto_short__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'swigto_short'\n"
    "  Possible C/C++ prototypes are:\n"
    "    swigptr_to< short >(void *,int)\n"
    "    swigptr_to< short >(void *)\n");
  lua_error(L);return 0;
}


static int _wrap_swigto_ushort__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  int arg2 ;
  unsigned short result;
  
  SWIG_check_num_args("swigptr_to<(unsigned short)>",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(unsigned short)>",1,"void *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("swigptr_to<(unsigned short)>",2,"int");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_ushort");
  arg2 = (int)lua_tonumber(L, 2);
  result = (unsigned short)swigptr_to< unsigned short >(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_ushort__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  unsigned short result;
  
  SWIG_check_num_args("swigptr_to<(unsigned short)>",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(unsigned short)>",1,"void *");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_ushort");
  result = (unsigned short)swigptr_to< unsigned short >(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_ushort(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_swigto_ushort__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_swigto_ushort__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'swigto_ushort'\n"
    "  Possible C/C++ prototypes are:\n"
    "    swigptr_to< unsigned short >(void *,int)\n"
    "    swigptr_to< unsigned short >(void *)\n");
  lua_error(L);return 0;
}


static int _wrap_swigto_long__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  int arg2 ;
  long long result;
  
  SWIG_check_num_args("swigptr_to<(cl_long)>",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(cl_long)>",1,"void *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("swigptr_to<(cl_long)>",2,"int");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_long");
  arg2 = (int)lua_tonumber(L, 2);
  result = (long long)swigptr_to< cl_long >(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_long__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  long long result;
  
  SWIG_check_num_args("swigptr_to<(cl_long)>",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(cl_long)>",1,"void *");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_long");
  result = (long long)swigptr_to< cl_long >(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_long(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_swigto_long__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_swigto_long__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'swigto_long'\n"
    "  Possible C/C++ prototypes are:\n"
    "    swigptr_to< cl_long >(void *,int)\n"
    "    swigptr_to< cl_long >(void *)\n");
  lua_error(L);return 0;
}


static int _wrap_swigto_ulong__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  int arg2 ;
  unsigned long long result;
  
  SWIG_check_num_args("swigptr_to<(cl_ulong)>",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(cl_ulong)>",1,"void *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("swigptr_to<(cl_ulong)>",2,"int");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_ulong");
  arg2 = (int)lua_tonumber(L, 2);
  result = (unsigned long long)swigptr_to< cl_ulong >(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_ulong__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  unsigned long long result;
  
  SWIG_check_num_args("swigptr_to<(cl_ulong)>",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(cl_ulong)>",1,"void *");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_ulong");
  result = (unsigned long long)swigptr_to< cl_ulong >(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_ulong(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_swigto_ulong__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_swigto_ulong__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'swigto_ulong'\n"
    "  Possible C/C++ prototypes are:\n"
    "    swigptr_to< cl_ulong >(void *,int)\n"
    "    swigptr_to< cl_ulong >(void *)\n");
  lua_error(L);return 0;
}


static int _wrap_swigto_float__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  int arg2 ;
  float result;
  
  SWIG_check_num_args("swigptr_to<(float)>",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(float)>",1,"void *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("swigptr_to<(float)>",2,"int");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_float");
  arg2 = (int)lua_tonumber(L, 2);
  result = (float)swigptr_to< float >(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_float__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  float result;
  
  SWIG_check_num_args("swigptr_to<(float)>",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(float)>",1,"void *");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_float");
  result = (float)swigptr_to< float >(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_float(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_swigto_float__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_swigto_float__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'swigto_float'\n"
    "  Possible C/C++ prototypes are:\n"
    "    swigptr_to< float >(void *,int)\n"
    "    swigptr_to< float >(void *)\n");
  lua_error(L);return 0;
}


static int _wrap_swigto_double__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  int arg2 ;
  double result;
  
  SWIG_check_num_args("swigptr_to<(double)>",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(double)>",1,"void *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("swigptr_to<(double)>",2,"int");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_double");
  arg2 = (int)lua_tonumber(L, 2);
  result = (double)swigptr_to< double >(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_double__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  double result;
  
  SWIG_check_num_args("swigptr_to<(double)>",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(double)>",1,"void *");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_double");
  result = (double)swigptr_to< double >(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_double(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_swigto_double__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_swigto_double__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'swigto_double'\n"
    "  Possible C/C++ prototypes are:\n"
    "    swigptr_to< double >(void *,int)\n"
    "    swigptr_to< double >(void *)\n");
  lua_error(L);return 0;
}


static int _wrap_swigto_ptr__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  int arg2 ;
  void *result = 0 ;
  
  SWIG_check_num_args("swigptr_to<(p.void)>",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(p.void)>",1,"void *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("swigptr_to<(p.void)>",2,"int");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_ptr");
  arg2 = (int)lua_tonumber(L, 2);
  result = (void *)swigptr_to< void * >(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_ptr__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  void *arg1 = (void *) 0 ;
  void *result = 0 ;
  
  SWIG_check_num_args("swigptr_to<(p.void)>",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("swigptr_to<(p.void)>",1,"void *");
  arg1=(void *)SWIG_MustGetPtr(L,1,0,0,1,"swigto_ptr");
  result = (void *)swigptr_to< void * >(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_swigto_ptr(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_swigto_ptr__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, 0, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_swigto_ptr__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'swigto_ptr'\n"
    "  Possible C/C++ prototypes are:\n"
    "    swigptr_to< void * >(void *,int)\n"
    "    swigptr_to< void * >(void *)\n");
  lua_error(L);return 0;
}


static int _wrap_SWIG_PTRSIZE_get(lua_State* L) {
  int SWIG_arg = 0;
  size_t result;
  
  SWIG_check_num_args("SWIG_PTRSIZE",0,0)
  result = (size_t)(size_t)SWIG_PTRSIZE;
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


#ifdef __cplusplus
}
#endif

static const struct luaL_reg swig_commands[] = {
    { "cl_platform_idArray_frompointer", _wrap_cl_platform_idArray_frompointer},
    { "cl_device_idArray_frompointer", _wrap_cl_device_idArray_frompointer},
    { "cl_contextArray_frompointer", _wrap_cl_contextArray_frompointer},
    { "cl_command_queueArray_frompointer", _wrap_cl_command_queueArray_frompointer},
    { "cl_memArray_frompointer", _wrap_cl_memArray_frompointer},
    { "cl_programArray_frompointer", _wrap_cl_programArray_frompointer},
    { "cl_kernelArray_frompointer", _wrap_cl_kernelArray_frompointer},
    { "cl_eventArray_frompointer", _wrap_cl_eventArray_frompointer},
    { "cl_samplerArray_frompointer", _wrap_cl_samplerArray_frompointer},
    { "cl_ucharArray_frompointer", _wrap_cl_ucharArray_frompointer},
    { "cl_charArray_frompointer", _wrap_cl_charArray_frompointer},
    { "clGetPlatformIDs", _wrap_clGetPlatformIDs},
    { "clGetPlatformInfo", _wrap_clGetPlatformInfo},
    { "clGetDeviceIDs", _wrap_clGetDeviceIDs},
    { "clGetDeviceInfo", _wrap_clGetDeviceInfo},
    { "clCreateContext", _wrap_clCreateContext},
    { "clCreateContextFromType", _wrap_clCreateContextFromType},
    { "clRetainContext", _wrap_clRetainContext},
    { "clReleaseContext", _wrap_clReleaseContext},
    { "clGetContextInfo", _wrap_clGetContextInfo},
    { "clCreateCommandQueue", _wrap_clCreateCommandQueue},
    { "clRetainCommandQueue", _wrap_clRetainCommandQueue},
    { "clReleaseCommandQueue", _wrap_clReleaseCommandQueue},
    { "clGetCommandQueueInfo", _wrap_clGetCommandQueueInfo},
    { "clSetCommandQueueProperty", _wrap_clSetCommandQueueProperty},
    { "clCreateBuffer", _wrap_clCreateBuffer},
    { "clCreateImage2D", _wrap_clCreateImage2D},
    { "clCreateImage3D", _wrap_clCreateImage3D},
    { "clRetainMemObject", _wrap_clRetainMemObject},
    { "clReleaseMemObject", _wrap_clReleaseMemObject},
    { "clGetSupportedImageFormats", _wrap_clGetSupportedImageFormats},
    { "clGetMemObjectInfo", _wrap_clGetMemObjectInfo},
    { "clGetImageInfo", _wrap_clGetImageInfo},
    { "clCreateSampler", _wrap_clCreateSampler},
    { "clRetainSampler", _wrap_clRetainSampler},
    { "clReleaseSampler", _wrap_clReleaseSampler},
    { "clGetSamplerInfo", _wrap_clGetSamplerInfo},
    { "clCreateProgramWithSource", _wrap_clCreateProgramWithSource},
    { "clCreateProgramWithBinary", _wrap_clCreateProgramWithBinary},
    { "clRetainProgram", _wrap_clRetainProgram},
    { "clReleaseProgram", _wrap_clReleaseProgram},
    { "clBuildProgram", _wrap_clBuildProgram},
    { "clUnloadCompiler", _wrap_clUnloadCompiler},
    { "clGetProgramInfo", _wrap_clGetProgramInfo},
    { "clGetProgramBuildInfo", _wrap_clGetProgramBuildInfo},
    { "clCreateKernel", _wrap_clCreateKernel},
    { "clCreateKernelsInProgram", _wrap_clCreateKernelsInProgram},
    { "clRetainKernel", _wrap_clRetainKernel},
    { "clReleaseKernel", _wrap_clReleaseKernel},
    { "clSetKernelArg", _wrap_clSetKernelArg},
    { "clGetKernelInfo", _wrap_clGetKernelInfo},
    { "clGetKernelWorkGroupInfo", _wrap_clGetKernelWorkGroupInfo},
    { "clWaitForEvents", _wrap_clWaitForEvents},
    { "clGetEventInfo", _wrap_clGetEventInfo},
    { "clRetainEvent", _wrap_clRetainEvent},
    { "clReleaseEvent", _wrap_clReleaseEvent},
    { "clGetEventProfilingInfo", _wrap_clGetEventProfilingInfo},
    { "clFlush", _wrap_clFlush},
    { "clFinish", _wrap_clFinish},
    { "clEnqueueReadBuffer", _wrap_clEnqueueReadBuffer},
    { "clEnqueueWriteBuffer", _wrap_clEnqueueWriteBuffer},
    { "clEnqueueCopyBuffer", _wrap_clEnqueueCopyBuffer},
    { "clEnqueueReadImage", _wrap_clEnqueueReadImage},
    { "clEnqueueWriteImage", _wrap_clEnqueueWriteImage},
    { "clEnqueueCopyImage", _wrap_clEnqueueCopyImage},
    { "clEnqueueCopyImageToBuffer", _wrap_clEnqueueCopyImageToBuffer},
    { "clEnqueueCopyBufferToImage", _wrap_clEnqueueCopyBufferToImage},
    { "clEnqueueMapBuffer", _wrap_clEnqueueMapBuffer},
    { "clEnqueueMapImage", _wrap_clEnqueueMapImage},
    { "clEnqueueUnmapMemObject", _wrap_clEnqueueUnmapMemObject},
    { "clEnqueueNDRangeKernel", _wrap_clEnqueueNDRangeKernel},
    { "clEnqueueTask", _wrap_clEnqueueTask},
    { "clEnqueueNativeKernel", _wrap_clEnqueueNativeKernel},
    { "clEnqueueMarker", _wrap_clEnqueueMarker},
    { "clEnqueueWaitForEvents", _wrap_clEnqueueWaitForEvents},
    { "clEnqueueBarrier", _wrap_clEnqueueBarrier},
    { "clGetExtensionFunctionAddress", _wrap_clGetExtensionFunctionAddress},
    { "clCreateFromGLBuffer", _wrap_clCreateFromGLBuffer},
    { "clCreateFromGLTexture2D", _wrap_clCreateFromGLTexture2D},
    { "clCreateFromGLTexture3D", _wrap_clCreateFromGLTexture3D},
    { "clCreateFromGLRenderbuffer", _wrap_clCreateFromGLRenderbuffer},
    { "clGetGLObjectInfo", _wrap_clGetGLObjectInfo},
    { "clGetGLTextureInfo", _wrap_clGetGLTextureInfo},
    { "clEnqueueAcquireGLObjects", _wrap_clEnqueueAcquireGLObjects},
    { "clEnqueueReleaseGLObjects", _wrap_clEnqueueReleaseGLObjects},
    { "swigbinstring", _wrap_swigbinstring},
    { "swigstring", _wrap_swigstring},
    { "swigto_int",_wrap_swigto_int},
    { "swigto_uint",_wrap_swigto_uint},
    { "swigto_char",_wrap_swigto_char},
    { "swigto_uchar",_wrap_swigto_uchar},
    { "swigto_short",_wrap_swigto_short},
    { "swigto_ushort",_wrap_swigto_ushort},
    { "swigto_long",_wrap_swigto_long},
    { "swigto_ulong",_wrap_swigto_ulong},
    { "swigto_float",_wrap_swigto_float},
    { "swigto_double",_wrap_swigto_double},
    { "swigto_ptr",_wrap_swigto_ptr},
    { "swigconvert",native_SWIG_convertto},
    { "swigtypeinfo",native_SWIG_get_typeinfo},
    {0,0}
};

static swig_lua_var_info swig_variables[] = {
    { "SWIG_PTRSIZE", _wrap_SWIG_PTRSIZE_get, SWIG_Lua_set_immutable },
    {0,0,0}
};

static swig_lua_const_info swig_constants[] = {
{ SWIG_LUA_INT,     (char *)"CL_SUCCESS", (long) 0, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_NOT_FOUND", (long) -1, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_NOT_AVAILABLE", (long) -2, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMPILER_NOT_AVAILABLE", (long) -3, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MEM_OBJECT_ALLOCATION_FAILURE", (long) -4, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_OUT_OF_RESOURCES", (long) -5, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_OUT_OF_HOST_MEMORY", (long) -6, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PROFILING_INFO_NOT_AVAILABLE", (long) -7, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MEM_COPY_OVERLAP", (long) -8, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_IMAGE_FORMAT_MISMATCH", (long) -9, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_IMAGE_FORMAT_NOT_SUPPORTED", (long) -10, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_BUILD_PROGRAM_FAILURE", (long) -11, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MAP_FAILURE", (long) -12, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_VALUE", (long) -30, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_DEVICE_TYPE", (long) -31, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_PLATFORM", (long) -32, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_DEVICE", (long) -33, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_CONTEXT", (long) -34, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_QUEUE_PROPERTIES", (long) -35, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_COMMAND_QUEUE", (long) -36, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_HOST_PTR", (long) -37, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_MEM_OBJECT", (long) -38, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_IMAGE_FORMAT_DESCRIPTOR", (long) -39, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_IMAGE_SIZE", (long) -40, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_SAMPLER", (long) -41, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_BINARY", (long) -42, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_BUILD_OPTIONS", (long) -43, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_PROGRAM", (long) -44, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_PROGRAM_EXECUTABLE", (long) -45, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_KERNEL_NAME", (long) -46, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_KERNEL_DEFINITION", (long) -47, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_KERNEL", (long) -48, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_ARG_INDEX", (long) -49, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_ARG_VALUE", (long) -50, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_ARG_SIZE", (long) -51, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_KERNEL_ARGS", (long) -52, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_WORK_DIMENSION", (long) -53, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_WORK_GROUP_SIZE", (long) -54, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_WORK_ITEM_SIZE", (long) -55, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_GLOBAL_OFFSET", (long) -56, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_EVENT_WAIT_LIST", (long) -57, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_EVENT", (long) -58, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_OPERATION", (long) -59, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_GL_OBJECT", (long) -60, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_BUFFER_SIZE", (long) -61, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_MIP_LEVEL", (long) -62, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INVALID_GLOBAL_WORK_SIZE", (long) -63, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_VERSION_1_0", (long) 1, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_FALSE", (long) 0, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_TRUE", (long) 1, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PLATFORM_PROFILE", (long) 0x0900, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PLATFORM_VERSION", (long) 0x0901, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PLATFORM_NAME", (long) 0x0902, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PLATFORM_VENDOR", (long) 0x0903, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PLATFORM_EXTENSIONS", (long) 0x0904, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_TYPE_DEFAULT", (long) (1 << 0), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_TYPE_CPU", (long) (1 << 1), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_TYPE_GPU", (long) (1 << 2), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_TYPE_ACCELERATOR", (long) (1 << 3), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_TYPE_ALL", (long) 0xFFFFFFFF, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_TYPE", (long) 0x1000, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_VENDOR_ID", (long) 0x1001, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_MAX_COMPUTE_UNITS", (long) 0x1002, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS", (long) 0x1003, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_MAX_WORK_GROUP_SIZE", (long) 0x1004, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_MAX_WORK_ITEM_SIZES", (long) 0x1005, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR", (long) 0x1006, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT", (long) 0x1007, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT", (long) 0x1008, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG", (long) 0x1009, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT", (long) 0x100A, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE", (long) 0x100B, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_MAX_CLOCK_FREQUENCY", (long) 0x100C, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_ADDRESS_BITS", (long) 0x100D, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_MAX_READ_IMAGE_ARGS", (long) 0x100E, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_MAX_WRITE_IMAGE_ARGS", (long) 0x100F, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_MAX_MEM_ALLOC_SIZE", (long) 0x1010, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_IMAGE2D_MAX_WIDTH", (long) 0x1011, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_IMAGE2D_MAX_HEIGHT", (long) 0x1012, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_IMAGE3D_MAX_WIDTH", (long) 0x1013, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_IMAGE3D_MAX_HEIGHT", (long) 0x1014, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_IMAGE3D_MAX_DEPTH", (long) 0x1015, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_IMAGE_SUPPORT", (long) 0x1016, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_MAX_PARAMETER_SIZE", (long) 0x1017, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_MAX_SAMPLERS", (long) 0x1018, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_MEM_BASE_ADDR_ALIGN", (long) 0x1019, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE", (long) 0x101A, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_SINGLE_FP_CONFIG", (long) 0x101B, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_GLOBAL_MEM_CACHE_TYPE", (long) 0x101C, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE", (long) 0x101D, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_GLOBAL_MEM_CACHE_SIZE", (long) 0x101E, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_GLOBAL_MEM_SIZE", (long) 0x101F, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE", (long) 0x1020, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_MAX_CONSTANT_ARGS", (long) 0x1021, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_LOCAL_MEM_TYPE", (long) 0x1022, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_LOCAL_MEM_SIZE", (long) 0x1023, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_ERROR_CORRECTION_SUPPORT", (long) 0x1024, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_PROFILING_TIMER_RESOLUTION", (long) 0x1025, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_ENDIAN_LITTLE", (long) 0x1026, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_AVAILABLE", (long) 0x1027, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_COMPILER_AVAILABLE", (long) 0x1028, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_EXECUTION_CAPABILITIES", (long) 0x1029, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_QUEUE_PROPERTIES", (long) 0x102A, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_NAME", (long) 0x102B, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_VENDOR", (long) 0x102C, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DRIVER_VERSION", (long) 0x102D, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_PROFILE", (long) 0x102E, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_VERSION", (long) 0x102F, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_EXTENSIONS", (long) 0x1030, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_DEVICE_PLATFORM", (long) 0x1031, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_FP_DENORM", (long) (1 << 0), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_FP_INF_NAN", (long) (1 << 1), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_FP_ROUND_TO_NEAREST", (long) (1 << 2), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_FP_ROUND_TO_ZERO", (long) (1 << 3), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_FP_ROUND_TO_INF", (long) (1 << 4), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_FP_FMA", (long) (1 << 5), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_NONE", (long) 0x0, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_READ_ONLY_CACHE", (long) 0x1, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_READ_WRITE_CACHE", (long) 0x2, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_LOCAL", (long) 0x1, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_GLOBAL", (long) 0x2, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_EXEC_KERNEL", (long) (1 << 0), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_EXEC_NATIVE_KERNEL", (long) (1 << 1), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE", (long) (1 << 0), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_QUEUE_PROFILING_ENABLE", (long) (1 << 1), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_CONTEXT_REFERENCE_COUNT", (long) 0x1080, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_CONTEXT_DEVICES", (long) 0x1081, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_CONTEXT_PROPERTIES", (long) 0x1082, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_CONTEXT_PLATFORM", (long) 0x1084, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_QUEUE_CONTEXT", (long) 0x1090, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_QUEUE_DEVICE", (long) 0x1091, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_QUEUE_REFERENCE_COUNT", (long) 0x1092, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_QUEUE_PROPERTIES", (long) 0x1093, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MEM_READ_WRITE", (long) (1 << 0), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MEM_WRITE_ONLY", (long) (1 << 1), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MEM_READ_ONLY", (long) (1 << 2), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MEM_USE_HOST_PTR", (long) (1 << 3), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MEM_ALLOC_HOST_PTR", (long) (1 << 4), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MEM_COPY_HOST_PTR", (long) (1 << 5), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_R", (long) 0x10B0, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_A", (long) 0x10B1, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_RG", (long) 0x10B2, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_RA", (long) 0x10B3, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_RGB", (long) 0x10B4, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_RGBA", (long) 0x10B5, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_BGRA", (long) 0x10B6, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_ARGB", (long) 0x10B7, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_INTENSITY", (long) 0x10B8, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_LUMINANCE", (long) 0x10B9, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_SNORM_INT8", (long) 0x10D0, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_SNORM_INT16", (long) 0x10D1, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_UNORM_INT8", (long) 0x10D2, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_UNORM_INT16", (long) 0x10D3, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_UNORM_SHORT_565", (long) 0x10D4, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_UNORM_SHORT_555", (long) 0x10D5, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_UNORM_INT_101010", (long) 0x10D6, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_SIGNED_INT8", (long) 0x10D7, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_SIGNED_INT16", (long) 0x10D8, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_SIGNED_INT32", (long) 0x10D9, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_UNSIGNED_INT8", (long) 0x10DA, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_UNSIGNED_INT16", (long) 0x10DB, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_UNSIGNED_INT32", (long) 0x10DC, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_HALF_FLOAT", (long) 0x10DD, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_FLOAT", (long) 0x10DE, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MEM_OBJECT_BUFFER", (long) 0x10F0, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MEM_OBJECT_IMAGE2D", (long) 0x10F1, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MEM_OBJECT_IMAGE3D", (long) 0x10F2, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MEM_TYPE", (long) 0x1100, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MEM_FLAGS", (long) 0x1101, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MEM_SIZE", (long) 0x1102, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MEM_HOST_PTR", (long) 0x1103, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MEM_MAP_COUNT", (long) 0x1104, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MEM_REFERENCE_COUNT", (long) 0x1105, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MEM_CONTEXT", (long) 0x1106, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_IMAGE_FORMAT", (long) 0x1110, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_IMAGE_ELEMENT_SIZE", (long) 0x1111, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_IMAGE_ROW_PITCH", (long) 0x1112, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_IMAGE_SLICE_PITCH", (long) 0x1113, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_IMAGE_WIDTH", (long) 0x1114, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_IMAGE_HEIGHT", (long) 0x1115, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_IMAGE_DEPTH", (long) 0x1116, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_ADDRESS_NONE", (long) 0x1130, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_ADDRESS_CLAMP_TO_EDGE", (long) 0x1131, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_ADDRESS_CLAMP", (long) 0x1132, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_ADDRESS_REPEAT", (long) 0x1133, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_FILTER_NEAREST", (long) 0x1140, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_FILTER_LINEAR", (long) 0x1141, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_SAMPLER_REFERENCE_COUNT", (long) 0x1150, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_SAMPLER_CONTEXT", (long) 0x1151, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_SAMPLER_NORMALIZED_COORDS", (long) 0x1152, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_SAMPLER_ADDRESSING_MODE", (long) 0x1153, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_SAMPLER_FILTER_MODE", (long) 0x1154, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MAP_READ", (long) (1 << 0), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_MAP_WRITE", (long) (1 << 1), 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PROGRAM_REFERENCE_COUNT", (long) 0x1160, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PROGRAM_CONTEXT", (long) 0x1161, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PROGRAM_NUM_DEVICES", (long) 0x1162, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PROGRAM_DEVICES", (long) 0x1163, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PROGRAM_SOURCE", (long) 0x1164, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PROGRAM_BINARY_SIZES", (long) 0x1165, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PROGRAM_BINARIES", (long) 0x1166, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PROGRAM_BUILD_STATUS", (long) 0x1181, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PROGRAM_BUILD_OPTIONS", (long) 0x1182, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PROGRAM_BUILD_LOG", (long) 0x1183, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_BUILD_SUCCESS", (long) 0, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_BUILD_NONE", (long) -1, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_BUILD_ERROR", (long) -2, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_BUILD_IN_PROGRESS", (long) -3, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_KERNEL_FUNCTION_NAME", (long) 0x1190, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_KERNEL_NUM_ARGS", (long) 0x1191, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_KERNEL_REFERENCE_COUNT", (long) 0x1192, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_KERNEL_CONTEXT", (long) 0x1193, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_KERNEL_PROGRAM", (long) 0x1194, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_KERNEL_WORK_GROUP_SIZE", (long) 0x11B0, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_KERNEL_COMPILE_WORK_GROUP_SIZE", (long) 0x11B1, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_KERNEL_LOCAL_MEM_SIZE", (long) 0x11B2, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_EVENT_COMMAND_QUEUE", (long) 0x11D0, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_EVENT_COMMAND_TYPE", (long) 0x11D1, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_EVENT_REFERENCE_COUNT", (long) 0x11D2, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_EVENT_COMMAND_EXECUTION_STATUS", (long) 0x11D3, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMMAND_NDRANGE_KERNEL", (long) 0x11F0, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMMAND_TASK", (long) 0x11F1, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMMAND_NATIVE_KERNEL", (long) 0x11F2, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMMAND_READ_BUFFER", (long) 0x11F3, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMMAND_WRITE_BUFFER", (long) 0x11F4, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMMAND_COPY_BUFFER", (long) 0x11F5, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMMAND_READ_IMAGE", (long) 0x11F6, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMMAND_WRITE_IMAGE", (long) 0x11F7, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMMAND_COPY_IMAGE", (long) 0x11F8, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMMAND_COPY_IMAGE_TO_BUFFER", (long) 0x11F9, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMMAND_COPY_BUFFER_TO_IMAGE", (long) 0x11FA, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMMAND_MAP_BUFFER", (long) 0x11FB, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMMAND_MAP_IMAGE", (long) 0x11FC, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMMAND_UNMAP_MEM_OBJECT", (long) 0x11FD, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMMAND_MARKER", (long) 0x11FE, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMMAND_ACQUIRE_GL_OBJECTS", (long) 0x11FF, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMMAND_RELEASE_GL_OBJECTS", (long) 0x1200, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_COMPLETE", (long) 0x0, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_RUNNING", (long) 0x1, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_SUBMITTED", (long) 0x2, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_QUEUED", (long) 0x3, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PROFILING_COMMAND_QUEUED", (long) 0x1280, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PROFILING_COMMAND_SUBMIT", (long) 0x1281, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PROFILING_COMMAND_START", (long) 0x1282, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_PROFILING_COMMAND_END", (long) 0x1283, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_GL_OBJECT_BUFFER", (long) 0x2000, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_GL_OBJECT_TEXTURE2D", (long) 0x2001, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_GL_OBJECT_TEXTURE3D", (long) 0x2002, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_GL_OBJECT_RENDERBUFFER", (long) 0x2003, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_GL_TEXTURE_TARGET", (long) 0x2004, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"CL_GL_MIPMAP_LEVEL", (long) 0x2005, 0, 0, 0},
    {0,0,0,0,0,0}
};

/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */

static swig_type_info _swigt__p_GLenum = {"_p_GLenum", "GLenum *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_GLuint = {"_p_GLuint", "GLuint *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p__cl_command_queue = {"_p__cl_command_queue", "cl_command_queue|_cl_command_queue *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p__cl_context = {"_p__cl_context", "_cl_context *|cl_context", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p__cl_device_id = {"_p__cl_device_id", "cl_device_id|_cl_device_id *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p__cl_event = {"_p__cl_event", "_cl_event *|cl_event", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p__cl_image_format = {"_p__cl_image_format", "_cl_image_format *|cl_image_format *", 0, 0, (void*)&_wrap_class_cl_image_format, 0};
static swig_type_info _swigt__p__cl_kernel = {"_p__cl_kernel", "_cl_kernel *|cl_kernel", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p__cl_mem = {"_p__cl_mem", "_cl_mem *|cl_mem", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p__cl_platform_id = {"_p__cl_platform_id", "_cl_platform_id *|cl_platform_id", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p__cl_program = {"_p__cl_program", "cl_program|_cl_program *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p__cl_sampler = {"_p__cl_sampler", "cl_sampler|_cl_sampler *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_cl_charArray = {"_p_cl_charArray", "cl_charArray *", 0, 0, (void*)&_wrap_class_cl_charArray, 0};
static swig_type_info _swigt__p_cl_command_queueArray = {"_p_cl_command_queueArray", "cl_command_queueArray *", 0, 0, (void*)&_wrap_class_cl_command_queueArray, 0};
static swig_type_info _swigt__p_cl_contextArray = {"_p_cl_contextArray", "cl_contextArray *", 0, 0, (void*)&_wrap_class_cl_contextArray, 0};
static swig_type_info _swigt__p_cl_device_idArray = {"_p_cl_device_idArray", "cl_device_idArray *", 0, 0, (void*)&_wrap_class_cl_device_idArray, 0};
static swig_type_info _swigt__p_cl_eventArray = {"_p_cl_eventArray", "cl_eventArray *", 0, 0, (void*)&_wrap_class_cl_eventArray, 0};
static swig_type_info _swigt__p_cl_kernelArray = {"_p_cl_kernelArray", "cl_kernelArray *", 0, 0, (void*)&_wrap_class_cl_kernelArray, 0};
static swig_type_info _swigt__p_cl_memArray = {"_p_cl_memArray", "cl_memArray *", 0, 0, (void*)&_wrap_class_cl_memArray, 0};
static swig_type_info _swigt__p_cl_platform_idArray = {"_p_cl_platform_idArray", "cl_platform_idArray *", 0, 0, (void*)&_wrap_class_cl_platform_idArray, 0};
static swig_type_info _swigt__p_cl_programArray = {"_p_cl_programArray", "cl_programArray *", 0, 0, (void*)&_wrap_class_cl_programArray, 0};
static swig_type_info _swigt__p_cl_samplerArray = {"_p_cl_samplerArray", "cl_samplerArray *", 0, 0, (void*)&_wrap_class_cl_samplerArray, 0};
static swig_type_info _swigt__p_cl_ucharArray = {"_p_cl_ucharArray", "cl_ucharArray *", 0, 0, (void*)&_wrap_class_cl_ucharArray, 0};
static swig_type_info _swigt__p_double = {"_p_double", "double *|cl_double *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_f_p__cl_program_p_void__void = {"_p_f_p__cl_program_p_void__void", "void (*)(_cl_program *,void *)|void (*)(cl_program,void *)", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_f_p_q_const__char_p_q_const__void_unsigned_int_p_void__void = {"_p_f_p_q_const__char_p_q_const__void_unsigned_int_p_void__void", "void (*)(char const *,void const *,unsigned int,void *)|void (*)(char const *,void const *,size_t,void *)", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_f_p_void__void = {"_p_f_p_void__void", "void (*)(void *)", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_float = {"_p_float", "float *|cl_float *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_int = {"_p_int", "cl_int *|int *|cl_build_status *|GLint *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_intptr_t = {"_p_intptr_t", "intptr_t *|cl_context_properties *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_long_long = {"_p_long_long", "cl_long *|long long *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p__cl_command_queue = {"_p_p__cl_command_queue", "cl_command_queue *|_cl_command_queue **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p__cl_context = {"_p_p__cl_context", "cl_context *|_cl_context **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p__cl_device_id = {"_p_p__cl_device_id", "_cl_device_id **|cl_device_id *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p__cl_event = {"_p_p__cl_event", "_cl_event **|cl_event *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p__cl_kernel = {"_p_p__cl_kernel", "_cl_kernel **|cl_kernel *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p__cl_mem = {"_p_p__cl_mem", "cl_mem *|_cl_mem **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p__cl_platform_id = {"_p_p__cl_platform_id", "cl_platform_id *|_cl_platform_id **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p__cl_program = {"_p_p__cl_program", "_cl_program **|cl_program *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p__cl_sampler = {"_p_p__cl_sampler", "cl_sampler *|_cl_sampler **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_unsigned_char = {"_p_p_unsigned_char", "unsigned char **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_void = {"_p_p_void", "void **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_short = {"_p_short", "short *|cl_short *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_signed_char = {"_p_signed_char", "cl_char *|signed char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "cl_uchar *|unsigned char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "cl_channel_type *|cl_gl_object_type *|cl_device_mem_cache_type *|cl_mem_object_type *|cl_command_type *|cl_device_local_mem_type *|cl_channel_order *|cl_addressing_mode *|cl_kernel_work_group_info *|cl_profiling_info *|cl_device_info *|cl_command_queue_info *|cl_image_info *|cl_context_info *|cl_filter_mode *|cl_sampler_info *|cl_event_info *|cl_program_build_info *|cl_platform_info *|cl_gl_platform_info *|cl_gl_texture_info *|size_t *|cl_kernel_info *|cl_mem_info *|cl_program_info *|cl_uint *|cl_bool *|unsigned int *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_long_long = {"_p_unsigned_long_long", "cl_device_type *|cl_device_address_info *|cl_device_fp_config *|cl_device_exec_capabilities *|cl_ulong *|unsigned long long *|cl_command_queue_properties *|cl_bitfield *|cl_mem_flags *|cl_map_flags *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned short *|cl_ushort *|cl_half *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_void = {"_p_void", "void *", 0, 0, (void*)0, 0};

static swig_type_info *swig_type_initial[] = {
  &_swigt__p_GLenum,
  &_swigt__p_GLuint,
  &_swigt__p__cl_command_queue,
  &_swigt__p__cl_context,
  &_swigt__p__cl_device_id,
  &_swigt__p__cl_event,
  &_swigt__p__cl_image_format,
  &_swigt__p__cl_kernel,
  &_swigt__p__cl_mem,
  &_swigt__p__cl_platform_id,
  &_swigt__p__cl_program,
  &_swigt__p__cl_sampler,
  &_swigt__p_cl_charArray,
  &_swigt__p_cl_command_queueArray,
  &_swigt__p_cl_contextArray,
  &_swigt__p_cl_device_idArray,
  &_swigt__p_cl_eventArray,
  &_swigt__p_cl_kernelArray,
  &_swigt__p_cl_memArray,
  &_swigt__p_cl_platform_idArray,
  &_swigt__p_cl_programArray,
  &_swigt__p_cl_samplerArray,
  &_swigt__p_cl_ucharArray,
  &_swigt__p_double,
  &_swigt__p_f_p__cl_program_p_void__void,
  &_swigt__p_f_p_q_const__char_p_q_const__void_unsigned_int_p_void__void,
  &_swigt__p_f_p_void__void,
  &_swigt__p_float,
  &_swigt__p_int,
  &_swigt__p_intptr_t,
  &_swigt__p_long_long,
  &_swigt__p_p__cl_command_queue,
  &_swigt__p_p__cl_context,
  &_swigt__p_p__cl_device_id,
  &_swigt__p_p__cl_event,
  &_swigt__p_p__cl_kernel,
  &_swigt__p_p__cl_mem,
  &_swigt__p_p__cl_platform_id,
  &_swigt__p_p__cl_program,
  &_swigt__p_p__cl_sampler,
  &_swigt__p_p_char,
  &_swigt__p_p_unsigned_char,
  &_swigt__p_p_void,
  &_swigt__p_short,
  &_swigt__p_signed_char,
  &_swigt__p_unsigned_char,
  &_swigt__p_unsigned_int,
  &_swigt__p_unsigned_long_long,
  &_swigt__p_unsigned_short,
  &_swigt__p_void,
};

static swig_cast_info _swigc__p_GLenum[] = {  {&_swigt__p_GLenum, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_GLuint[] = {  {&_swigt__p_GLuint, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p__cl_command_queue[] = {  {&_swigt__p__cl_command_queue, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p__cl_context[] = {  {&_swigt__p__cl_context, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p__cl_device_id[] = {  {&_swigt__p__cl_device_id, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p__cl_event[] = {  {&_swigt__p__cl_event, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p__cl_image_format[] = {  {&_swigt__p__cl_image_format, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p__cl_kernel[] = {  {&_swigt__p__cl_kernel, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p__cl_mem[] = {  {&_swigt__p__cl_mem, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p__cl_platform_id[] = {  {&_swigt__p__cl_platform_id, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p__cl_program[] = {  {&_swigt__p__cl_program, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p__cl_sampler[] = {  {&_swigt__p__cl_sampler, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_cl_charArray[] = {  {&_swigt__p_cl_charArray, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_cl_command_queueArray[] = {  {&_swigt__p_cl_command_queueArray, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_cl_contextArray[] = {  {&_swigt__p_cl_contextArray, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_cl_device_idArray[] = {  {&_swigt__p_cl_device_idArray, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_cl_eventArray[] = {  {&_swigt__p_cl_eventArray, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_cl_kernelArray[] = {  {&_swigt__p_cl_kernelArray, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_cl_memArray[] = {  {&_swigt__p_cl_memArray, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_cl_platform_idArray[] = {  {&_swigt__p_cl_platform_idArray, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_cl_programArray[] = {  {&_swigt__p_cl_programArray, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_cl_samplerArray[] = {  {&_swigt__p_cl_samplerArray, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_cl_ucharArray[] = {  {&_swigt__p_cl_ucharArray, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_f_p__cl_program_p_void__void[] = {  {&_swigt__p_f_p__cl_program_p_void__void, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_f_p_q_const__char_p_q_const__void_unsigned_int_p_void__void[] = {  {&_swigt__p_f_p_q_const__char_p_q_const__void_unsigned_int_p_void__void, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_f_p_void__void[] = {  {&_swigt__p_f_p_void__void, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_intptr_t[] = {  {&_swigt__p_intptr_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_long_long[] = {  {&_swigt__p_long_long, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p__cl_command_queue[] = {  {&_swigt__p_p__cl_command_queue, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p__cl_context[] = {  {&_swigt__p_p__cl_context, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p__cl_device_id[] = {  {&_swigt__p_p__cl_device_id, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p__cl_event[] = {  {&_swigt__p_p__cl_event, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p__cl_kernel[] = {  {&_swigt__p_p__cl_kernel, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p__cl_mem[] = {  {&_swigt__p_p__cl_mem, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p__cl_platform_id[] = {  {&_swigt__p_p__cl_platform_id, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p__cl_program[] = {  {&_swigt__p_p__cl_program, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p__cl_sampler[] = {  {&_swigt__p_p__cl_sampler, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_char[] = {  {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_unsigned_char[] = {  {&_swigt__p_p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_void[] = {  {&_swigt__p_p_void, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_short[] = {  {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_signed_char[] = {  {&_swigt__p_signed_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_int[] = {  {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_long_long[] = {  {&_swigt__p_unsigned_long_long, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_short[] = {  {&_swigt__p_unsigned_short, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_void[] = {  {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};

static swig_cast_info *swig_cast_initial[] = {
  _swigc__p_GLenum,
  _swigc__p_GLuint,
  _swigc__p__cl_command_queue,
  _swigc__p__cl_context,
  _swigc__p__cl_device_id,
  _swigc__p__cl_event,
  _swigc__p__cl_image_format,
  _swigc__p__cl_kernel,
  _swigc__p__cl_mem,
  _swigc__p__cl_platform_id,
  _swigc__p__cl_program,
  _swigc__p__cl_sampler,
  _swigc__p_cl_charArray,
  _swigc__p_cl_command_queueArray,
  _swigc__p_cl_contextArray,
  _swigc__p_cl_device_idArray,
  _swigc__p_cl_eventArray,
  _swigc__p_cl_kernelArray,
  _swigc__p_cl_memArray,
  _swigc__p_cl_platform_idArray,
  _swigc__p_cl_programArray,
  _swigc__p_cl_samplerArray,
  _swigc__p_cl_ucharArray,
  _swigc__p_double,
  _swigc__p_f_p__cl_program_p_void__void,
  _swigc__p_f_p_q_const__char_p_q_const__void_unsigned_int_p_void__void,
  _swigc__p_f_p_void__void,
  _swigc__p_float,
  _swigc__p_int,
  _swigc__p_intptr_t,
  _swigc__p_long_long,
  _swigc__p_p__cl_command_queue,
  _swigc__p_p__cl_context,
  _swigc__p_p__cl_device_id,
  _swigc__p_p__cl_event,
  _swigc__p_p__cl_kernel,
  _swigc__p_p__cl_mem,
  _swigc__p_p__cl_platform_id,
  _swigc__p_p__cl_program,
  _swigc__p_p__cl_sampler,
  _swigc__p_p_char,
  _swigc__p_p_unsigned_char,
  _swigc__p_p_void,
  _swigc__p_short,
  _swigc__p_signed_char,
  _swigc__p_unsigned_char,
  _swigc__p_unsigned_int,
  _swigc__p_unsigned_long_long,
  _swigc__p_unsigned_short,
  _swigc__p_void,
};


/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */

/* -----------------------------------------------------------------------------
 * Type initialization:
 * This problem is tough by the requirement that no dynamic 
 * memory is used. Also, since swig_type_info structures store pointers to 
 * swig_cast_info structures and swig_cast_info structures store pointers back
 * to swig_type_info structures, we need some lookup code at initialization. 
 * The idea is that swig generates all the structures that are needed. 
 * The runtime then collects these partially filled structures. 
 * The SWIG_InitializeModule function takes these initial arrays out of 
 * swig_module, and does all the lookup, filling in the swig_module.types
 * array with the correct data and linking the correct swig_cast_info
 * structures together.
 *
 * The generated swig_type_info structures are assigned staticly to an initial 
 * array. We just loop through that array, and handle each type individually.
 * First we lookup if this type has been already loaded, and if so, use the
 * loaded structure instead of the generated one. Then we have to fill in the
 * cast linked list. The cast data is initially stored in something like a
 * two-dimensional array. Each row corresponds to a type (there are the same
 * number of rows as there are in the swig_type_initial array). Each entry in
 * a column is one of the swig_cast_info structures for that type.
 * The cast_initial array is actually an array of arrays, because each row has
 * a variable number of columns. So to actually build the cast linked list,
 * we find the array of casts associated with the type, and loop through it 
 * adding the casts to the list. The one last trick we need to do is making
 * sure the type pointer in the swig_cast_info struct is correct.
 *
 * First off, we lookup the cast->type name to see if it is already loaded. 
 * There are three cases to handle:
 *  1) If the cast->type has already been loaded AND the type we are adding
 *     casting info to has not been loaded (it is in this module), THEN we
 *     replace the cast->type pointer with the type pointer that has already
 *     been loaded.
 *  2) If BOTH types (the one we are adding casting info to, and the 
 *     cast->type) are loaded, THEN the cast info has already been loaded by
 *     the previous module so we just ignore it.
 *  3) Finally, if cast->type has not already been loaded, then we add that
 *     swig_cast_info to the linked list (because the cast->type) pointer will
 *     be correct.
 * ----------------------------------------------------------------------------- */

#ifdef __cplusplus
extern "C" {
#if 0
} /* c-mode */
#endif
#endif

#if 0
#define SWIGRUNTIME_DEBUG
#endif


SWIGRUNTIME void
SWIG_InitializeModule(void *clientdata) {
  size_t i;
  swig_module_info *module_head, *iter;
  int found, init;

  clientdata = clientdata;

  /* check to see if the circular list has been setup, if not, set it up */
  if (swig_module.next==0) {
    /* Initialize the swig_module */
    swig_module.type_initial = swig_type_initial;
    swig_module.cast_initial = swig_cast_initial;
    swig_module.next = &swig_module;
    init = 1;
  } else {
    init = 0;
  }

  /* Try and load any already created modules */
  module_head = SWIG_GetModule(clientdata);
  if (!module_head) {
    /* This is the first module loaded for this interpreter */
    /* so set the swig module into the interpreter */
    SWIG_SetModule(clientdata, &swig_module);
    module_head = &swig_module;
  } else {
    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
    found=0;
    iter=module_head;
    do {
      if (iter==&swig_module) {
        found=1;
        break;
      }
      iter=iter->next;
    } while (iter!= module_head);

    /* if the is found in the list, then all is done and we may leave */
    if (found) return;
    /* otherwise we must add out module into the list */
    swig_module.next = module_head->next;
    module_head->next = &swig_module;
  }

  /* When multiple interpeters are used, a module could have already been initialized in
     a different interpreter, but not yet have a pointer in this interpreter.
     In this case, we do not want to continue adding types... everything should be
     set up already */
  if (init == 0) return;

  /* Now work on filling in swig_module.types */
#ifdef SWIGRUNTIME_DEBUG
  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
#endif
  for (i = 0; i < swig_module.size; ++i) {
    swig_type_info *type = 0;
    swig_type_info *ret;
    swig_cast_info *cast;
  
#ifdef SWIGRUNTIME_DEBUG
    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
#endif

    /* if there is another module already loaded */
    if (swig_module.next != &swig_module) {
      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
    }
    if (type) {
      /* Overwrite clientdata field */
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: found type %s\n", type->name);
#endif
      if (swig_module.type_initial[i]->clientdata) {
	type->clientdata = swig_module.type_initial[i]->clientdata;
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
#endif
      }
    } else {
      type = swig_module.type_initial[i];
    }

    /* Insert casting types */
    cast = swig_module.cast_initial[i];
    while (cast->type) {
    
      /* Don't need to add information already in the list */
      ret = 0;
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
#endif
      if (swig_module.next != &swig_module) {
        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
#ifdef SWIGRUNTIME_DEBUG
	if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
#endif
      }
      if (ret) {
	if (type == swig_module.type_initial[i]) {
#ifdef SWIGRUNTIME_DEBUG
	  printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
#endif
	  cast->type = ret;
	  ret = 0;
	} else {
	  /* Check for casting already in the list */
	  swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
#ifdef SWIGRUNTIME_DEBUG
	  if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
#endif
	  if (!ocast) ret = 0;
	}
      }

      if (!ret) {
#ifdef SWIGRUNTIME_DEBUG
	printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
#endif
        if (type->cast) {
          type->cast->prev = cast;
          cast->next = type->cast;
        }
        type->cast = cast;
      }
      cast++;
    }
    /* Set entry in modules->types array equal to the type */
    swig_module.types[i] = type;
  }
  swig_module.types[i] = 0;

#ifdef SWIGRUNTIME_DEBUG
  printf("**** SWIG_InitializeModule: Cast List ******\n");
  for (i = 0; i < swig_module.size; ++i) {
    int j = 0;
    swig_cast_info *cast = swig_module.cast_initial[i];
    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
    while (cast->type) {
      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
      cast++;
      ++j;
    }
  printf("---- Total casts: %d\n",j);
  }
  printf("**** SWIG_InitializeModule: Cast List ******\n");
#endif
}

/* This function will propagate the clientdata field of type to
* any new swig_type_info structures that have been added into the list
* of equivalent types.  It is like calling
* SWIG_TypeClientData(type, clientdata) a second time.
*/
SWIGRUNTIME void
SWIG_PropagateClientData(void) {
  size_t i;
  swig_cast_info *equiv;
  static int init_run = 0;

  if (init_run) return;
  init_run = 1;

  for (i = 0; i < swig_module.size; i++) {
    if (swig_module.types[i]->clientdata) {
      equiv = swig_module.types[i]->cast;
      while (equiv) {
        if (!equiv->converter) {
          if (equiv->type && !equiv->type->clientdata)
            SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
        }
        equiv = equiv->next;
      }
    }
  }
}

#ifdef __cplusplus
#if 0
{ /* c-mode */
#endif
}
#endif



/* Forward declaration of where the user's %init{} gets inserted */
void SWIG_init_user(lua_State* L );
    
#ifdef __cplusplus
extern "C" {
#endif
/* this is the initialization function
  added at the very end of the code
  the function is always called SWIG_init, but an eariler #define will rename it
*/
SWIGEXPORT int SWIG_init(lua_State* L)
{
  int i;
  /* start with global table */
  lua_pushvalue(L,LUA_GLOBALSINDEX);
  /* SWIG's internal initalisation */
  SWIG_InitializeModule((void*)L);
  SWIG_PropagateClientData();
  /* add a global fn */
  SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type);
  SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal);
  /* begin the module (its a table with the same name as the module) */
  SWIG_Lua_module_begin(L,SWIG_name);
  /* add commands/functions */
  for (i = 0; swig_commands[i].name; i++){
    SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func);
  }
  /* add variables */
  for (i = 0; swig_variables[i].name; i++){
    SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set);
  }
  /* set up base class pointers (the hierachy) */
  for (i = 0; swig_types[i]; i++){
    if (swig_types[i]->clientdata){
      SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata));
    }
  }
  /* additional registration structs & classes in lua */
  for (i = 0; swig_types[i]; i++){
    if (swig_types[i]->clientdata){
      SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata));
    }
  }
  /* constants */
  SWIG_Lua_InstallConstants(L,swig_constants);
  /* invoke user-specific initialization */
  SWIG_init_user(L);
  /* end module */
  lua_pop(L,1);  /* tidy stack (remove module table)*/
  lua_pop(L,1);  /* tidy stack (remove global table)*/
  return 1;
}

#ifdef __cplusplus
}
#endif


const char* SWIG_LUACODE=
  "";

void SWIG_init_user(lua_State* L)
{
  /* exec Lua code if applicable */
  SWIG_Lua_dostring(L,SWIG_LUACODE);
}

