195 questions
1
vote
1
answer
62
views
Does ArrayFire have a popcount or bitcount function?
I am trying to move away from OpenCL and CUDA into ArrayFire. One of my functions uses the GPU's popcount() to make pre-processing data easier. But I can't find it anywhere in the list of functions in ...
2
votes
1
answer
192
views
Arrayfire build has issue with OpenCL turned OFF
I'm getting an error with building arrayfire.
I wish to use Arrayfire purely with CUDA, yet the arrayfire build seems to require OpenCL, despite me setting the flag for OpenCL not to be built.
Build ...
1
vote
1
answer
247
views
Arrayfire CPP with CUDA "failed to open libnvrtc-builtins.so.12.2"
For some reason arrayfire isn't working with my nvidia GPU. I'm trying to do this with cmake.
I have the cuda toolkit correctly installed, and followed the linux linux install instructions found here ...
1
vote
0
answers
46
views
Failure to install "RcppArrayFire" package in R because of "This package has a configure script, It probably needs manual configuration..."
I'm trying to install the package "RcppArrayFire" in R v4.3.2.
After having gone round in circles following multiple attempts at various possible ways of installing a package in R, I'm ...
0
votes
0
answers
9
views
Column chaotic reorder in ArrayFire using other than CPU backends
I have multiple arrays as separate fields, when I join them together, somehow an specific column gets switched with another column strangely.
All columns have proper data on their own, but shuffled ...
0
votes
0
answers
6
views
Column chaotic reorder in ArrayFire using CUDA or OpenCL backend
I have multiple arrays as separate fields, when I join them together, somehow an specific column gets switched with another column strangely.
All columns have proper data on their own, but shuffled ...
2
votes
2
answers
102
views
Making masks based on euclidean distance with pyopencl, arrayfire or another python opencl library
I am doing 2D or 3D binary masks around given coordinates and then identifying them as labels with scipy.ndimage.label.
Now, I have a cupy solution, a numpy solution. Cupy is fast, numpy is very slow, ...
1
vote
0
answers
176
views
Difficulties in installing ArrayFire
I installed the RcppArrayFire R package ( via https://github.com/daqana/rcpparrayfire ) and I am trying to run the following simple example:
#include <RcppArrayFire.h>
// [[Rcpp::depends(...
0
votes
0
answers
43
views
Issues installing RcppArrayFire on Linux [duplicate]
I am trying to install the C++ library ArrayFire: https://arrayfire.com/
There is an R package for doing this: https://github.com/daqana/rcpparrayfire
However, I follow the instructions and install ...
1
vote
1
answer
160
views
How to convert between C++ ArrayFire and C++ Eigen matrices?
I am new to Eigen and looking to learn ArrayFire for GPU acceleration. I would like to implement ArrayFire within my existing Eigen code rather than having to re-code all of my functions.
Is there a ...
1
vote
1
answer
53
views
How to use ArrayFire's Forge visualization in custom area within existing Qt window or DC (Device Context) instead of separate window?
In real world applications we don't want to use a separate window for some plot, is there a way to use a control's DC or a way to use Qt QML as render target for the ArrayFire's Forge library?
1
vote
0
answers
86
views
Why do I get linker errors when building ArrayFire examples
I am using the ArrayFire binaries provided by my Linux distro (Artix Linux, i.e. Arch Linux without Systemd). I want to build the examples, and I get linker errors.
The library is installed here:
> ...
1
vote
0
answers
100
views
ArrayFire: Why doesn't convolution followed by deconvolution return the original image (not even close)
I'm trying to perform a convolution and deconvolution using ArrayFire in C++ for an image deblurring application. For testing purposes I have a 5x5 image and a 3x3 kernel. I convolve the image using ...
1
vote
0
answers
68
views
Matlab mldivide and arrayfire solve
I am trying to port some Matlab code to c++ using arrayfire. In one place the Matlab code is like:
tmp = (R\v0);
where R is a 9x9 complex double and v0 is a 9x1 complex double.
in my arrayfire the ...
3
votes
1
answer
178
views
Arrayfire C++ sparse matrix multiplication causes access violation
I am trying to work with sparse matrices in arrayfire but I am getting an access violation somewhere inside array fire dll. I used several examples but always with the same result. I can see the error ...
1
vote
1
answer
168
views
How to use ArrayFire batched 2D convolution
Reading through ArrayFire documentation, I noticed that the library supports batched operations when using 2D convolution. Therefore, I need to apply N filters to an image using the C++ API.
For easy ...
1
vote
0
answers
202
views
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 ...
3
votes
1
answer
124
views
Is it possible to access arrayfire's data memory using CPU backend without data copy?
I wanna use arrayfire in CPU mode (mkl) only to be able to access data without transmission, as it may happen for GPU data.
Is there a way to have direct access to arrayfire's data memory (only CPU ...
1
vote
0
answers
421
views
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 ...
0
votes
1
answer
2k
views
Access the value of an enum variant
I am working on some language bindings to Arrayfire using the arrayfire-rust crate.
Arrayfire has a typed struct Array<T> which represents a matrix. All acceptable types implement the HasAfEnum ...
1
vote
1
answer
131
views
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 ...
1
vote
0
answers
75
views
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 ...
1
vote
0
answers
240
views
Multithreaded fft convolution in arrayfire
I am trying to parallelize fft convolution in arrayfire over multiple CPU threads:
#include <arrayfire.h>
#include <iostream>
#include <omp.h>
using namespace af;
void printarray(...
1
vote
1
answer
129
views
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 ...
1
vote
0
answers
135
views
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 ...
1
vote
2
answers
214
views
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
votes
1
answer
1k
views
Adam Optimizer is apparently not converging
I am trying to write a neural network in rust + arrayfire, and while gradient descent works, ADAM does not.
fn back_propagate(
&mut self,
signals: &Vec<Array<f32>>,
...
1
vote
0
answers
45
views
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 ...
0
votes
1
answer
108
views
Optimize member function selection at runtime on CPU/GPU
I have the following piece of code that needs to optimized (and be later ported to the GPU through SYCL or ArrayFire):
struct Item {
float value;
int f;
float Func(float);
float Func1(...
1
vote
0
answers
41
views
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 <arrayfire.h>
// create sparse array from dense ...
1
vote
0
answers
67
views
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 ...
3
votes
1
answer
354
views
How can I have the pixel coordinate X,Y after ArrayFire match_template?
I'm trying to use the matching_template function from the ArrayFire library But I don't know how to find the X and Y coordinates of the best matching value.
I was using the imageproc library to ...
1
vote
0
answers
113
views
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 ...
1
vote
1
answer
302
views
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(...
1
vote
0
answers
294
views
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:
...
0
votes
1
answer
603
views
Cannot disable CUDA build and the process stops
Trying to build ArrayFire examples, everything goes well until I get to the CUDA ones. They are supposed to be skipped, since I have an AMD processor/GPU. However, during the build process, the CUDA ...
1
vote
0
answers
59
views
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 << "...
1
vote
0
answers
102
views
ArrayFire OpenCL Issue
I have installed ArrayFire 3.8.0 using the binary installer as per the instructions mentioned in the documentation. All dependencies were installed before installing it. NVIDIA CUDA Toolkit 11.3 is ...
1
vote
0
answers
139
views
ArrayFire Matrix Multiplication Vectorization
I am using ArrayFire library for signal processing. I am just curious about how to make more efficient my code. I read vectorization guide in docs, but i just ended up using gfor construct. Is it ...
1
vote
1
answer
123
views
ArrayFire's matrix multiplication with integer inputs
I want to perform matrix by vector multiplication but on arrays with integer types to avoid extra conversion (it works fine when both sides are of type f32);
Such operation throws bad type exception ...
2
votes
0
answers
86
views
ArrayFire convolution issue with Cuda backend
I've been having an issue with a certain function call in the
dphaseWeighted = af::convolve(dphaseWeighted, m_slowTimeFilter);
which seem to produce nothing but nan's.
The back ground is we have ...
1
vote
1
answer
150
views
Arrayfire python rowwise addition and multiplication
I'm trying to learn the Arrayfire idioms by translating some vectorised numpy code.
For example, this is valid rowwise addition and multiplication in numpy,
>>> a = np.array([1,2,3])
>>&...
1
vote
1
answer
582
views
Cast ArrayFire Array Data from f64 to f32 in C++
I have an ArrayFire array of dtype=f64 that I need to cast to dtype=f32. I'm not sure how to do this other than converting to a host array and iterating through doing a static_cast. I'm sure there is ...
1
vote
1
answer
19
views
"afcl" namespace missing in ArrayFire 3.7.2
In the official docs there are functions like afcl::getContext. But when I #include <arrayfire.h>, I don't get access to any afcl namespace. How do I access such functions?
1
vote
1
answer
126
views
How do I convert ArrayFire Image to Julia Image?
I want to use the plotting functionality of Plots.jl with an image loaded using the load_image() function of ArrayFire.
What I have is :
AFArray: 1000×300×3 Array{Float32,3}
What I want is :
300×1000 ...
0
votes
0
answers
75
views
How to address not a full span of ArrayFire within gFor
If I use A(i, span) = A(i, span) + 1; within gfor it works.
But what if I want to use a limited range instead of a full span of a dimension:
gfor(seq i, A.elements()) {
A(i, span) = A(i, span) + ...
1
vote
0
answers
67
views
How to correctly perform atomic operations with ArrayFire?
How can I perform atomic operations like atomicCAS with ArrayFire to avoid locking?
(that is the same across all backends)
1
vote
1
answer
103
views
ArrayFire array calculated data differs over executions although usage of sync and eval methods
I want to convert text data into corresponding values (vectorized), but final data is not filled all the time, it seems that if there is some latency it has time to fill the result array otherwise it ...
1
vote
1
answer
245
views
Set a index value with Arrayfire
I am trying to modify a value in an existing Arrayfire Matrix with a custom value. Below is an example of changing several rows and columns to a specified value (1.0) However I am struggling no doing ...
1
vote
0
answers
80
views
Rust Arrayfire Closure multiplication
I am attempting to multiply an arrayfire Matrix by a matrix of closures. Is there anyway to achieve this without using for loops?
My current code is as follows:
//Initialize the closures and assign to ...