[Llvm-bgq-discuss] mathcalls.h and ppu_intrinsics.h

Hal Finkel hfinkel at anl.gov
Thu Jan 26 09:56:03 CST 2017


Hi Jozsef,

Thanks! Indeed, I've worked around the same problem myself with this 
very package. So this is still the only package I know that exposes this 
problem. I just pulled the patch I generated in case it helps 
(attached). I'll also send it to the package authors.

  -Hal


On 01/25/2017 04:23 PM, Jozsef Bakosi wrote:
> Hi Hal,
>
> When I commented out the inclusion of ppu_intrinsics.h, I got:
>
> <...>/include/Random123/philox.h:198:40: error: use of undeclared identifier '__mulhdu'
> _mulhilo_cuda_intrin_tpl(64, uint64_t, R123_MULHILO64_MULHI_INTRIN)
>
> Thus it is __mulhdu, so I guess ppu_intrinsics.h would pull in the assembly
> intrinsics for the mulhdu (Multiply High Double Word Unsigned) instruction.
> Also, as you can see, this is coming out of the Random123 random number
> generator library:
> http://www.thesalmons.org/john/random123/releases/latest/docs/index.html.
>
> Based on their documentation I was able to work around the problem by overriding
> a couple of their pre-processor symbols before including their header:
>
> #define R123_USE_MULHILO64_MULHI_INTRIN 0
> #define R123_USE_GNU_UINT128 1
>
> #include <Random123/philox.h>
>
> This turns off looking for the intrinsics that would be enabled via
> ppu_intrinsics.h and falls back to a non-intrinsics version.
>
> Though this compiles fine, I have not been able to test this solution for
> correctness or performance yet.
>
> I guess a ppu_intrinsics.h that is compatible with mathcalls.h would allow me to
> use the intrinsics, but I'm okay with this solution for now.
>
> Jozsef

-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rand123_clang_ppc.patch
Type: text/x-patch
Size: 1080 bytes
Desc: not available
URL: <http://lists.alcf.anl.gov/pipermail/llvm-bgq-discuss/attachments/20170126/89f40901/attachment-0001.bin>


More information about the llvm-bgq-discuss mailing list