From 0cc2cda080bf3838d4d9f75961fe01518ab61781 Mon Sep 17 00:00:00 2001 From: Adrian Ulrich Date: Thu, 17 Feb 2011 14:51:17 +0100 Subject: [PATCH] misc fixes --- src/cutop.c | 40 ++++++++++++++++++++++++++++++++++++++-- src/cutop.h | 7 ++++++- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/src/cutop.c b/src/cutop.c index d69978d..e12e40b 100644 --- a/src/cutop.c +++ b/src/cutop.c @@ -11,7 +11,7 @@ int main (int argc, char **argv) { - while((opt = getopt(argc, argv, "hl:mvxdro")) != -1) { + while((opt = getopt(argc, argv, "hl:tmvxdro")) != -1) { switch(opt) { case 'l': loop = atoi(optarg); @@ -31,6 +31,9 @@ int main (int argc, char **argv) { case 'o': xfunc = &tst_opencl; break; + case 't': + xfunc = &tst_threads; + break; case 'v': printf("This is cutop - version %s\n", CUTOP_VERSION); exit(1); @@ -104,6 +107,8 @@ void drv_leak_mem(CUdevice unused) { *********************************************************************/ void query_memory(CUdevice unused) { + pid_t mypid; + struct utsname myself; unsigned int i; /* loop var */ int devcount; /* device count */ CUdevice dev; /* cuda device handle */ @@ -115,6 +120,9 @@ void query_memory(CUdevice unused) { cuOK( cuDeviceGetCount(&devcount) ); + mypid = getpid(); + uname(&myself); + printf("# found %d cuda-aware devices\n",devcount); for(i=0;i> CREATING THREADS RIGHT NOW\n"); + for (i=0; i #include #include +#include +#include #include #include +#include + #define NV_DEVNAME_SIZE 256 @@ -30,4 +34,5 @@ void query_devprops(CUdevice); void tst_runtime(CUdevice ); // jump to a function using the runtime api void tst_drvapi(CUdevice ); // jump to a function using the driver api void tst_opencl(CUdevice ); // jump to a function using the OpenCL api - +void tst_threads(CUdevice ); +void *_thcode(void *argument); -- 2.11.4.GIT