Questions tagged [arrayfire]

ArrayFire is a software library that simplifies GPU computing.

From the github page:

ArrayFire is a high performance software library for parallel computing with an easy-to-use API. Its array based function set makes parallel programming simple.

ArrayFire's multiple backends (CUDA, OpenCL and native CPU) make it platform independent and highly portable.

A few lines of code in ArrayFire can replace dozens of lines of parallel computing code, saving you valuable time and lowering development costs.

Useful Links:

182 questions
1
vote
0 answers

ArrayFire.jl performance slowly degrades over time

So I'm trying to use ArrayFire in Julia, and I find that the performance bizarrely degrades over time: using ArrayFire srand(1) function f() r = AFArray(zeros(Float32, 100, 100000)) a = AFArray(rand(Float32, 100, 100000)) for d in…
Set
  • 934
  • 6
  • 25
1
vote
2 answers

ArrayFire AF_BACKEND_CPU not multi-threaded?

I usually use the OpenCL backend when I use ArrayFire. I was using Intel OpenCL on my i7 CPU. When I switched to the AF_BACKEND_CPU backend my code was about 10-15x slower. I checked and noticed that it was only running on one core. I also…
chasep255
  • 11,745
  • 8
  • 58
  • 115
1
vote
1 answer

Add a vector to all columns of a matrix with ArrayFire

What is the best way to add a vector to all columns of a Matrix with ArrayFire? At the moment i'm using a gfor loop, but that seems wrong for such a simple task. gfor(af::seq i, M.dims(1)) { M(af::span, i) += VECTOR; } Is there a better way?
MaPePeR
  • 931
  • 9
  • 18
1
vote
1 answer

Initializing 2D arrays as a function of their indices

I can't quite figure out how to initialize a, say 101 x 101 f32 array with the value, say, sin ((xindex-50)*(xindex-50) + (yindex-50*yindex-50)). I could do array x(seq(-50,50), 101); // get one of the indices array pic(101, 101); //…
Walt Donovan
  • 357
  • 1
  • 10
1
vote
0 answers

ArrayFire Memcpy

I have a question related with the ArrayFire library and the use of memory. I implemented some program in plain CUDA/C , and the same programm using ArrayFire, and the CUDA/C program is much faster ( like 5 times faster than the ArrayFire one). I…
RolandDeschain
  • 483
  • 1
  • 4
  • 17
1
vote
0 answers

GFor ArrayFire, how to "index"

Grettings, i'm starting to learn about arrayfire and parallel computing and have a question about Gfors and the seq method. The syntax for the Gfor is something like Gfor( seq ii, N) In a regular for loop, there is (usually) a int value , so…
RolandDeschain
  • 483
  • 1
  • 4
  • 17
1
vote
1 answer

Double Dot product in Arrayfire

I want to compute double dot product in Arrayfire. is there any function in arrayfire to use for double dot product. This is my tensor, that I wish to impelment: AA:(E_iE_i - c^2I) where, A--> 2D-array ; E_i --> 1D array (defined as col. vec in…
TheCoder
  • 55
  • 1
  • 8
1
vote
1 answer

undeclared identifier using arrayfire

I write a function using arrayfire like that: int ABC() { static const int Q = 5; double A[] = { 0.0, 1.0, 0.0, 1.0, 1.0}; double B[] = { 0.0, -1.0, -1.0, 1.0, 0.0 }; array C (Q, 1, A); array D (Q, 1, B); return 0; } When I try to call this…
TheCoder
  • 55
  • 1
  • 8
1
vote
1 answer

Using ArrayFire libraries

I downloaded the free version of ArrayFire library. I tried to test matrix multiplication with it. However I got a bunch of undefined references such as matrixdata.cpp:(.text+0x19e5): undefined reference to af::array::array(int,…
KVP_
  • 15
  • 5
1
vote
2 answers

Exception Ljava/lang/UnsatisfiedLinkError

I am currently trying to build and run this project: https://github.com/arrayfire/androidcl on the AT&T Samsung Galaxy S3. The problem is when I try running: ./ndk-build -C ~/Desktop/ArrayFire/androidcl/jni Then I try to run it on the phone by…
LeggoMaEggo
  • 512
  • 1
  • 9
  • 24
1
vote
1 answer

Can't run ArrayFire helloworld example under OS X 10.9

I downloaded and installed the following packages under MAC OS X 10.9: ArrayFire-maci-1.9-20121120.zip cuda-mac-5.5.28_10.9_64.pkg After successful building the helloworld example I get the following output: c++ -m64 -Wall -Werror…
1
vote
1 answer

Copy complex numbers from host to device using ArrayFire

I am trying to copy complex number array from host to device using ArrayFire framework: std::complex hostArray[131072]; array deviceArray (131072, hostArray); But it gives compilation error due to data type incompatibilities. What am I…
uahakan
  • 576
  • 1
  • 6
  • 23
1
vote
0 answers

Bunch of cuComplex.h and cmath errors

I am trying to compile my code in VSC++ using arrayfire for porting the matrix multiplication to gpu. I am getting the following bunch of errors for all the source files. What's happening! I am pretty sure it's a silly mistake but please be kind…
neonano
  • 31
  • 1
  • 1
  • 7
1
vote
1 answer

Demoting to float2 when using seq with double2 arrays in ArrayFire

I'm using the following test code exploiting the ArrayFire library. void test_seq(const array& input, array& output, const int N) { array test = seq(0,N-1); output = input; } (for the…
Vitality
  • 20,705
  • 4
  • 108
  • 146
1
vote
1 answer

Pass unmanaged data around in managed code?

I'm building a Windows Form application that controls 3D volume rendering using an ArrayFire array object. The array is unmanaged. In the form constructor, I load and render the volume. I have a Trackbar that controls the opacity of the volume and…
Tianxiang Xiong
  • 3,887
  • 9
  • 44
  • 63