commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r7948 - gnuradio/branches/developers/eb/gcell-wip/src/


From: eb
Subject: [Commit-gnuradio] r7948 - gnuradio/branches/developers/eb/gcell-wip/src/apps
Date: Wed, 5 Mar 2008 17:13:14 -0700 (MST)

Author: eb
Date: 2008-03-05 17:13:13 -0700 (Wed, 05 Mar 2008)
New Revision: 7948

Modified:
   gnuradio/branches/developers/eb/gcell-wip/src/apps/benchmark_dma.cc
Log:
removed power-of-2 restriction on dma size in benchmark

Modified: gnuradio/branches/developers/eb/gcell-wip/src/apps/benchmark_dma.cc
===================================================================
--- gnuradio/branches/developers/eb/gcell-wip/src/apps/benchmark_dma.cc 
2008-03-05 22:02:33 UTC (rev 7947)
+++ gnuradio/branches/developers/eb/gcell-wip/src/apps/benchmark_dma.cc 
2008-03-06 00:13:13 UTC (rev 7948)
@@ -92,8 +92,8 @@
 {
   static const int64_t TOTAL_SIZE_DMA = 20LL << 30;
   static const int NJDS = 64;
-  //unsigned int njobs = (unsigned int)(TOTAL_SIZE_DMA / dma_size);
-  unsigned int njobs = NJDS * 16;
+  unsigned int njobs = (unsigned int)(TOTAL_SIZE_DMA / dma_size);
+  //unsigned int njobs = NJDS * 16;
   unsigned int nsubmitted = 0;
   unsigned int ncompleted = 0;
   gc_job_desc *all_jds[NJDS];
@@ -103,8 +103,6 @@
   bool done[NJDS];
   
   static const unsigned int BUFSIZE = (32 << 10) * NJDS;
-  static const unsigned int BUFMASK = BUFSIZE - 1;
-  assert(power_of_2_p(BUFSIZE));
   unsigned char *getbuf = new unsigned char[BUFSIZE];
   boost::scoped_array<unsigned char> _getbuf(getbuf);
   unsigned char *putbuf = new unsigned char[BUFSIZE];
@@ -130,9 +128,12 @@
 
   // allocate and init all job descriptors
   for (int i = 0; i < NJDS; i++){
+    if (gbi + dma_size > BUFSIZE)
+      gbi = 0;
+
     all_jds[i] = mgr->alloc_job_desc();
     init_jd(all_jds[i], usecs, &getbuf[gbi], &putbuf[gbi], dma_size, 
getput_mask);
-    gbi = (gbi + dma_size) & BUFMASK;
+    gbi += dma_size;
   }
 
   for (int iter = 0; iter < 1; iter++){
@@ -230,8 +231,8 @@
 
     case 's':
       dma_size = strtol(optarg, 0, 0);
-      if (!power_of_2_p(dma_size) || dma_size < 16){
-       fprintf(stderr, "-s <dma_size> must be a power of 2 >= 16\n");
+      if (dma_size == 0){
+       fprintf(stderr, "-s <dma_size> must be > 0\n");
        return 1;
       }
       break;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]