next thing is to add a thread pool to allow for cudaMalloc in background