Comparing Hardware Accelerators in Scientific Applications: A Case Study