diff --git a/Part1/PROJ_WIN/CIS565_PROJ_1.suo b/Part1/PROJ_WIN/CIS565_PROJ_1.suo index ad46c84..763c3a1 100644 Binary files a/Part1/PROJ_WIN/CIS565_PROJ_1.suo and b/Part1/PROJ_WIN/CIS565_PROJ_1.suo differ diff --git a/Part1/PROJ_WIN/CIS565_PROJ_1/vc100.pdb b/Part1/PROJ_WIN/CIS565_PROJ_1/vc100.pdb index b662f85..9738479 100644 Binary files a/Part1/PROJ_WIN/CIS565_PROJ_1/vc100.pdb and b/Part1/PROJ_WIN/CIS565_PROJ_1/vc100.pdb differ diff --git a/Part1/PROJ_WIN/src/kernel.cu.deps b/Part1/PROJ_WIN/src/kernel.cu.deps index 926dd55..b089af3 100644 --- a/Part1/PROJ_WIN/src/kernel.cu.deps +++ b/Part1/PROJ_WIN/src/kernel.cu.deps @@ -243,8 +243,8 @@ c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\swprintf.inl C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\cuda.h -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm/glm.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core/_fixes.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm/glm.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core/_fixes.hpp c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\climits c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cfloat c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\float.h @@ -259,107 +259,107 @@ c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstddef c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdio -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core/setup.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\./core/_detail.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\setup.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core/setup.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\./core/_detail.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\setup.hpp c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cassert c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\assert.h c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\./core/_vectorize.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\./core/type.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_half.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_half.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\_detail.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_float.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_half.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\setup.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_int.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\setup.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\_detail.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_gentype.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_size.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_vec1.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_vec.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_gentype.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_float.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_int.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_size.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\_swizzle.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\_swizzle_func.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_vec1.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_vec2.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_vec.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_float.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_int.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_size.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\_swizzle.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_vec2.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_vec3.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_vec.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_float.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_int.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_size.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\_swizzle.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_vec3.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_vec4.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_vec.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_float.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_int.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_size.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\_swizzle.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_vec4.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat2x2.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_gentype.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat2x2.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat2x3.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat2x3.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat2x4.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat2x4.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat3x2.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat3x2.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat3x3.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat3x3.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat3x4.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat3x4.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat4x2.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat4x2.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat4x3.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat4x3.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat4x4.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\type_mat4x4.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\./core/func_trigonometric.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\func_trigonometric.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\./core/func_exponential.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\func_exponential.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\./core/func_common.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\_fixes.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\func_common.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\./core/func_packing.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\func_packing.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\./core/func_geometric.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\func_geometric.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\./core/func_matrix.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\func_matrix.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\./core/func_vector_relational.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\_detail.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\func_vector_relational.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\./core/func_integer.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\func_integer.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\./core/func_noise.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core\func_noise.inl -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\./core/_swizzle.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\utilities.h -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm/glm.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core/_fixes.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\./core/_vectorize.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\./core/type.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_half.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_half.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\_detail.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_float.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_half.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\setup.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_int.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\setup.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\_detail.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_gentype.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_size.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_vec1.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_vec.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_gentype.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_float.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_int.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_size.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\_swizzle.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\_swizzle_func.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_vec1.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_vec2.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_vec.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_float.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_int.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_size.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\_swizzle.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_vec2.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_vec3.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_vec.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_float.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_int.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_size.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\_swizzle.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_vec3.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_vec4.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_vec.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_float.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_int.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_size.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\_swizzle.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_vec4.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat2x2.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_gentype.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat2x2.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat2x3.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat2x3.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat2x4.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat2x4.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat3x2.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat3x2.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat3x3.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat3x3.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat3x4.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat3x4.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat4x2.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat4x2.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat4x3.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat4x3.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat4x4.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\type_mat4x4.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\./core/func_trigonometric.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\func_trigonometric.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\./core/func_exponential.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\func_exponential.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\./core/func_common.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\_fixes.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\func_common.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\./core/func_packing.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\func_packing.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\./core/func_geometric.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\func_geometric.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\./core/func_matrix.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\func_matrix.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\./core/func_vector_relational.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\_detail.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\func_vector_relational.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\./core/func_integer.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\func_integer.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\./core/func_noise.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core\func_noise.inl +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\./core/_swizzle.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\utilities.h +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm/glm.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core/_fixes.hpp c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\algorithm c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\memory c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xmemory @@ -514,11 +514,11 @@ c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sstream c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\string c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfunctional -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\cudaMat4.h -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm/glm.hpp -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\glm\core/_fixes.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\cudaMat4.h +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm/glm.hpp +c:\users\hms\desktop\sarahleung\project-1\part1\src\glm\core/_fixes.hpp C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\cuda_runtime.h -c:\users\harmoli\documents\cis565\project3-simulation\part1\src\kernel.h +c:\users\hms\desktop\sarahleung\project-1\part1\src\kernel.h C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/random.h C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/detail/config.h C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/detail/config/config.h diff --git a/Part1/src/kernel.cu b/Part1/src/kernel.cu index ee9b9e5..e438415 100644 --- a/Part1/src/kernel.cu +++ b/Part1/src/kernel.cu @@ -89,19 +89,60 @@ __global__ void generateCircularVelArray(int time, int N, glm::vec3 * arr, glm:: // REMEMBER : F = (G * m_a * m_b) / (r_ab ^ 2) __device__ glm::vec3 accelerate(int N, glm::vec4 my_pos, glm::vec4 * their_pos) { - return glm::vec3(0.0f); + glm::vec3 F = glm::vec3(0.0f); + float Fmag = 0.0f; + glm::vec4 r_ab; + glm::vec3 r_ab_dir; + + int index = threadIdx.x + (blockIdx.x * blockDim.x); + + // loop through planets + for (int i = 0; i < N; i++) + { + r_ab = their_pos[i]-my_pos; + if (i != index) + { + r_ab_dir = glm::vec3(r_ab.x, r_ab.y, r_ab.z); + glm::normalize(r_ab_dir); + Fmag = G*my_pos.w*their_pos[i].w/(pow(glm::length(r_ab),2)+EPSILON); + F += glm::vec3(r_ab_dir.x*Fmag, r_ab_dir.y*Fmag, r_ab_dir.z*Fmag); + } + } + + // add force from the sun (at 0,0,0) + glm::vec3 r_sun = glm::vec3(-my_pos.x, -my_pos.y, -my_pos.z); + Fmag = G*my_pos.w*starMass/(pow(glm::length(r_sun),2)+EPSILON); + glm::normalize(r_sun); + F += glm::vec3(r_sun.x*Fmag, r_sun.y*Fmag, r_sun.z*Fmag); + + return F/my_pos.w; } // TODO : update the acceleration of each body __global__ void updateF(int N, float dt, glm::vec4 * pos, glm::vec3 * vel, glm::vec3 * acc) { - // FILL IN HERE + // thread ID + int index = threadIdx.x + (blockIdx.x * blockDim.x); + + if(index < N) + { + acc[index] += accelerate(N, pos[index], pos); + } } // TODO : update velocity and position using a simple Euler integration scheme __global__ void updateS(int N, float dt, glm::vec4 * pos, glm::vec3 * vel, glm::vec3 * acc) { - // FILL IN HERE + // thread ID + int index = threadIdx.x + (blockIdx.x * blockDim.x); + + if(index < N) + { + vel[index] += acc[index]*dt; + pos[index].x += vel[index].x*dt; + pos[index].y += vel[index].y*dt; + pos[index].z += vel[index].z*dt; + } } // Update the vertex buffer object @@ -179,7 +220,13 @@ void initCuda(int N) // TODO : Using the functions you wrote above, write a function that calls the CUDA kernels to update a single sim step void cudaNBodyUpdateWrapper(float dt) { - // FILL IN HERE + dim3 fullBlocksPerGrid((int)ceil(float(numObjects)/float(blockSize))); + + updateF<<>>(numObjects, dt, dev_pos, dev_vel, dev_acc); + cudaThreadSynchronize(); + + updateS<<>>(numObjects, dt, dev_pos, dev_vel, dev_acc); + cudaThreadSynchronize(); } void cudaUpdateVBO(float * vbodptr, int width, int height) diff --git a/Part2/CIS565_PROJ_1_PART_2/CIS565_PROJ_1_PART_2.sln b/Part2/CIS565_PROJ_1_PART_2/CIS565_PROJ_1_PART_2.sln new file mode 100644 index 0000000..846cc70 --- /dev/null +++ b/Part2/CIS565_PROJ_1_PART_2/CIS565_PROJ_1_PART_2.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CIS565_PROJ_1_PART_2", "CIS565_PROJ_1_PART_2\CIS565_PROJ_1_PART_2.vcxproj", "{1B6CD650-5D3F-40BF-BF43-8BA2270B7101}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1B6CD650-5D3F-40BF-BF43-8BA2270B7101}.Debug|Win32.ActiveCfg = Debug|Win32 + {1B6CD650-5D3F-40BF-BF43-8BA2270B7101}.Debug|Win32.Build.0 = Debug|Win32 + {1B6CD650-5D3F-40BF-BF43-8BA2270B7101}.Release|Win32.ActiveCfg = Release|Win32 + {1B6CD650-5D3F-40BF-BF43-8BA2270B7101}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Part2/CIS565_PROJ_1_PART_2/CIS565_PROJ_1_PART_2/CIS565_PROJ_1_PART_2.vcxproj b/Part2/CIS565_PROJ_1_PART_2/CIS565_PROJ_1_PART_2/CIS565_PROJ_1_PART_2.vcxproj new file mode 100644 index 0000000..19f0b01 --- /dev/null +++ b/Part2/CIS565_PROJ_1_PART_2/CIS565_PROJ_1_PART_2/CIS565_PROJ_1_PART_2.vcxproj @@ -0,0 +1,85 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + + + {1B6CD650-5D3F-40BF-BF43-8BA2270B7101} + CIS565_PROJ_1_PART_2 + + + + Application + true + MultiByte + + + Application + false + true + MultiByte + + + + + + + + + + + + + + + + Level3 + Disabled + $(SolutionDir)/shared/glew/include/;$(SolutionDir)/shared/freeglut/include/;%(AdditionalIncludeDirectories);$(CudaToolkitIncludeDir) + + + true + cudart.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(CudaToolkitLibDir) + + + $(ProjectDir)$(Platform)/$(Configuration)/%(Filename)%(Extension).obj + + + $(CudaToolkitIncludeDir) + + + + + Level3 + MaxSpeed + true + true + $(SolutionDir)/shared/glew/include/;$(SolutionDir)/shared/freeglut/include/;%(AdditionalIncludeDirectories);$(CudaToolkitIncludeDir) + + + true + true + true + cudart.lib; kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + $(ProjectDir)$(Platform)/$(Configuration)/%(Filename)%(Extension).obj + $(CudaToolkitIncludeDir) + + + + + + + \ No newline at end of file diff --git a/Part2/CIS565_PROJ_1_PART_2/CIS565_PROJ_1_PART_2/CIS565_PROJ_1_PART_2.vcxproj.filters b/Part2/CIS565_PROJ_1_PART_2/CIS565_PROJ_1_PART_2/CIS565_PROJ_1_PART_2.vcxproj.filters new file mode 100644 index 0000000..e62da37 --- /dev/null +++ b/Part2/CIS565_PROJ_1_PART_2/CIS565_PROJ_1_PART_2/CIS565_PROJ_1_PART_2.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file diff --git a/Part2/CIS565_PROJ_1_PART_2/src/main.cpp b/Part2/CIS565_PROJ_1_PART_2/src/main.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Part2/CIS565_PROJ_1_PART_2/src/matrix_math.cu b/Part2/CIS565_PROJ_1_PART_2/src/matrix_math.cu new file mode 100644 index 0000000..acb2eb2 --- /dev/null +++ b/Part2/CIS565_PROJ_1_PART_2/src/matrix_math.cu @@ -0,0 +1,202 @@ +#include +#include +#include +#include +#include +#include +using std::cout; + +const int width = 5; +int size = width * width * sizeof(float); + +dim3 threadsPerBlock(16, 16); +dim3 numBlocks(1); + +float * Ad; +float * Bd; + +float * Cdadd; +float * Cdsub; +float * Cdmult; + +float * A; +float * B; + +float * Cadd; +float * Csub; +float * Cmult; + + +// initialize matrices A and B +void initMat() +{ + int index = 0; + for (int r = 0; r < width; r++) + { + for (int c = 0; c < width; c++) + { + A[r*width+c] = index; + B[r*width+c] = index; + index++; + } + } +} + +// matrix addition kernel +__global__ void mat_add_kernel(float* M, float* N, float* P, int width) +{ + // 2D thread ID + int tx = threadIdx.x; + int ty = threadIdx.y; + + P[ty*width+tx] = M[ty*width+tx] + N[ty*width+tx]; +} + +// matrix subtraction kernel +__global__ void mat_sub_kernel(float* M, float* N, float* P, int width) +{ + // 2D thread ID + int tx = threadIdx.x; + int ty = threadIdx.y; + + P[ty*width+tx] = M[ty*width+tx] - N[ty*width+tx]; +} + +// matrix multiplication kernel +__global__ void mat_mult_kernel(float* M, float* N, float* P, int width) +{ + // 2D thread ID + int tx = threadIdx.x; + int ty = threadIdx.y; + + + float sum = 0.0f; + for (int i = 0; i < width; i++) + { + sum += (M[ty*width+i]*N[i*width+tx]); + } + P[ty*width+tx] = sum; +} + + +// serial versions of mat_add, mat_sub, and mat_mult + +void mat_add_serial(float* M, float* N, float* P) +{ + for (int r = 0; r < width; r++) + { + for (int c = 0; c < width; c++) + { + P[r*width+c] = M[r*width+c] + N[r*width+c]; + } + } +} + +void mat_sub_serial(float* M, float* N, float* P) +{ + for (int r = 0; r < width; r++) + { + for (int c = 0; c < width; c++) + { + P[r*width+c] = M[r*width+c] - N[r*width+c]; + } + } +} + +void mat_mult_serial(float* M, float* N, float* P) +{ + for (int r = 0; r < width; r++) + { + for (int c = 0; c < width; c++) + { + float sum = 0.0f; + for (int i = 0; i < width; i++) + { + sum += (M[r*width+i]*N[i*width+c]); + } + P[r*width+c] = sum; + } + } +} + +int main() +{ + // initialize matrices + A = new float[width*width]; + B = new float[width*width]; + Cadd = new float[width*width]; + Csub = new float[width*width]; + Cmult = new float[width*width]; + + // populate matrices A and B + initMat(); + + // set up memory and data transfer + cudaMalloc((void**)&Ad, size); + cudaMemcpy(Ad, A, size, cudaMemcpyHostToDevice); + + cudaMalloc((void**)&Bd, size); + cudaMemcpy(Bd, B, size, cudaMemcpyHostToDevice); + + cudaMalloc((void**)&Cdadd, size); + cudaMalloc((void**)&Cdsub, size); + cudaMalloc((void**)&Cdmult, size); + + // add, subtract, and multiply matrices + mat_add_kernel<<>>(Ad, Bd, Cdadd, width); + cudaMemcpy(Cadd, Cdadd, size, cudaMemcpyDeviceToHost); + std::cout<>>(Ad, Bd, Cdsub, width); + cudaMemcpy(Csub, Cdsub, size, cudaMemcpyDeviceToHost); + std::cout<>>(Ad, Bd, Cdmult, width); + cudaMemcpy(Cmult, Cdmult, size, cudaMemcpyDeviceToHost); + std::cout<