Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silent error (?) #3097

Closed
kyungjoo-kim opened this issue Jun 12, 2020 · 2 comments
Closed

Silent error (?) #3097

kyungjoo-kim opened this issue Jun 12, 2020 · 2 comments
Assignees
Labels
Enhancement Improve existing capability; will potentially require voting

Comments

@kyungjoo-kim
Copy link
Contributor

I happen to use the following code.

using policy_type = Kokkos::TeamPolicy<Kokkos::Cuda>;
policy_type policy(N, AUTO);

const ordinal_type level = 2; 
const ordinal_type per_team_extent = some_work_size_as_extent;
const ordinal_type per_team_scratch =Scratch<real_type_1d_view>::shmem_size(per_team_extent);                    
policy.set_scratch_size(level, Kokkos::PerTeam(per_team_scratch));                                              
                                                                                                                      
Kokkos::parallel_for                                                                                              
      ("test",
       policy.set_scratch_size(level, Kokkos::PerTeam(per_team_scratch)),
       KOKKOS_LAMBDA(const typename policy_type::member_type &member) { 
         do_things_with_shared_memory;
});

As you see in this example code I accidently set the shared memory level 2. Then, the code does not complain in the compile stage but it just skip the "test" parallel for without sending an error. This might not be correct error handling.

@dalg24 dalg24 self-assigned this Jun 12, 2020
@dalg24 dalg24 added the Enhancement Improve existing capability; will potentially require voting label Jun 12, 2020
@dalg24
Copy link
Member

dalg24 commented Jun 12, 2020

I don't think there is a way to catch this mistake at compile time but we can add a runtime check.

@kyungjoo-kim
Copy link
Contributor Author

thanks. I do not expect to catch this error in compile time, either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improve existing capability; will potentially require voting
Projects
None yet
Development

No branches or pull requests

3 participants