new code in pyramid for gpu and other missing functions