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

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

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

JCuda.cudaDeviceGetLimit介绍

[英]Returns resource limits.

cudaError_t cudaDeviceGetLimit ( 
size_t* pValue, 
cudaLimit limit )

Returns resource limits. Returns in *pValue the current size of limit. The supported cudaLimit values are:

  • cudaLimitStackSize: stack size in bytes of each GPU thread;
  • cudaLimitPrintfFifoSize: size in bytes of the shared FIFO used by the printf() and fprintf() device system calls.
  • cudaLimitMallocHeapSize: size in bytes of the heap used by the malloc() and free() device system calls;
  • cudaLimitDevRuntimeSyncDepth: maximum grid depth at which a thread can isssue the device runtime call cudaDeviceSynchronize() to wait on child grid launches to complete.
  • cudaLimitDevRuntimePendingLaunchCount: maximum number of outstanding device runtime launches.

Note:

Note that this function may also return error codes from previous, asynchronous launches.
[中]返回资源限制

cudaError_t cudaDeviceGetLimit ( 
size_t* pValue, 
cudaLimit limit )

返回资源限制。以*p值形式返回限制的当前大小。支持的cudaLimit值为:
*cudaLimitStackSize:每个GPU线程的堆栈大小(字节);
*cudaLimitPrintfFifoSize:printf()和fprintf()设备系统调用使用的共享FIFO的大小(以字节为单位)。
*cudaLimitMallocHeapSize:malloc()和free()设备系统调用使用的堆的大小(字节);
*cudaLimitDevRuntimeSyncDepth:线程可以使用设备运行时调用cudaDeviceSynchronize()来等待子网格启动完成的最大网格深度。
*cudaLimitDevRuntimePendingLaunchCount:未完成设备运行时启动的最大数量。
注:
请注意,此函数还可能返回以前异步启动的错误代码。

代码示例

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

/**
 * Cuda device get limit long.
 *
 * @param limit the limit
 * @return the long
 */
public static long cudaDeviceGetLimit(final int limit) {
 long startTime = System.nanoTime();
 @Nonnull long[] pValue = new long[1];
 final int result = JCuda.cudaDeviceGetLimit(pValue, limit);
 cudaDeviceGetLimit_execution.accept((System.nanoTime() - startTime) / 1e9);
 log("cudaDeviceGetLimit(", result, new Object[]{pValue, limit});
 return pValue[0];
}

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

/**
 * Cuda device get limit long.
 *
 * @param limit the limit
 * @return the long
 */
public static long cudaDeviceGetLimit(final int limit) {
 long startTime = System.nanoTime();
 @Nonnull long[] pValue = new long[1];
 final int result = JCuda.cudaDeviceGetLimit(pValue, limit);
 cudaDeviceGetLimit_execution.accept((System.nanoTime() - startTime) / 1e9);
 log("cudaDeviceGetLimit(", result, new Object[]{pValue, limit});
 return pValue[0];
}

相关文章

JCuda类方法