Fix AMD compatibility with almond loader

Wrapping define in a function so it is compatible with almond