Browse Source

gcc-plugin/examples/vector_scal: use unsigned int to be consistent with other functions using the same parameter

Nathalie Furmento 12 years ago
parent
commit
0e84c5cdf8

+ 3 - 3
gcc-plugin/examples/vector_scal/vector_scal.c

@@ -140,9 +140,9 @@ extern void vector_scal_cuda (unsigned int size, float vector[size], float facto
 
 
 #define EPSILON 1e-3
 #define EPSILON 1e-3
 static bool
 static bool
-check (size_t size, float vector[size], float factor)
+check (unsigned int size, float vector[size], float factor)
 {
 {
-  size_t i;
+  unsigned int i;
 
 
   for (i = 0; i < size; i++)
   for (i = 0; i < size; i++)
     {
     {
@@ -174,7 +174,7 @@ main (void)
   {
   {
     float vector[NX] __attribute__ ((heap_allocated, registered));
     float vector[NX] __attribute__ ((heap_allocated, registered));
 
 
-    size_t i;
+    unsigned int i;
     for (i = 0; i < NX; i++)
     for (i = 0; i < NX; i++)
       vector[i] = (float) i;
       vector[i] = (float) i;
 
 

+ 1 - 1
gcc-plugin/examples/vector_scal/vector_scal_cuda.cu

@@ -32,7 +32,7 @@ vector_mult_cuda (unsigned int n, float *val, float factor)
 }
 }
 
 
 extern "C" void
 extern "C" void
-vector_scal_cuda (size_t size, float vector[], float factor)
+vector_scal_cuda (unsigned int size, float vector[], float factor)
 {
 {
   unsigned threads_per_block = 64;
   unsigned threads_per_block = 64;
   unsigned nblocks = (size + threads_per_block - 1) / threads_per_block;
   unsigned nblocks = (size + threads_per_block - 1) / threads_per_block;