I recently saw arrayfire demonstrated at GTC and I thought I would try it. Here are some questions I have run into while trying to use it. I am running Visual Studio 2013 on a Windows 7 system with OpenCL from the AMD App SDK 2.9-1.
The biggest frustration is that I cannot view the state of array objects in the debugger to see what data is in it. I must rely on the af_print statement. That is very annoying. Is there any way to configure the debugger to let me see the data in the array without having to print it out?
Once I have my data in an array, how do I get back values as standard data types. An example is shown below. I am trying to get back element 5,0 as a double. The line in the example does not work, and I cannot cast it to any standard type. The only thing I can assign it to is another array. How do I get my data back out?
array test = constant(0, dim4(10, 2));
test(span, 1) = 10.5;
double val = test(5, 0); //This does not compile.
Is there an easy way to serialize/deserialize an array to disk? I did not see a way to do this, and since I cannot get the values back out as standard types I am unsure how to save it out.
I was going through the rainfall tutorial sample you provide, but it appears to give incorrect results. For instance, line 52 has this print statement "af_print(rainfall);." It is supposed to print out the rainfall per site, but it has all 8's in it, which is not correct. I tried this with both the cpu and opencl versions and got the same results. A few of the other calculations are incorrect as well. The code looks like it be should be correct, so is this a bug or is the code wrong?