commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r11423 - gnuradio/branches/developers/nldudok1/gpgpu-w


From: nldudok1
Subject: [Commit-gnuradio] r11423 - gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib
Date: Tue, 14 Jul 2009 04:48:24 -0600 (MDT)

Author: nldudok1
Date: 2009-07-14 04:48:23 -0600 (Tue, 14 Jul 2009)
New Revision: 11423

Modified:
   
gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cuda_fir_filter_ccf.cc
   
gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cuda_fir_filter_fff.cc
   
gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cuda_quadrature_demod_cuda_cf.cc
   gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cudai_iir.cu
   gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cudai_iir.h
   gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/gr_cuda.h
Log:
disable exceptions in gpu code to support CUDA 2.1

Modified: 
gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cuda_fir_filter_ccf.cc
===================================================================
--- 
gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cuda_fir_filter_ccf.cc
      2009-07-11 22:23:54 UTC (rev 11422)
+++ 
gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cuda_fir_filter_ccf.cc
      2009-07-14 10:48:23 UTC (rev 11423)
@@ -57,12 +57,14 @@
 cuda_fir_filter_ccf::start()
 {
   d_fir->start();
+  return true;
 }
 
 bool
 cuda_fir_filter_ccf::stop()
 {
   d_fir->stop();
+  return true;
 }
 
 void

Modified: 
gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cuda_fir_filter_fff.cc
===================================================================
--- 
gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cuda_fir_filter_fff.cc
      2009-07-11 22:23:54 UTC (rev 11422)
+++ 
gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cuda_fir_filter_fff.cc
      2009-07-14 10:48:23 UTC (rev 11423)
@@ -61,12 +61,14 @@
 cuda_fir_filter_fff::start()
 {
   d_fir->start();
+  return true;
 }
 
 bool
 cuda_fir_filter_fff::stop()
 {
   d_fir->stop();
+  return true;
 }
 
 void

Modified: 
gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cuda_quadrature_demod_cuda_cf.cc
===================================================================
--- 
gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cuda_quadrature_demod_cuda_cf.cc
    2009-07-11 22:23:54 UTC (rev 11422)
+++ 
gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cuda_quadrature_demod_cuda_cf.cc
    2009-07-14 10:48:23 UTC (rev 11423)
@@ -105,11 +105,13 @@
   //cuda_qdemod->device_input_items=bufsize_items;
   //max_mem_size=sizeof( gr_complex) * MAX_NOUTPUTS;
   //d_device_output = new float*;
+  return true;
 }
 
 bool
 cuda_quadrature_demod_cuda_cf::stop()
 {
+  return true;
 }
 
 int

Modified: 
gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cudai_iir.cu
===================================================================
--- 
gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cudai_iir.cu    
    2009-07-11 22:23:54 UTC (rev 11422)
+++ 
gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cudai_iir.cu    
    2009-07-14 10:48:23 UTC (rev 11423)
@@ -24,8 +24,12 @@
 #define INCLUDED_CUDAI_IIR_CU
 
 #include <vector>
-#include <stdexcept>
+//don't include stdexcept when you use CUDA 2.1 and gcc 4.2 or later
+//<stdexcept> includes <string> which includes <basic_string.h> and nvcc will 
choke on it with
+// /usr/include/c++/4.3/bits/basic_string.h(2462): error: incomplete type is 
not allowed
+//include <stdexcept>
 
+
 #include <cutil.h>
 #include "gr_cuda.h"
 typedef float2 gr_complex;
@@ -33,6 +37,10 @@
 #include "cudai_general_kernel.h"
 #include "cudai_iir.h"
 
