Skip to content
Snippets Groups Projects
Commit 13f7d845 authored by Soeren Peters's avatar Soeren Peters
Browse files

Fixed compiler warnings.

parent 88a608a9
No related branches found
No related tags found
1 merge request!27Remove GPU compiler warnings (Closes #4, #12)
......@@ -4,9 +4,13 @@
#ifdef __CUDACC__
#include <cuda_runtime.h>
#else
#ifndef __host__
#define __host__
#endif
#ifndef __device__
#define __device__
#endif
#endif
#include <cmath>
......@@ -19,7 +23,7 @@ struct BASICS_EXPORT Vec3 {
real x{ c0o1 }, y{ c0o1 }, z{ c0o1 };
__host__ __device__ Vec3(real x, real y, real z) : x(x), y(y), z(z) {}
__host__ __device__ Vec3() = default;
Vec3() = default;
__host__ __device__ real length() { return std::sqrt(x * x + y * y + z * z); }
......
......@@ -218,6 +218,8 @@ public:
return SPtr<Side>(new PZ());
case SideType::GEOMETRY:
return SPtr<Side>(new Geometry());
default:
throw std::runtime_error("SideFactory::make() - SideType not valid.");
}
}
};
......
......@@ -30,13 +30,13 @@ static void printCudaInformation(int i) {
else
printf("Disabled\n");
printf(" --- Memory Information for device %d ---\n", i);
printf("Total global mem: %llu\n", prop.totalGlobalMem);
printf("Total constant Mem: %zd\n", prop.totalConstMem);
printf("Max mem pitch: %zd\n", prop.memPitch);
printf("Texture Alignment: %zd\n", prop.textureAlignment);
printf("max Texture 1D: %ld\n", prop.maxTexture1D);
printf("max Texture 2D: %ld, %ld\n", prop.maxTexture2D[0], prop.maxTexture2D[1]);
printf("max Texture 3D: %ld, %ld, %ld\n", prop.maxTexture3D[0], prop.maxTexture3D[1], prop.maxTexture3D[2]);
printf("Total global mem: %zu\n", prop.totalGlobalMem);
printf("Total constant Mem: %zu\n", prop.totalConstMem);
printf("Max mem pitch: %zu\n", prop.memPitch);
printf("Texture Alignment: %zu\n", prop.textureAlignment);
printf("max Texture 1D: %d\n", prop.maxTexture1D);
printf("max Texture 2D: %d, %d\n", prop.maxTexture2D[0], prop.maxTexture2D[1]);
printf("max Texture 3D: %d, %d, %d\n", prop.maxTexture3D[0], prop.maxTexture3D[1], prop.maxTexture3D[2]);
printf(" --- MP Information for device %d ---\n", i);
printf("Multiprocessor count: %d\n",
prop.multiProcessorCount);
......@@ -58,8 +58,8 @@ static void printCudaInformation(int i) {
size_t free;
size_t total;
cudaMemGetInfo(&free, &total);
printf("Free: %llu Bytes, Total: %llu Bytes\n", free, total);
printf("Free: %llu MB, Total: %llu MB\n", free / 1000 / 1000, total / 1000 / 1000);
printf("Free: %zu Bytes, Total: %zu Bytes\n", free, total);
printf("Free: %zu MB, Total: %zu MB\n", free / 1000 / 1000, total / 1000 / 1000);
//cudaDeviceSetLimit(cudaLimitMallocHeapSize, free);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment