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

Change ArrayFire array at Index Array with repeating indexes

Is there a Way to Change an Array multiple times at the same Position? When I do this: float a[] = { 0.1, 0.2, 0.3, 0.4, 0.5, 0.6 }; array A(6, a, afHost); af_print(A); float i[] = { 0, 1, 2, 2}; array I(4, i, afHost); A(I) +=…
Imma
  • 21
  • 5
1
vote
0 answers

Importing ArrayFire Causes Hang When Complete

I'm not sure if this is an Anaconda, Arrayfire, or Windows issue, but importing Arrayfire into a script seems to be causing the script to hang when complete. I'm using Anaconda as my python environment on Windows 7 Python 2.7.14 |Anaconda,…
nanoPhD
  • 400
  • 4
  • 16
1
vote
1 answer

row/column-wise outer product in arrayfire-python

How to implement row/column-wise outer product in arrayfire-python? Here is analogical implementation in numpy. A = np.random.randint(1,7, size=(3,2)) B = np.random.randint(1,7, size=(2,3)) X = np.einsum('ik,kj->kij', A,B) X array([[[ 8, 16, 12], …
1
vote
0 answers

Forcing ArrayFire to switch backends in Python

I have been attempting to force ArrayFire to use its CPU backend, rather than the default CUDA backend. According to this documentation page, you only need to call arrayfire.set_backend('cpu'). However, when I attempt to do this, an error is thrown…
TimD1
  • 982
  • 15
  • 26
1
vote
2 answers

ArrayFire seq to int c++

Imagine a gfor with a seq j... If I need to use the value of the instance j as a index, who can I do that? something like: vector a(n); gfor(seq j, n){ //Do some calculation and save this on someValue a[j] = someValue; } Someone can…
1
vote
0 answers

Vectorized LUT classification using ArrayFire

Is there a way to write a vectorized table lookup using ArrayFire? I'm trying to implement a binary 2D pixel classifier using a 255x255 lookup table. This table contains the 2 channels value combinations [0,255] which should be classified:…
1
vote
1 answer

Arrayfire Supported Image Formats

I want to start a little project to identify duplicate images on my hard disk - mainly to try out GPU and Swift. I was looking at Arrayfire and was wondering if it actually is capable of loading RAW images. I read the docu and saw it uses FreeImage…
mercator
  • 99
  • 1
  • 10
1
vote
0 answers

Arrayfire - rendering a heatmap as an image/array with the available colormaps

I'm using Arrayfire to make a 2D heat transfer simulation. My dataset is a matrix of temperatures and I want to vizualize it as a heatmap. I need to produce frames of the colored dataset and save it as an image on the disk. So each temperature in my…
1
vote
0 answers

arrayfire SVD jobu and jobvt parameters

The svd and svdInPlace functions provided by Arrayfire are hard-wired to use 'A' as the parameter for jobu and jobvt. Is there a way to use 'S' for this parameter instead? I need to compute the SVD of an extremely tall but narrow matrix, and I only…
user2297560
  • 2,953
  • 1
  • 14
  • 11
1
vote
1 answer

Faster exponentiation of complex arrays in Python using Arrayfire

According to the arrayfire pow documentation, af.pow() currently only supports powers (and roots...) of real arrays. No error is thrown, but I found that using af.pow() with complex input can cause a huge memory leak, especially if other functions…
user6565699
1
vote
0 answers

Array Conditional Filtering (ArrayFire)

I have two arrays A (2D image) and B (1d intensity values) and trying to make third one (2D) with will be size of A but contain only values of A that B has. What will be the the right way to do that without moving data to the host? PS: Trying to…
Grammer
  • 321
  • 1
  • 4
  • 14
1
vote
1 answer

Is it possible to run piece of pure C++ code in GPU

I don't know OpenCL very much but I know C/C++ API requires programmer to provide OpenCL code as a string. But lately I discovered ArrayFire library that doesn't require string-code to invoke some calculations. I wondered how is it working (it is…
Mariusz Jaskółka
  • 4,137
  • 2
  • 21
  • 47
1
vote
1 answer

Does array fire constructor automatically deduce type when constructing from host pointer?

I read from the documentation of array fire that one can construct an array fire array from host pointer. Something like double * host_data; //do stuff with host_data af::array array(nrows, ncols, host_data); //suppose is a nrows by ncols…
Ran Wang
  • 303
  • 1
  • 3
  • 9
1
vote
2 answers

Multiplying a vector component with an array in ArrayFire

I'm getting an error while trying to multiply a vector component with an array (element-wise multiplication or broadcast). The docs show that this overloaded case for * should be fine: AFAPI array operator* (const float &lhs, const array &rhs) …
Bruce Dean
  • 2,798
  • 2
  • 18
  • 30
1
vote
0 answers

Syntax of ArrayFire for C++ (multiplying array by scalar)

I have gone through the documentation and looked at examples, but I am having trouble understanding the syntax of "operator(star)". For example, if I have an array called "array1", and I want to multiply it by a value, 3, how would I incorporate…
AaronJPung
  • 1,105
  • 1
  • 19
  • 35