util.h File Reference
#include <af/defines.h>

Go to the source code of this file.

Namespaces

 af
 

Macros

#define AF_PRINT1(exp)   af::print(#exp, exp);
 
#define AF_PRINT2(exp, precision)   af::print(#exp, exp, precision);
 
#define GET_PRINT_MACRO(_1, _2, NAME, ...)   NAME
 
#define af_print(...)   GET_PRINT_MACRO(__VA_ARGS__, AF_PRINT2, AF_PRINT1)(__VA_ARGS__)
 

Functions

AFAPI void print (const char *exp, const array &arr)
 
AFAPI void print (const char *exp, const array &arr, const int precision)
 
AFAPI int saveArray (const char *key, const array &arr, const char *filename, const bool append=false)
 
AFAPI array readArray (const char *filename, const unsigned index)
 
AFAPI array readArray (const char *filename, const char *key)
 
AFAPI int readArrayCheck (const char *filename, const char *key)
 When reading by key, it may be a good idea to run this function first to check for the key and then call the readArray using the index. More...
 
AFAPI void toString (char **output, const char *exp, const array &arr, const int precision=4, const bool transpose=true)
 
AFAPI const char * toString (const char *exp, const array &arr, const int precision=4, const bool transpose=true)
 
AFAPI array exampleFunction (const array &in, const af_someenum_t param)
 
AFAPI af_err af_print_array (af_array arr)
 
AFAPI af_err af_print_array_gen (const char *exp, const af_array arr, const int precision)
 
AFAPI af_err af_save_array (int *index, const char *key, const af_array arr, const char *filename, const bool append)
 
AFAPI af_err af_read_array_index (af_array *out, const char *filename, const unsigned index)
 
AFAPI af_err af_read_array_key (af_array *out, const char *filename, const char *key)
 
AFAPI af_err af_read_array_key_check (int *index, const char *filename, const char *key)
 When reading by key, it may be a good idea to run this function first to check for the key and then call the readArray using the index. More...
 
AFAPI af_err af_array_to_string (char **output, const char *exp, const af_array arr, const int precision, const bool transpose)
 
AFAPI af_err af_example_function (af_array *out, const af_array in, const af_someenum_t param)
 
AFAPI af_err af_get_version (int *major, int *minor, int *patch)
 Get the version information of the library. More...
 
AFAPI const char * af_get_revision ()
 Get the revision (commit) information of the library. More...
 

Macro Definition Documentation

#define AF_PRINT1 (   exp)    af::print(#exp, exp);
#define AF_PRINT2 (   exp,
  precision 
)    af::print(#exp, exp, precision);
#define GET_PRINT_MACRO (   _1,
  _2,
  NAME,
  ... 
)    NAME

Function Documentation

AFAPI af_err af_example_function ( af_array out,
const af_array  in,
const af_someenum_t  param 
)
AFAPI const char* af_get_revision ( )

Get the revision (commit) information of the library.

This returns a constant string from compile time and should not be freed by the user.

AFAPI af_err af_get_version ( int *  major,
int *  minor,
int *  patch 
)

Get the version information of the library.