clear cuda memory after allocating