本文整理了Java中jcuda.runtime.JCuda.cudaStreamDestroy()
方法的一些代码示例,展示了JCuda.cudaStreamDestroy()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JCuda.cudaStreamDestroy()
方法的具体详情如下:
包路径:jcuda.runtime.JCuda
类名称:JCuda
方法名:cudaStreamDestroy
[英]Destroys and cleans up an asynchronous stream.
cudaError_t cudaStreamDestroy (
cudaStream_t stream )
Destroys and cleans up an asynchronous stream. Destroys and cleans up the asynchronous stream specified by stream.
In case the device is still doing work in the stream stream when cudaStreamDestroy() is called, the function will return immediately and the resources associated with stream will be released automatically once the device has completed all work in stream.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
[中]销毁和清理异步流
cudaError_t cudaStreamDestroy (
cudaStream_t stream )
销毁和清理异步流。销毁并清除由流指定的异步流。
如果调用cudaStreamDestroy()时设备仍在流中工作,则函数将立即返回,并且一旦设备完成流中的所有工作,与流相关的资源将自动释放。
注:
请注意,此函数还可能返回以前异步启动的错误代码。
代码示例来源:origin: com.simiacryptus/mindseye-cudnn
/**
* Cuda stream destroy int.
*
* @param stream the stream
* @return the int
*/
public static int cudaStreamDestroy(cudaStream_t stream) {
long startTime = System.nanoTime();
int result = JCuda.cudaStreamDestroy(stream);
cudaStreamDestroy_execution.accept((System.nanoTime() - startTime) / 1e9);
log("cudaStreamDestroy", result, new Object[]{stream});
handle(result);
return result;
}
代码示例来源:origin: com.simiacryptus/mindseye
/**
* Cuda stream destroy int.
*
* @param stream the stream
* @return the int
*/
public static int cudaStreamDestroy(cudaStream_t stream) {
long startTime = System.nanoTime();
int result = JCuda.cudaStreamDestroy(stream);
cudaStreamDestroy_execution.accept((System.nanoTime() - startTime) / 1e9);
log("cudaStreamDestroy", result, new Object[]{stream});
handle(result);
return result;
}
代码示例来源:origin: org.nd4j/nd4j-jcublas-common
/**
* Shutdown this instance
*/
public synchronized void destroy() {
if(shutdown.get())
return;
for(cudaStream_t stream : cudaStreams.values()) {
JCuda.cudaStreamDestroy(stream);
}
for(CUstream stream : contextStreams.values()) {
cuStreamDestroy(stream);
}
for(cublasHandle handle : handleMap.values())
JCublas2.cublasDestroy(handle);
shutdown.set(true);
}
内容来源于网络,如有侵权,请联系作者删除!