Corrected check for whether cuda is active or not and compile only one addition kernel instead of many in the perform() method.