Ran Wang Ran Wang - 5 months ago 54
C++ Question

Does array fire constructor automatically deduce type when constructing from host pointer?

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.


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.