ITADN

issue with vector-addion.cu

#13Opendsinsight 创建于 2023-05-02
D
dsinsightcommented
Hey Nick, I am getting an error in / Boundary Check if (tid < N) c[tid] = a[tid] + b[tid]; but when i corrected according to vs suggestion to / Boundary Check if (tid < N) c[tid] == a[tid] + b[tid]; then it says warning [#174](https://www.youtube.com/hashtag/174)-D: expression has no effect 1> if (tid < N) c[tid] == a[tid] + b[tid]; However, after this warning, it showed "completed successfully" . I used the VS-2022 community. Can you please explain what happened, I am still confused Also, when I compile the same program with nvcc on WSL2-ubuntu 20.2 it says vector-add.cu(26): warning #174-D: expression has no effect but the compilation was done and on running the output file give this - vector-add: vector-add.cu:33: void verify_result(std::vector<int>&, std::vector<int>&, std::vector<int>&): Assertion `c[i] == a[i] + b[i]' failed. Aborted Can you please help me out with the same Regards Pronod
0 条评论