[clfft] 15/21: fixing compiler warnings

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Mar 16 13:14:04 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository clfft.

commit bfc49af2465d2feb691c1e1fc3a0a677d903e5c9
Author: bragadeesh <bragadeesh.natarajan at amd>
Date:   Wed Mar 9 14:25:50 2016 -0800

    fixing compiler warnings
---
 src/client/openCL.misc.h            |  3 +++
 src/examples/fft1d.c                |  2 +-
 src/examples/fft2d.c                |  8 ++++----
 src/examples/fft3d.c                |  8 ++++----
 src/library/action.transpose.cpp    |  2 +-
 src/library/fft_binary_lookup.cpp   |  4 ++++
 src/library/generator.stockham.h    |  3 +++
 src/library/generator.transpose.cpp | 10 +++++-----
 src/library/md5sum.c                |  4 ++++
 src/library/plan.cpp                | 12 ++++++------
 src/tests/accuracy_test_pow7.cpp    |  4 ++--
 11 files changed, 37 insertions(+), 23 deletions(-)

diff --git a/src/client/openCL.misc.h b/src/client/openCL.misc.h
index 07cc416..9515858 100644
--- a/src/client/openCL.misc.h
+++ b/src/client/openCL.misc.h
@@ -14,6 +14,9 @@
  * limitations under the License.
  * ************************************************************************/
 
+#ifdef _MSC_VER
+#pragma warning(disable : 4996)
+#endif
 
 #pragma once
 #if !defined( OPENCL_MISC_H )
diff --git a/src/examples/fft1d.c b/src/examples/fft1d.c
index 5a1ba54..00e3e70 100644
--- a/src/examples/fft1d.c
+++ b/src/examples/fft1d.c
@@ -71,7 +71,7 @@ int main( void )
     X = (float *)malloc(N * 2 * sizeof(*X));
 
     /* print input array */
