All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nd4j.jita.allocator.garbage.GarbageResourceReference Maven / Gradle / Ivy

The newest version!
package org.nd4j.jita.allocator.garbage;

import org.nd4j.linalg.jcublas.context.CudaContext;

import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;

/**
 * @author [email protected]
 */
public class GarbageResourceReference extends WeakReference {
    private final CudaContext context;
    private final long threadId;
    private final int deviceId;

    public GarbageResourceReference(Thread referent, ReferenceQueue q, CudaContext context,
                    int deviceId) {
        super(referent, q);
        this.context = context;
        this.threadId = referent.getId();
        this.deviceId = deviceId;
    }

    public CudaContext getContext() {
        return context;
    }

    public long getThreadId() {
        return threadId;
    }

    public int getDeviceId() {
        return deviceId;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy