Do more. Code less. Free software for GPU computing.
<scroll to top>
Functions

Allocate and free memory

Basics

Functions

template<typename T >
static T * alloc (size_t elements)
 Allocate an array of elements (see free()).
static void free (void *)
 Free data allocated by alloc()

Function Documentation

static T* alloc ( size_t  elements) [static, inherited]

Allocate an array of elements (see free()).

These can later be linked to array objects:

       float *dev = array::alloc<float>(10); // actually 4*10=40 bytes
       array X = array(dev, 10, afDevicePointer);
       print(X); // print (uninitialized) values
static void free ( void *  ) [static, inherited]

Free data allocated by alloc()

Examples:
examples/misc/any.cpp.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines