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

Rust Arrayfire - Using an array to index into another array

For the last three days I've been trying to implement a loss function (cross entropy) in my machine learning project following the book "Neural Networks from Scratch by Harrison Kinsley". So far I got an array with class predictions from a softmax…
1
vote
0 answers

C++ program crash with no error message only when using a particular library of ArrayFire

I am trying to use the ArrayFire library, everything is working perfectly (see the working example above), but I have a problem only when using a particular library af.lib. The problem is that when my program crashes, I have no message error and the…
Balfar
  • 125
  • 7
1
vote
1 answer

Detecting R Version in Rcpp/arrayfire in makevars

I am new to building R packages so I need some help :) I am using Rcpp/arrayfire and want a line in my makevars file to detect the users R version. Currently I have it set in 4.0, but I anticipate users having different R versions. If this question…
owalt
  • 13
  • 2
1
vote
0 answers

Is it possible to mix CPU and GPU computations with ArrayFire?

I have to solve a mathematical problem which can be either dense or sparse for different time values. I would like to use the GPU for the first and the CPU for the second (assuming the switch does not occur too often to make the process…
Pietro
  • 12,086
  • 26
  • 100
  • 193
1
vote
0 answers

Multithreaded fft convolution in arrayfire

I am trying to parallelize fft convolution in arrayfire over multiple CPU threads: #include #include #include using namespace af; void printarray(const std::vector& f, size_t N=10) { const size_t…
phinz
  • 1,225
  • 10
  • 21
1
vote
1 answer

Retrieve multiple ArrayFire subarrays from min/max data points

I have an array with sections of touching values in it. For example: 0 0 1 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0…
AAG
  • 235
  • 1
  • 11
1
vote
0 answers

ArrayFire (C++): 'gfor' dim_t parameter variation within loops / PARTIAL unwrap() function

many thanks in advance if anyone is able to help me solve this issue. I have recently started using the ArrayFire C++ Matrix library and have found it to be fantastic, however I have hit a problem I am unable to solve with the Documentation and/or…
Jack Wells
  • 11
  • 3
1
vote
2 answers

How can I implement Max Pooling in Arrayfire in rust without resorting to writing my own cuda code

I'm trying to figure out how to implement max pooling on Arrayfire. My current best approach involves iterating over each convolved output and apply a function which applies four kernels, [1 0 0 0], [0 1 0 0], [0 0 1 0], [0 0 0 1], and produces four…
1
vote
0 answers

ArrayFire: Translate a batch of images at the same time

I'm using arrayfire and I need to translate a lot of images at once and store it in a new array. The images are contained in a single array of size (w, h, c, b) and the amount by which each image needs to be translated is inside a (2, 1, 1, b)…
Samuel
  • 378
  • 1
  • 9
1
vote
0 answers

How to free a sparse array?

I'm wondering why arrayfire seems to not free the memory in this example, and how to free memory from a sparse array. Thanks! // sparse.c #include // create sparse array from dense identity array //! af_release_array of sparse array…
Alex Shroyer
  • 3,499
  • 2
  • 28
  • 54
1
vote
0 answers

Non-blocking data transfer between device and host in ArrayFire

Is it possible to use non-blocking data transfer between host and device in ArrayFire? Indeed, because of some issues, I want to keep parts of my code in naive C++. So, I want to hide part of the computation behind the data transfer required in the…
martin
  • 11
  • 3
1
vote
0 answers

Using ArrayFire and Boost Compute in single code

I am trying to run a code which uses functions from both boost compute library and arrayfire library. I am getting the following errors when I try to build the code: Scanning dependencies of target hello [ 50%] Building CXX object…
1
vote
1 answer

Dispose and delete of arrayfire variables,

I have a af::array variable which is 3000000*3: int main() { // inputArray is the pointer which fills tempArray af::array tempArray = af::array(af::dim4(3000000,3),inputArray); tempArray(tempArray < 0) = 0; } the problem is that, I…
1
vote
0 answers

Can run ArrayFire on my CPU only, not on the intergrated GPU

I could build all the examples of the ArrayFire project (except the CUDA ones, having an AMD APU). However, just the ones running on the CPU work correctly; the GPU based ones have issues. Example: benchmarks> ls CMakeFiles blas_cpu cg_cpu …
Pietro
  • 12,086
  • 26
  • 100
  • 193
1
vote
0 answers

ArrayFire af::where time consumption

I have an af::array for which i want to find the non zero location (2048*2048). af::timer start1 = af::timer::start(); af::array index = af::where(mat); // for the first time cout << "elapsed time (ms): " << af::timer::stop(start1)*1000 <<"…
Avinash
  • 11
  • 1