madgraph5 / madgraph4gpu

GPU development for the Madgraph5_aMC@NLO event generator software package
29 stars 33 forks source link

Allow cucomplex and thrust only for CUDA but not for HIP? #810

Closed valassi closed 5 months ago

valassi commented 6 months ago

Best complex type for HIP? (allow cucomplex and thrust only for CUDA but not for HIP?)

In PR #801 I noticed that the mgOnGpuCxtypes.h was modifed to allow cucomplex and thrust not only for CUDA but also for HIP. Maybe this was intentional, maybe not, maybe it is actually a very good idea, maybe not?

There are some weird side effects however, e.g. the printouts in check.cc show "???" as complex type, which means that some parts of the code are in unexpected states (which should be internal errors).

I will disable cucomplex and thrust for HIP for the moment. In any case we are far from doing HIP otimizations... we can come back to this later on.

valassi commented 6 months ago

Hm this may be the issue: hipcc of a cc file is missing a "-x hip" flag or whatecer is equivalent to "nvcc -x cu"?

ccache /opt/rocm/bin/hipcc  -O3  -I. -I../../src -I/opt/rocm/include/ -target x86_64-linux-gnu --offload-arch=gfx90a -DHIP_FAST_MATH -DHIP_PLATFORM=amd -fPIC -std=c++17 -DMGONGPU_FPTYPE_DOUBLE -DMGONGPU_FPTYPE2_DOUBLE -fPIC -c Parameters_sm.cc -o Parameters_sm_cu.o
In file included from Parameters_sm.cc:15:
In file included from ./Parameters_sm.h:20:
./mgOnGpuCxtypes.h:38:2: error: You must CHOOSE (ONE AND) ONLY ONE of MGONGPU_CPPCXTYPE_STDCOMPLEX or MGONGPU_CPPCXTYPE_CXSMPL
#error You must CHOOSE (ONE AND) ONLY ONE of MGONGPU_CPPCXTYPE_STDCOMPLEX or MGONGPU_CPPCXTYPE_CXSMPL
 ^
1 error generated when compiling for gfx90a.

This is thus related to PR #368, which is precisely about "-x cu"