Performance Primitives for Artificial Neural Networks