1

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 array

However, it is not clear to me now whether array fire will automatically decide the type of the array as "double" (f64) instead of the default float(f32).

Thank you very much for the help.

Ran Wang
  • 303
  • 1
  • 3
  • 9

1 Answers1

2

Yes, the host pointer is used to deduce the type of the Array. That's why this specific constructor does not have an argument for explicitly passing in the type.

shehzan
  • 331
  • 1
  • 5
  • I manage to confirm it by checking the size of different type of arrays~ still it would be nice to point out this in the documentation. – Ran Wang Nov 07 '16 at 23:30