Skip to content

issue with vector-addion.cu  #13

Open
@dsinsight

Description

@dsinsight

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-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&, std::vector&, std::vector&): Assertion `c[i] == a[i] + b[i]' failed.
Aborted

Can you please help me out with the same

Regards
Pronod

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions