int device = argc > 1 ? atoi(argv[1]) : 0;
af::setDevice(device);
af::info();
af::array afaJp = af::randu (8, 9216, f32);
af::array afaFp = af::randu (9216, 1, f32);
float afResults0[8*9216];
afaJp.host(afResults0);
float afResults1[9216];
afaFp.host(afResults1);
af::array twoMul = af::matmul(afaJp, afaFp);
float afResults2[8];
twoMul.host(afResults2);
float check = 0.0f;
for (int i = 0; i < 9216; i++)
{
//check += Jp.at<float>(0,i)*Fp.at<float>(i,0);
check += afResults0[i]*afResults1[i];
}
std::cout << "arrayfire result: " << afResults2[0] << " and CPU result is " << check << std::endl;
and the print out info are as below:
WARNING: af_set_device not supported for CPU
ArrayFire v3.1.3 (CPU, 64-bit Windows, build 35c89f5)
[0] Intel: Intel(R) Xeon(R) CPU E5-1620 0 @ 3.60GHz Max threads(8)
arrayfire result: 2319.69 and CPU result is 2336.96
The result is a bit off between two. I am running visual studio 2015 on Windows 7 x64 and also tried visual studio 2012 same result. Visual studio project is CPU_x64 and release as set default in the helloworld example.
Any idea?
Thanks,
Patrick.
check += afResults0[8 * i]*afResults1[i];
--
You received this message because you are subscribed to the Google Groups "ArrayFire Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arrayfire-use...@googlegroups.com.
To post to this group, send email to arrayfi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/arrayfire-users/4d0b1c61-41ab-4538-adac-36775f47eb32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/arrayfire-users/017259a2-ac20-468c-a174-26ff7aa66dd3%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/arrayfire-users/c336724a-02ac-4422-9dfa-96992a978f3a%40googlegroups.com.