-    printf("\nPerforming fft on an one dimensional array of size N = %ld\n", N);
+    printf("\nPerforming fft on an one dimensional array of size N = %ul\n", (unsigned long)N);
     int print_iter = 0;
     while(print_iter<N) {
         float x = (float)print_iter;
diff --git a/src/examples/fft2d.c b/src/examples/fft2d.c
index 455ea70..5a6f4f3 100644
--- a/src/examples/fft2d.c
+++ b/src/examples/fft2d.c
@@ -74,14 +74,14 @@ int main( void )
 
     /* print input array just using the
      * indices to fill the array with data */
-    printf("\nPerforming fft on an two dimensional array of size N0 x N1 : %ld x %ld\n", N0, N1);
-    int i, j;
+    printf("\nPerforming fft on an two dimensional array of size N0 x N1 : %ul x %ul\n", (unsigned long)N0, (unsigned long)N1);
+	size_t i, j;
     i = j = 0;
     for (i=0; i<N0; ++i) {
         for (j=0; j<N1; ++j) {
             float x = 0.5f;
             float y = 0.5f;
-            unsigned idx = 2*(j+i*N0);
+			size_t idx = 2*(j+i*N0);
             X[idx] = x;
             X[idx+1] = y;
             printf("(%f, %f) ", x, y);
@@ -119,7 +119,7 @@ int main( void )
     i = j = 0;
     for (i=0; i<N0; ++i) {
         for (j=0; j<N1; ++j) {
-            unsigned idx = 2*(j+i*N0);
+			size_t idx = 2*(j+i*N0);
             printf("(%f, %f) ", X[idx], X[idx+1]);
         }
         printf("\n");
diff --git a/src/examples/fft3d.c b/src/examples/fft3d.c
index d5c4eb5..cd92294 100644
--- a/src/examples/fft3d.c
+++ b/src/examples/fft3d.c
@@ -74,8 +74,8 @@ int main( void )
 
     /* print input array just using the
      * indices to fill the array with data */
-    printf("\nPerforming fft on an two dimensional array of size N0 x N1 x N2 : %ld x %ld x %ld\n", N0, N1, N2);
-    int i, j, k;
+    printf("\nPerforming fft on an two dimensional array of size N0 x N1 x N2 : %ul x %ul x %ul\n", (unsigned long)N0, (unsigned long)N1, (unsigned long)N2);
+    size_t i, j, k;
     i = j = k = 0;
     for (i=0; i<N0; ++i) {
         for (j=0; j<N1; ++j) {
@@ -85,7 +85,7 @@ int main( void )
                 if (i==0 && j==0 && k==0) {
                     x = y = 0.5f;
                 }
-                unsigned idx = 2*(k+j*N1+i*N0*N1);
+				size_t idx = 2*(k+j*N1+i*N0*N1);
                 X[idx] = x;
                 X[idx+1] = y;
                 printf("(%f, %f) ", X[idx], X[idx+1]);
@@ -126,7 +126,7 @@ int main( void )
     for (i=0; i<N0; ++i) {
         for (j=0; j<N1; ++j) {
             for (k=0; k<N2; ++k) {
-                unsigned idx = 2*(k+j*N1+i*N0*N1);
+				size_t idx = 2*(k+j*N1+i*N0*N1);
                 printf("(%f, %f) ", X[idx], X[idx+1]);
             }
             printf("\n");
diff --git a/src/library/action.transpose.cpp b/src/library/action.transpose.cpp
index 5806812..3166c12 100644
--- a/src/library/action.transpose.cpp
+++ b/src/library/action.transpose.cpp
@@ -256,7 +256,7 @@ clfftStatus FFTGeneratedTransposeNonSquareAction::generateKernel(FFTRepo& fftRep
 
 			requestedCallbackLDS = this->signature.fft_preCallback.localMemSize;
 			//LDS usage of swap lines is exactly 2 lines
-			int lineSize = (this->signature.fft_N[0]) < (this->signature.fft_N[1]) ? this->signature.fft_N[0] : this->signature.fft_N[1];
+			size_t lineSize = (this->signature.fft_N[0]) < (this->signature.fft_N[1]) ? this->signature.fft_N[0] : this->signature.fft_N[1];
 			validLDSSize = ((2 * this->plan->ElementSize() * lineSize) + requestedCallbackLDS) < this->plan->envelope.limit_LocalMemSize;
 
 			if (!validLDSSize)
diff --git a/src/library/fft_binary_lookup.cpp b/src/library/fft_binary_lookup.cpp
index b85b87e..9a80936 100644
--- a/src/library/fft_binary_lookup.cpp
+++ b/src/library/fft_binary_lookup.cpp
@@ -14,6 +14,10 @@
  * limitations under the License.
  * ************************************************************************/
 
+#ifdef _MSC_VER
+#pragma warning(disable : 4996)
+#endif
+
 #include "fft_binary_lookup.h"
 
 #include <iostream>
diff --git a/src/library/generator.stockham.h b/src/library/generator.stockham.h
index 66b2e22..3323693 100644
--- a/src/library/generator.stockham.h
+++ b/src/library/generator.stockham.h
@@ -14,6 +14,9 @@
  * limitations under the License.
  * ************************************************************************/
 
+#ifdef _MSC_VER
+#pragma warning(disable : 4996)
+#endif
 
 #pragma once
 #if !defined( AMD_CLFFT_generator_stockham_H )
diff --git a/src/library/generator.transpose.cpp b/src/library/generator.transpose.cpp
index a8f417d..8387791 100644
--- a/src/library/generator.transpose.cpp
+++ b/src/library/generator.transpose.cpp
@@ -960,7 +960,7 @@ clfftStatus genTransposeKernelBatched(const FFTGeneratedTransposeSquareAction::S
 
 		// Generate kernel API
 		genTransposePrototype(params, lwSize, dtPlanar, dtComplex, funcName, transKernel, dtInput, dtOutput);
-		int wgPerBatch;
+		size_t wgPerBatch;
 		if (mult_of_16)
 			wgPerBatch = (params.fft_N[0] / 16 / reShapeFactor)*(params.fft_N[0] / 16 / reShapeFactor + 1) / 2;
 		else
@@ -1222,7 +1222,7 @@ clfftStatus genTransposeKernelBatched(const FFTGeneratedTransposeSquareAction::S
 					{
 						//assume tranpose is only two dimensional for now
 						//int actualBatchSize = params.transposeBatchSize / params.transposeMiniBatchSize;
-						int blockOffset = params.fft_inStride[2];
+						size_t blockOffset = params.fft_inStride[2];
 						clKernWrite(transKernel, 6) << params.fft_postCallback.funcname << "(outputA-" << blockOffset <<"*((get_group_id(0)/numGroupsY_1)%"<< params.transposeMiniBatchSize <<"), ((idy + loop*" << 16 / reShapeFactor << ")*"
 							<< params.fft_N[0] << " + idx + "<< blockOffset <<"*( (get_group_id(0)/numGroupsY_1 )%" << params.transposeMiniBatchSize <<") " << "), post_userdata, yx_s[index]";
 					}
@@ -1236,7 +1236,7 @@ clfftStatus genTransposeKernelBatched(const FFTGeneratedTransposeSquareAction::S
 						clKernWrite(transKernel, 6) << params.fft_postCallback.funcname << "(outputA, ((lidy + loop*" << 16 / reShapeFactor << ")*" << params.fft_N[0] << " + lidx + starting_index_yx), post_userdata, xy_s[index]";
 					else
 					{
-						int blockOffset = params.fft_inStride[2];
+						size_t blockOffset = params.fft_inStride[2];
 						//clKernWrite(transKernel, 6) << params.fft_postCallback.funcname << "(outputA-iOffset, ((lidy + loop*" << 16 / reShapeFactor << ")*" << params.fft_N[0] << " + lidx + starting_index_yx +iOffset), post_userdata, xy_s[index]";
 						//clKernWrite(transKernel, 0) << std::endl;
 						clKernWrite(transKernel, 6) << params.fft_postCallback.funcname << "(outputA-" << blockOffset << "*((get_group_id(0)/numGroupsY_1)%" << params.transposeMiniBatchSize << "), ((lidy + loop*" << 16 / reShapeFactor << ")*" 
@@ -1263,7 +1263,7 @@ clfftStatus genTransposeKernelBatched(const FFTGeneratedTransposeSquareAction::S
 					}
 					else
 					{
-						int blockOffset = params.fft_inStride[2];
+						size_t blockOffset = params.fft_inStride[2];
 						clKernWrite(transKernel, 6) << params.fft_postCallback.funcname << "(outputA_R - "<< blockOffset << "*((get_group_id(0)/numGroupsY_1)%" << params.transposeMiniBatchSize <<
 							"), outputA_I -" << blockOffset << "*((get_group_id(0)/numGroupsY_1)%" << params.transposeMiniBatchSize <<
 							"), ((idy + loop*" << 16 / reShapeFactor << ")*" << params.fft_N[0] << " + idx +"<< blockOffset << "*((get_group_id(0)/numGroupsY_1)%" << params.transposeMiniBatchSize <<
@@ -1281,7 +1281,7 @@ clfftStatus genTransposeKernelBatched(const FFTGeneratedTransposeSquareAction::S
 					}
 					else
 					{
-						int blockOffset = params.fft_inStride[2];
+						size_t blockOffset = params.fft_inStride[2];
 						clKernWrite(transKernel, 6) << params.fft_postCallback.funcname << "(outputA_R - " << blockOffset << "*((get_group_id(0)/numGroupsY_1)%" << params.transposeMiniBatchSize <<
 							"), outputA_I -" << blockOffset << "*((get_group_id(0)/numGroupsY_1)%" << params.transposeMiniBatchSize << 
 							"), ((lidy + loop*" << 16 / reShapeFactor << ")*" << params.fft_N[0] << " + lidx+ starting_index_yx +" << blockOffset << "*((get_group_id(0)/numGroupsY_1)%" << params.transposeMiniBatchSize << 
diff --git a/src/library/md5sum.c b/src/library/md5sum.c
index 82769c2..5ba6d7c 100644
--- a/src/library/md5sum.c
+++ b/src/library/md5sum.c
@@ -35,6 +35,10 @@
  * compile-time configuration.
  */
 
+#ifdef _MSC_VER
+#pragma warning(disable : 4996)
+#endif
+
 #include "md5sum.h"
  
 #ifndef HAVE_OPENSSL
diff --git a/src/library/plan.cpp b/src/library/plan.cpp
index bd65bab..36a2ab5 100644
--- a/src/library/plan.cpp
+++ b/src/library/plan.cpp
@@ -2037,10 +2037,10 @@ clfftStatus	clfftBakePlan( clfftPlanHandle plHandle, cl_uint numQueues, cl_comma
 						{
 							//this should be in a function to avoide duplicate code TODO
 							//need to treat a non square matrix as a sqaure matrix with bigger batch size
-							int lengthX = trans1Plan->length[0];
-							int lengthY = trans1Plan->length[1];
+							size_t lengthX = trans1Plan->length[0];
+							size_t lengthY = trans1Plan->length[1];
 
-							int BatchFactor = (lengthX > lengthY) ? (lengthX / lengthY) : (lengthY / lengthX);
+							size_t BatchFactor = (lengthX > lengthY) ? (lengthX / lengthY) : (lengthY / lengthX);
 							trans1Plan->transposeMiniBatchSize = BatchFactor;
 							trans1Plan->batchsize *= BatchFactor;
 							trans1Plan->iDist = trans1Plan->iDist / BatchFactor;
@@ -2108,10 +2108,10 @@ clfftStatus	clfftBakePlan( clfftPlanHandle plHandle, cl_uint numQueues, cl_comma
 						if (trans2Plan->nonSquareKernelType == NON_SQUARE_TRANS_TRANSPOSE_BATCHED)
 						{
 							//need to treat a non square matrix as a sqaure matrix with bigger batch size
-							int lengthX = trans2Plan->length[0];
-							int lengthY = trans2Plan->length[1];
+							size_t lengthX = trans2Plan->length[0];
+							size_t lengthY = trans2Plan->length[1];
 
-							int BatchFactor = (lengthX > lengthY) ? (lengthX/lengthY) : (lengthY/lengthX);
+							size_t BatchFactor = (lengthX > lengthY) ? (lengthX/lengthY) : (lengthY/lengthX);
 							trans2Plan->transposeMiniBatchSize = BatchFactor;
 							trans2Plan->batchsize *= BatchFactor;
 							trans2Plan->iDist = trans2Plan->iDist / BatchFactor;
diff --git a/src/tests/accuracy_test_pow7.cpp b/src/tests/accuracy_test_pow7.cpp
index 1df2add..a7a6b33 100644
--- a/src/tests/accuracy_test_pow7.cpp
+++ b/src/tests/accuracy_test_pow7.cpp
@@ -7400,7 +7400,7 @@ namespace power7
                         is_1D_parameters_pushed = 1;
                         if (pow(7,(x + y + z)) <= (SP_MAX_LEN))
                         {
-                            data_sets.push_back(InpSizeParameters(pow(7 , x), pow(7 , y), pow(7 , z), CLFFT_SINGLE));
+                            data_sets.push_back(InpSizeParameters((unsigned int)pow(7 , x), (unsigned int)pow(7 , y), (unsigned int)pow(7 , z), CLFFT_SINGLE));
                         }
                         else
                         {
@@ -7408,7 +7408,7 @@ namespace power7
                         }
                         if (pow(7,(x + y + z)) <= (DP_MAX_LEN))
                         {
-                            data_sets.push_back(InpSizeParameters(pow(7 , x), pow(7 , y), pow(7 , z), CLFFT_DOUBLE));
+                            data_sets.push_back(InpSizeParameters((unsigned int)pow(7 , x), (unsigned int)pow(7 , y), (unsigned int)pow(7 , z), CLFFT_DOUBLE));
                         }          
                     }
                 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/clfft.git



More information about the debian-science-commits mailing list