jcuda.runtime.JCuda.cudaDeviceReset()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中jcuda.runtime.JCuda.cudaDeviceReset()方法的一些代码示例,展示了JCuda.cudaDeviceReset()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JCuda.cudaDeviceReset()方法的具体详情如下:
包路径:jcuda.runtime.JCuda
类名称:JCuda
方法名:cudaDeviceReset

JCuda.cudaDeviceReset介绍

[英]Destroy all allocations and reset all state on the current device in the current process.

cudaError_t cudaDeviceReset ( 
void )

Destroy all allocations and reset all state on the current device in the current process. Explicitly destroys and cleans up all resources associated with the current device in the current process. Any subsequent API call to this device will reinitialize the device.

Note that this function will reset the device immediately. It is the caller's responsibility to ensure that the device is not being accessed by any other host threads from the process when this function is called.
Note:

Note that this function may also return error codes from previous, asynchronous launches.
[中]在当前进程中销毁当前设备上的所有分配并重置所有状态

cudaError_t cudaDeviceReset ( 
void )

在当前进程中销毁当前设备上的所有分配并重置所有状态。显式销毁和清除当前进程中与当前设备关联的所有资源。对该设备的任何后续API调用都将重新初始化该设备。
请注意,此功能将立即重置设备。调用此函数时,调用者负责确保该设备未被进程中的任何其他主机线程访问。
注:
请注意,此函数还可能返回以前异步启动的错误代码。

代码示例

代码示例来源:origin: com.simiacryptus/mindseye

/**
 * Cuda device reset int.
 *
 * @return the int
 */
public static int cudaDeviceReset() {
 long startTime = System.nanoTime();
 final int result = JCuda.cudaDeviceReset();
 log("cudaDeviceReset", result, new Object[]{});
 cudaDeviceReset_execution.accept((System.nanoTime() - startTime) / 1e9);
 handle(result);
 return result;
}

代码示例来源:origin: com.simiacryptus/mindseye-cudnn

/**
 * Cuda device reset int.
 *
 * @return the int
 */
public static int cudaDeviceReset() {
 long startTime = System.nanoTime();
 final int result = JCuda.cudaDeviceReset();
 log("cudaDeviceReset", result, new Object[]{});
 cudaDeviceReset_execution.accept((System.nanoTime() - startTime) / 1e9);
 handle(result);
 return result;
}

相关文章

JCuda类方法