summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuchita Pati <[email protected]>2018-04-09 12:42:20 -0500
committerSuchita Pati <[email protected]>2018-04-09 12:42:20 -0500
commit6c9555d42f3ab7f11dd003a9271d0c7e0ad21031 (patch)
tree9c4c2460919ae780d9745380ce506e4c66c24f4f
parenta17c466a9578f983c48704495566df5a373ff6ba (diff)
adding additional device attributes in cudaDeviceGetAttributes function for mnist
-rw-r--r--libcuda/cuda_runtime_api.cc20
1 files changed, 19 insertions, 1 deletions
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();