#include <stdio.h>
#include <cstdlib>
int main(int argc, char ** argv)
{
try {
int device = argc > 1 ? atoi(argv[1]) : 0;
printf("\n=== ArrayFire signed(s32) / unsigned(u32) Integer Example ===\n");
int h_A[] = {1, 2, 4, -1, 2, 0, 4, 2, 3};
int h_B[] = {2, 3, -5, 6, 0, 10, -12, 0, 1};
printf("--\nSub-refencing and Sub-assignment\n");
A(0) = 11;
A(1) = 100;
printf("--Bit-wise operations\n");
printf("\n--Logical operations\n");
printf("\n--Transpose\n");
printf("\n--Flip Vertically / Horizontally\n");
printf("\n--Sum along columns\n");
printf("\n--Product along columns\n");
printf("\n--Minimum along columns\n");
printf("\n--Maximum along columns\n");
printf("\n--Minimum along columns with index\n");
fprintf(stderr,
"%s\n", e.
what());
throw;
}
return 0;
}
A multi dimensional data container.
Definition: array.h:27
Definition: exception.h:20
virtual const char * what() const
Definition: exception.h:34
array::array_proxy col(int index)
Returns a reference to a col.
array::array_proxy row(int index)
Returns a reference to a row.
AFAPI void setDevice(const int device)
Sets the current device.
AFAPI array flip(const array &in, const unsigned dim)
array T() const
Get the transposed the array.
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.
AFAPI array product(const array &in, const int dim=-1)
C++ Interface for product of elements in an array.
AFAPI array sum(const array &in, const int dim=-1)
C++ Interface for sum of elements in an array.
Definition: algorithm.h:15
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.
Definition: opencl.h:329
#define af_print(...)
Definition: util.h:141