File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
src/main/java/org/apache/sysml/runtime/controlprogram Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -624,15 +624,19 @@ public synchronized void clearData()
624
624
_rddHandle .setBackReference (null );
625
625
if ( _bcHandle != null )
626
626
_bcHandle .setBackReference (null );
627
+ clearGPUData ();
628
+
629
+ // change object state EMPTY
630
+ setDirty (false );
631
+ setEmpty ();
632
+ }
633
+
634
+ public void clearGPUData () {
627
635
if ( _gpuObjects != null ) {
628
636
for (GPUObject gObj : _gpuObjects .values ())
629
637
if (gObj != null )
630
638
gObj .clearData (null , gObj .getGPUContext ().EAGER_CUDA_FREE );
631
639
}
632
-
633
- // change object state EMPTY
634
- setDirty (false );
635
- setEmpty ();
636
640
}
637
641
638
642
public synchronized void exportData () {
Original file line number Diff line number Diff line change @@ -648,8 +648,12 @@ public void cleanupCacheableData(CacheableData<?> mo) {
648
648
Statistics .removeCPMemObject (System .identityHashCode (mo ));
649
649
//early abort w/o scan of symbol table if no cleanup required
650
650
boolean fileExists = (mo .isHDFSFileExists () && mo .getFileName () != null );
651
- if ( !CacheableData .isCachingActive () && !fileExists )
651
+ if ( !CacheableData .isCachingActive () && !fileExists ) {
652
+ if ( mo .isCleanupEnabled () && !getVariables ().hasReferences (mo ) )
653
+ mo .clearGPUData ();
652
654
return ;
655
+ }
656
+
653
657
654
658
try {
655
659
//compute ref count only if matrix cleanup actually necessary
You can’t perform that action at this time.
0 commit comments