/* * Copyright © 2010 INRIA. All rights reserved. * Copyright © 2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. */ #include #include #include #include #include /* check the CUDA Driver API helpers */ int main(void) { hwloc_topology_t topology; CUresult cres; CUdevice device; int count, i; int err; cres = cuInit(0); if (cres != CUDA_SUCCESS) { printf("cuInit failed %d\n", cres); return 0; } cres = cuDeviceGetCount(&count); if (cres != CUDA_SUCCESS) { printf("cuDeviceGetCount failed %d\n", cres); return 0; } printf("cuDeviceGetCount found %d devices\n", count); hwloc_topology_init(&topology); hwloc_topology_load(topology); for(i=0; i