AttentionEngine: A Versatile Framework for Efficient Attention Mechanisms on Diverse Hardware Platforms