Added a new generic function to the interface (astaroth.h) for loading arbitrary device constants. Also (unintended) autoformatting.
This commit is contained in:
@@ -409,10 +409,14 @@ AcResult acQuit(void);
|
||||
unless otherwise stated. */
|
||||
AcResult acSynchronize(void);
|
||||
|
||||
/** */
|
||||
AcResult acloadDeviceConstant(const AcRealParam param, const AcReal value);
|
||||
|
||||
/** Tool for loading forcing vector information into the device memory
|
||||
*/
|
||||
AcResult acForcingVec(const AcReal forcing_magnitude, const AcReal3 k_force, const AcReal3 ff_hel_re,
|
||||
const AcReal3 ff_hel_im, const AcReal forcing_phase, const AcReal kaver);
|
||||
AcResult acForcingVec(const AcReal forcing_magnitude, const AcReal3 k_force,
|
||||
const AcReal3 ff_hel_re, const AcReal3 ff_hel_im, const AcReal forcing_phase,
|
||||
const AcReal kaver);
|
||||
|
||||
/* End extern "C" */
|
||||
#ifdef __cplusplus
|
||||
|
@@ -506,6 +506,15 @@ acSynchronize(void)
|
||||
return AC_SUCCESS;
|
||||
}
|
||||
|
||||
AcResult
|
||||
acloadDeviceConstant(const AcRealParam param, const AcReal value)
|
||||
{
|
||||
for (int i = 0; i < num_devices; ++i) {
|
||||
loadDeviceConstant(devices[i], param, value);
|
||||
}
|
||||
return AC_SUCCESS;
|
||||
}
|
||||
|
||||
// Tool for loading forcing vector information into the device memory
|
||||
AcResult
|
||||
acForcingVec(const AcReal forcing_magnitude, const AcReal3 k_force, const AcReal3 ff_hel_re,
|
||||
@@ -529,10 +538,7 @@ acForcingVec(const AcReal forcing_magnitude, const AcReal3 k_force, const AcReal
|
||||
loadDeviceConstant(devices[i], AC_ff_hel_imz, ff_hel_im.z);
|
||||
|
||||
loadDeviceConstant(devices[i], AC_kaver, kaver);
|
||||
|
||||
}
|
||||
|
||||
return AC_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user