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

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

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

JCuda.cudaMemGetInfo介绍

[英]Gets free and total device memory.

cudaError_t cudaMemGetInfo ( 
size_t* free, 
size_t* total )

Gets free and total device memory. Returns in *free and *total respectively, the free and total amount of memory available for allocation by the device in bytes.
Note:

Note that this function may also return error codes from previous, asynchronous launches.
[中]获取可用的和总的设备内存

cudaError_t cudaMemGetInfo ( 
size_t* free, 
size_t* total )

获取可用的和总的设备内存。分别以free和total返回设备可分配的可用内存量和总内存量(字节)。
注:
请注意,此函数还可能返回以前异步启动的错误代码。

代码示例

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

@Nonnull long[] free = {0};
@Nonnull long[] total = {0};
JCuda.cudaMemGetInfo(free, total);
out.printf("Cuda Memory: %.1f freeRef, %.1f total%n", free[0] * 1.0 / (1024 * 1024), total[0] * 1.0 / (1024 * 1024));
@Nonnull final int[] deviceCount = new int[1];

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

@Nonnull long[] free = {0};
@Nonnull long[] total = {0};
JCuda.cudaMemGetInfo(free, total);
out.printf("Cuda Memory: %.1f freeRef, %.1f total%n", free[0] * 1.0 / (1024 * 1024), total[0] * 1.0 / (1024 * 1024));
@Nonnull final int[] deviceCount = new int[1];

相关文章

JCuda类方法