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

Replace TeamThreadRange by TeamVectorRange in local_deep_copy #4511

Merged

Conversation

janciesko
Copy link
Contributor

Replaces TeamThreadRange by TeamVectorRange in local_deep_copy. This potentially improves concurrency.
Implements issue: #4054

Copy link
Contributor

@masterleinad masterleinad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable. Have you tried to measure performance improvements?

@janciesko
Copy link
Contributor Author

Good point, let me see if this scales with vec size > 1 now.

@janciesko
Copy link
Contributor Author

#include <Kokkos_Core.hpp>
using view_t = Kokkos::View<double*>;
using teampolicy_t = Kokkos::TeamPolicy<>;

int main(int argc, char *argv[]) {
    Kokkos::ScopeGuard kokkos(argc, argv);
    int N = argc > 1 ? atoi(argv[1]) : 100000000;
    int tsize = argc > 2 ? atoi(argv[2]) : 1;
    int vecsize = argc > 3 ? atoi(argv[3]) : 1; 
    {
        view_t view = view_t("View", N);        
        teampolicy_t team_policy = teampolicy_t(1,tsize,vecsize);
        Kokkos::Timer timer;
        Kokkos::parallel_for(team_policy,
          KOKKOS_LAMBDA (const teampolicy_t::member_type & team)
          {
                Kokkos::Experimental::local_deep_copy(team, view, 1.234);   
          });

        Kokkos::fence();
        double t = timer.seconds();
        printf("%f\n", t);
    }
}

is giving:
Figure_2
Figure_1

@janciesko
Copy link
Contributor Author

Retest this please

@dalg24
Copy link
Member

dalg24 commented Nov 11, 2021

(resolved conflicts introduced by merge of #4520)

@janciesko
Copy link
Contributor Author

Retest this please

@janciesko
Copy link
Contributor Author

Retest this please

@dalg24 dalg24 merged commit f47206f into kokkos:develop Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants