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

master_june24: __CUDACC__ macros prevent HIP support #893

Closed
valassi opened this issue Jul 8, 2024 · 4 comments
Closed

master_june24: __CUDACC__ macros prevent HIP support #893

valassi opened this issue Jul 8, 2024 · 4 comments
Assignees

Comments

@valassi
Copy link
Member

valassi commented Jul 8, 2024

Another issue introduced in #830 and being reviewed in #882.

Macro CUDACC should not be used when the code is meant to support also HIP

https://github.com/valassi/madgraph4gpu/blob/8e312bc02d9d072615fcb1052b5db54754498517/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx/CPPProcess.cc#L345

#ifdef MGONGPU_SUPPORTS_MULTICHANNEL
      if( channelIds != 0 )
      {
        channelids_sv = CID_ACCESS::kernelAccessConst( channelIds );
#if defined __CUDACC__ or !defined MGONGPU_CPPSIMD
        if( channelids_sv == 1 ) numerators_sv += cxabs2( amp_sv[0] );
        denominators_sv += cxabs2( amp_sv[0] );
#else
        for( int i = 0; i < neppV; ++i )
        {
          if( channelids_sv[i] == 1 ) numerators_sv += cxabs2( amp_sv[0] );
          denominators_sv += cxabs2( amp_sv[0] );
        }
#endif
      }
#endif
@roiser
Copy link
Member

roiser commented Jul 8, 2024

HI @valassi , thank you for spotting this omission, shall I fix it or do you want to do it?

@valassi valassi self-assigned this Jul 8, 2024
@valassi
Copy link
Member Author

valassi commented Jul 8, 2024

I'll do it, it's faster

valassi added a commit to valassi/madgraph4gpu that referenced this issue Jul 18, 2024
…port HIP where relevant (madgraph5#893), add a comment elsewhere when __CUDACC is needed
valassi added a commit to valassi/madgraph4gpu that referenced this issue Jul 18, 2024
@valassi
Copy link
Member Author

valassi commented Jul 18, 2024

This is fixed by this commit eeb42ee in PR #882

Closing

@valassi valassi closed this as completed Jul 18, 2024
@valassi
Copy link
Member Author

valassi commented Jul 18, 2024

channelids_sv = CID_ACCESS::kernelAccessConst( channelIds );
#if defined CUDACC or !defined MGONGPU_CPPSIMD
if( channelids_sv == 1 ) numerators_sv += cxabs2( amp_sv[0] );

PS These specific lines have disappeared completely (because the SIMD implementation was wrong #894
But there were other places where 830 introduced CUDACC instead of MGONGPUCPP_GPUIMPL

valassi added a commit to valassi/madgraph4gpu that referenced this issue Jul 18, 2024
…port HIP where relevant (madgraph5#893), add a comment elsewhere when __CUDACC is needed
valassi added a commit to valassi/madgraph4gpu that referenced this issue Jul 18, 2024
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

No branches or pull requests

2 participants