前提・実現したいこと
cudaを用いて粒子法解析のサンプルプログラムを動かそうとしましたところ以下のエラーメッセージが発生しました。
発生している問題・エラーメッセージ
Warning 1 warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include\cuda_runtime.h 1 1 simpleGL
エラーメッセージ
Warning 2 warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\cuda_runtime_api.h 1950 1 simpleGL
該当のソースコード
ソースコード #include <helper_math.h> #define PI 3.141592653589793 // GPU処理. #define d_U(x, y, t) (- 2.0f * __cosf(PI * (t) / 8.0f) * __sinf(PI * (x)) * __sinf(PI * (x)) * __cosf(PI * (y)) * __sinf(PI * (y))) #define d_V(x, y, t) (2.0f * __cosf(PI * (t) / 8.0f) * __cosf(PI * (x)) * __sinf(PI * (x)) * __sinf(PI * (y)) * __sinf(PI * (y))) // GPU用ルンゲ・クッタ法 __global__ void d_RungeKutta(unsigned int num_particles, float(*pos)[2], float time, float dt) // unsigned int num_particles; 粒子の総数. // float (*pos)[2]; 粒子位置. // float time; 時刻. // float dt; 時間刻み. { unsigned int index; float xn, yn, p1, q1, p2, q2, p3, q3, p4, q4; float x, y, t; // 処理対象の粒子の決定. index = blockDim.x * blockIdx.x + threadIdx.x; if (index >= num_particles) return; xn = pos[index][0]; yn = pos[index][1]; // 1段目. p1 = d_U(xn, yn, time); q1 = d_V(xn, yn, time); // 2段目. x = xn + 0.5f * p1 * dt; y = yn + 0.5f * q1 * dt; t = time + 0.5f * dt; p2 = d_U(x, y, t); q2 = d_V(x, y, t); // 3段目. x = xn + 0.5f * p2 * dt; y = yn + 0.5f * q2 * dt; t = time + 0.5f * dt; p3 = d_U(x, y, t); q3 = d_V(x, y, t); // 4段目. x = xn + p3 * dt; y = yn + q3 * dt; t = time + dt; p4 = d_U(x, y, t); q4 = d_V(x, y, t); // 粒子位置の更新. pos[index][0] = xn + (p1 + 2 * p2 + 2 * p3 + p4) / 6.0f * dt; pos[index][1] = yn + (q1 + 2 * q2 + 2 * q3 + q4) / 6.0f * dt; } // GPU処理の起動. void launchGPUKernel(unsigned int num_particles, float(*pos)[2], float time, float dt) // unsigned int num_particles; 粒子の総数. // float (*pos)[2]; 粒子位置. // float time; 時刻. // float dt; 時間刻み. { dim3 grid(num_particles / 512 + 1, 1); dim3 block(512, 1, 1); d_RungeKutta <<< grid, block >> > (num_particles, pos, time, dt); } ### 試したこと ネットをみてファイルをunicode形式にしようとしましたが元からutf-8になっていました ### 補足情報(FW/ツールのバージョンなど) visual studio 2013 cuda9.1を使用しています。 また、今回使用したサンプルプログラムは参考書に書いてあるものをネットからダウンロードしました。 参考書が使用したバージョンはvisual studio 2010 cuda7.0となっています。 ここにより詳細な情報を記載してください。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。