From 6c9555d42f3ab7f11dd003a9271d0c7e0ad21031 Mon Sep 17 00:00:00 2001 From: Suchita Pati Date: Mon, 9 Apr 2018 12:42:20 -0500 Subject: adding additional device attributes in cudaDeviceGetAttributes function for mnist --- libcuda/cuda_runtime_api.cc | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'libcuda') diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc index c103244..bcc3e14 100644 --- a/libcuda/cuda_runtime_api.cc +++ b/libcuda/cuda_runtime_api.cc @@ -840,7 +840,16 @@ __host__ cudaError_t CUDARTAPI cudaDeviceGetAttribute(int *value, enum cudaDevic if (device <= dev->num_devices() ) { prop = dev->get_prop(); switch (attr) { - case 5: + case 2: + *value= prop->maxThreadsDim[0]; + break; + case 3: + *value= prop->maxThreadsDim[1]; + break; + case 4: + *value= prop->maxThreadsDim[2]; + break; + case 5: *value= prop->maxGridSize[0]; break; case 6: @@ -849,6 +858,9 @@ __host__ cudaError_t CUDARTAPI cudaDeviceGetAttribute(int *value, enum cudaDevic case 7: *value= prop->maxGridSize[2]; break; + case 8: + *value= prop->sharedMemPerBlock; + break; case 10: *value= prop->warpSize; break; @@ -873,6 +885,12 @@ __host__ cudaError_t CUDARTAPI cudaDeviceGetAttribute(int *value, enum cudaDevic case 78: *value= 0 ; //TODO: as of now, we dont support stream priorities. break; + case 81: + *value= prop->sharedMemPerBlock; + break; + case 82: + *value= prop->regsPerBlock; + break; default: printf("ERROR: implement the attribute numbered %d \n",attr); abort(); -- cgit v1.3