A bug about float array initialization in device
In DS 3.1 in function "JSphGpu::PreInteractionVars_Forces", cudaMemset is used to initialize float arrays used in device, such as ViscDtg, Arg....
However, I found cudaMemset is only valid for integer and char array. A float array initialized by cudaMemset has many undesired numbers. This is not a problem if all particles participate the interaction computation, as arrays will be modified in the interaction. But it possesses a serious problem if only a part of particle are used in computation. Because ViscDtMax and AceMax may be wrongly computed.
I have a bug from this issue recently so I report it here.
By the way, do you know other efficient way to assign 0.0f to a float array?
Fallet
However, I found cudaMemset is only valid for integer and char array. A float array initialized by cudaMemset has many undesired numbers. This is not a problem if all particles participate the interaction computation, as arrays will be modified in the interaction. But it possesses a serious problem if only a part of particle are used in computation. Because ViscDtMax and AceMax may be wrongly computed.
I have a bug from this issue recently so I report it here.
By the way, do you know other efficient way to assign 0.0f to a float array?
Fallet