jcuda.driver.CUresult Java Examples

The following examples show how to use jcuda.driver.CUresult. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JCudaSamplesUtils.java    From jcuda-samples with MIT License 5 votes vote down vote up
/**
 * Compute the compute capability of the device device of the current
 * context. The compute capability will be returned as an int value 
 * <code>major * 10 + minor</code>. For example, the return value
 * will be <code>52</code> for a device with compute capability 5.2.
 * 
 * @return The compute capability of the current device
 * @throws CudaException If there is no current context
 */
private static int computeComputeCapability()
{
    CUdevice device = new CUdevice();
    int status = cuCtxGetDevice(device);
    if (status != CUresult.CUDA_SUCCESS)
    {
        throw new CudaException(CUresult.stringFor(status));
    }
    return computeComputeCapability(device);
}
 
Example #2
Source File: JCudaKernels.java    From systemds with Apache License 2.0 4 votes vote down vote up
public static void checkResult(int cuResult) {
	if (cuResult != CUresult.CUDA_SUCCESS) {
		throw new DMLRuntimeException(CUresult.stringFor(cuResult));
	}
}
 
Example #3
Source File: JCudaKernels.java    From systemds with Apache License 2.0 4 votes vote down vote up
public static void checkResult(int cuResult) {
	if (cuResult != CUresult.CUDA_SUCCESS) {
		throw new DMLRuntimeException(CUresult.stringFor(cuResult));
	}
}