#include <cstdio>
#include <cstdlib>
int main(int argc, char* argv[]) {
try {
int device = argc > 1 ? atoi(argv[1]) : 0;
float h_buffer[] = {1, 4, 2, 5, 3, 6};
array in(2, 3, h_buffer);
fprintf(stderr,
"%s\n", e.
what());
throw;
}
return 0;
}
An ArrayFire exception class.
virtual const char * what() const
Returns an error message for the exception in a string format.
AFAPI array matmul(const array &lhs, const array &rhs, const matProp optLhs=AF_MAT_NONE, const matProp optRhs=AF_MAT_NONE)
Matrix multiply of two arrays.
AFAPI array diag(const array &in, const int num=0, const bool extract=true)
AFAPI void setDevice(const int device)
Sets the current device.
AFAPI void svd(array &u, array &s, array &vt, const array &in)
C++ Interface for SVD decomposition.
static af::array array(af::dim4 idims, cl_mem buf, af::dtype type, bool retain=false)
Create an af::array object from an OpenCL cl_mem buffer.
AFAPI seq span
A special value representing the entire axis of an af::array.