#include <math.h>
#include <cstdio>
static const int ITERATIONS = 200;
static const float PRECISION = 1.0f / ITERATIONS;
int main(int, char**) {
try {
af::Window myWindow(800, 800,
"3D Line Plot example: ArrayFire");
static float t = 0.1;
array Z = seq(0.1f, 10.f, PRECISION);
do {
t += 0.01;
}
while (!myWindow.
close());
fprintf(stderr,
"%s\n", e.
what());
throw;
}
return 0;
}
Window object to render af::arrays.
An ArrayFire exception class.
virtual const char * what() const
Returns an error message for the exception in a string format.
AFAPI array cos(const array &in)
C++ Interface for cos.
AFAPI array sin(const array &in)
C++ Interface for sin.
void plot(const array &in, const char *const title=NULL)
Renders the input arrays as a 2D or 3D plot to the window.
bool close()
Check if window is marked for close.
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 array max(const array &in, const int dim=-1)
C++ Interface for maximum values in an array.
AFAPI array min(const array &in, const int dim=-1)
C++ Interface for minimum values in an array.