It’s not, as it will synchronize your code and free all cached memory. Since no memory is in the cache, the next allocations will again synchronize your code during the cudaMalloc calls and thus cause slowdowns in your code.
1 Like