Sha256: 04865e553f2765724dc4ef5f262d4dbc46067b70efe7a487e4d82f290c3dbee3

Contents?: true

Size: 540 Bytes

Versions: 1

Compression:

Stored size: 540 Bytes

Contents

#include <cstdio>
#include <cstdlib>
#include <cuda_runtime.h>

static void
check(cudaError_t err)
{
    if (err != cudaSuccess) {
        exit(1);
    }
}

static int
min(int x, int y)
{
    return x <= y ? x : y;
}

int main()
{
    int res = INT_MAX;
    cudaDeviceProp prop;
    int count, i, n;

    check(cudaGetDeviceCount(&count));

    for (i = 0; i < count; i++) {
        check(cudaGetDeviceProperties(&prop, i));
        n = prop.major * 10 + prop.minor;
        res = min(res, n);
    }

    printf("%d", res);
    return 0;
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gumath-0.2.0dev8 ext/ruby_gumath/gumath/tools/detect_cuda_arch.cc