An optimized magnetostatic field solver on GPU using open computing language