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
2
votes
1 answer

ArrayFire parallel block sum

What I want to do is this: I am having an "expanded" array in the first (rows) dimension. For example, I have an image of 1080 rows and 1920 columns. This expanded array is (8*1080) rows and 1920 columns, 8 means "row block" size. What I want to do…
eikonoules
  • 53
  • 3
2
votes
1 answer

Correct way to write and call custom C functions of ArrayFire in Julia

I'm working in Julia and I need call some customize C functions that use ArraFire library, when I use a code like: void copy(const af::array &A, af::array &B,size_t length) { // 2.Obtain the device, context, and queue used by ArrayFire …
4lrdyD
  • 433
  • 2
  • 10
2
votes
1 answer

ArrayFire CUDA application is extremely slow in the first minute

I am writing a test program using ArrayFire running on windows 10 + Nvidia Gtx 970. The program is to train a neural network with SGD solver. Thus the main computation is the iteration to update network parameters. The iteration is in a function…
Bo Tian
  • 277
  • 2
  • 6
2
votes
0 answers

Did I test the ArrayFire performance incorrectly?

I cannot figure out what's wrong. I mean, the speed is way too fast, like 1 million items vs 10 million items basically have the same 0.0005 second computation on my machine. So fast, it looks like it wasn't doing anything. But the result of the…
BoBoDev
  • 847
  • 1
  • 8
  • 17
2
votes
1 answer

Arrayfire sparse matrix issues

Getting confused with something that should be simple. Spent a bit of time trying to debug this and am not getting too far. Would appreciate if someone could help me out. I am trying to define a sparse matrix in arrayfire by specifying the…
stantheman
  • 195
  • 8
2
votes
0 answers

ArrayFire af::Max did not ignore NAN values when using 2D array

Does anyone knows why it is returning NAN values when I use ArrayFire af::Max on 2D array? This is ok when I am doing it on a 1D array, but, when I wanted to do it on a 2D array, it doesn't work, but, the documentation says NAN values are ignored.…
BoBoDev
  • 847
  • 1
  • 8
  • 17
2
votes
1 answer

Using OpenGL from ArrayFire

If I have an af::array A already in GPU memory, what is the procedure to pass it through to OpenGl? My intention is to plot it as a line graph using OpenGl, but I'm not sure how to deal with the fact that the backend of Arrayfire could be OpenCl,…
HamzaAB
  • 67
  • 6
2
votes
1 answer

Multiple host threads with ArrayFire

I have a newbie question about using multiple host threads with ArrayFire for Python. We currently have a highly parallel CPU-only code, parallelized using Open MPI and mpi4py. Each CPU thread performs large matrix multiplications, often with…
srcerer
  • 1,068
  • 10
  • 19
2
votes
1 answer

The best way to write code in Julia working on GPU's via ArrayFire

In Julia, I saw principally that to acelerate and optimizing codes when I work on a matrix, es better e.g. -work by columns instead of by rows, this is for the way which Julia store the matrix. -On loops could use @inbounds and @simd macros -any…
4lrdyD
  • 433
  • 2
  • 10
2
votes
0 answers

ArrayFire Segmented Scan / Scatter

I am trying to achieve the following in ArrayFire: Inputs: Indices: [ 0, 0, 1, 1, 1, 2, 2] Values : [1.0, 2.0, 3.0, 1.0, 2.0, 3.0, 5.0] Output: Result: [1.0 + 2.0, 3.0 + 1.0 + 2.0, 3.0 + 5.0] = [3.0, 6.0, 8.0] So element i in the…
Jon Moore
  • 61
  • 3
2
votes
0 answers

Arrayfire vs OpenCV performance

I'm developing a "performance critical" image processing program on a Jetson TX1 device, and until this time I used OpenCV, but now I decided to switch to Arrayfire for some speedup. However, it seems to be much slower now. Basically, I had two…
zerge
  • 47
  • 10
2
votes
1 answer

ArrayFile GFor not working

I'm try to run a gfor loop but this only run once... Someone can help me? gfor(seq j, gammaStep-1){ vector vals; countLoop = (int) sqc(j).scalar(); double localGamma = (countLoop+1)*incGamma; vector rbfs =…
2
votes
1 answer

Acessing a value on an ArrayFire array

I had a af::array and need to acess the value in a row, like z(8), e.g. But, when i try to do this, in a loop with a incremental i, the compiler returns cannot convert from 'af::array::array_proxy' to 'double' Someone knows how can I acess the…
2
votes
0 answers

TIFF files garbled by ArrayFire (C++)

I notice that this simple ArrayFire program is causing loaded TIFF images to be heavily distorted: #include #include int main( int argc, char** argv ) { af::array img = af::loadImage( argv[1] ); double mn, mx; …
sid
  • 131
  • 3
2
votes
2 answers

Possible workarounds for vector cross product with Arrayfire.jl?

I'm trying to do vector math using ArrayFire.jl but the function for vector cross product is not implemented in Arrayfire. Is there a workaround for calculating it using Julia's Arrayfire.jl wrapper in a performant way? Defining the function in a…
Boxed
  • 168
  • 1
  • 5
1 2
3
12 13