+//2 lines below are to use save_call without stdexcept
+#undef GR_CUDA_SAFE_CALL
+#define GR_CUDA_SAFE_CALL( call)     GR_CUDA_SAFE_CALL_NOTHROW(call);    
+
 #define LOCAL_CUDA_SYNC( message ) do {                                      \
     cudaError err = cudaThreadSynchronize();                                 \
     if( cudaSuccess != err) {                                                \
@@ -54,8 +62,8 @@
 //__device__  std::vector<float>       prev_output;
 //__device__  std::vector<float>       prev_input;
 //} status_struct;
-
-#if 1
+#define RUN_ON_DEVICE
+#ifdef RUN_ON_DEVICE
 __device__  int *dd_latest_n;//[1];
 __device__  int *dd_latest_m;
 __device__  float      *dd_fftaps;
@@ -78,7 +86,7 @@
 #endif
 
 cudai_iir_fff::cudai_iir_fff (const std::vector<float>& fftaps,
-         const std::vector<float>& fbtaps) throw (std::invalid_argument)
+         const std::vector<float>& fbtaps) //throw (std::invalid_argument)
   {
     fprintf(stderr,"cudai_iir_fff::cudai_iir_fff(fftaps,fbtaps)\n");
     init_cuda();
@@ -124,7 +132,7 @@
    */
   void 
 cudai_iir_fff::set_taps (const std::vector<float> &fftaps, 
-                const std::vector<float> &fbtaps) throw (std::invalid_argument)
+                const std::vector<float> &fbtaps) //throw 
(std::invalid_argument)
   { 
     fprintf(stderr,"cudai_iir_fff::set_taps(..)\n");
 

Modified: 
gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cudai_iir.h
===================================================================
--- gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cudai_iir.h 
2009-07-11 22:23:54 UTC (rev 11422)
+++ gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/cudai_iir.h 
2009-07-14 10:48:23 UTC (rev 11423)
@@ -24,7 +24,7 @@
 #define INCLUDED_CUDAI_IIR_H
 
 #include <vector>
-#include <stdexcept>
+//include <stdexcept>
 #include <cuda_runtime.h>
 #include "cudai_general_kernel.h"
 /*!
@@ -57,7 +57,7 @@
    * If you're using that convention, you'll need to negate the feedback taps.
    */
   cudai_iir_fff (const std::vector<float>& fftaps,
-         const std::vector<float>& fbtaps) throw (std::invalid_argument);
+         const std::vector<float>& fbtaps); //throw (std::invalid_argument);
 
   cudai_iir_fff ();
 
@@ -89,7 +89,7 @@
    * \brief install new taps.
    */
   void set_taps (const std::vector<float> &fftaps, 
-                const std::vector<float> &fbtaps) throw 
(std::invalid_argument);
+                const std::vector<float> &fbtaps); //throw 
(std::invalid_argument);
 
 protected:
   void init_cuda();

Modified: 
gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/gr_cuda.h
===================================================================
--- gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/gr_cuda.h   
2009-07-11 22:23:54 UTC (rev 11422)
+++ gnuradio/branches/developers/nldudok1/gpgpu-wip/gr-cuda/src/lib/gr_cuda.h   
2009-07-14 10:48:23 UTC (rev 11423)
@@ -40,6 +40,14 @@
                 __FILE__, __LINE__, cudaGetErrorString( err) );              \
         throw std::runtime_error (cudaGetErrorString( err));                 \
     } }
+
+#define GR_CUDA_SAFE_CALL_NO_SYNC_NOTHROW( call)  {                            
      \
+    cudaError err = call;                                                    \
+    if( cudaSuccess != err) {                                                \
+        fprintf(stderr, "Cuda error in file '%s' in line %i : %s.\n",        \
+                __FILE__, __LINE__, cudaGetErrorString( err) );              \
+        exit(EXIT_FAILURE);                 \
+    } }
  
 #define GR_CUDA_SAFE_CALL( call)  {                                          \
     GR_CUDA_SAFE_CALL_NO_SYNC(call);                                         \
@@ -50,6 +58,16 @@
         throw std::runtime_error (cudaGetErrorString( err));                 \
     } }
 
+#define GR_CUDA_SAFE_CALL_NOTHROW( call)  {                                    
      \
+    GR_CUDA_SAFE_CALL_NO_SYNC_NOTHROW(call);                                   
      \
+    cudaError err = cudaThreadSynchronize();                                 \
+    if( cudaSuccess != err) {                                                \
+        fprintf(stderr, "Cuda error in file '%s' in line %i : %s.\n",        \
+                __FILE__, __LINE__, cudaGetErrorString( err) );              \
+        exit(EXIT_FAILURE);                 \
+    } }
+
+
 #define GR_CUDA_CUFFT_SAFE_CALL( call)  {                                    \
     cufftResult err = call;                                                  \
     if( CUFFT_SUCCESS != err) {                                              \





reply via email to

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