Ran Wang Ran Wang - 1 year ago 104
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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download