Adding the Batch class to GPU and fixing the compilation issues