Open limefax opened 5 months ago
The code can work with a slight modification on the first commit.
The problem is most likely that AdaptiveCpp does not currently support mutable lambdas because SYCL does not allow mutable lambdas. I'm not sure this is something I can fix easily.
The code compiles but does not run.
Is this with https://github.com/AdaptiveCpp/AdaptiveCpp/pull/1481 merged in? The output indicates that std::atomic
calls were not correctly remapped to AdaptiveCpp builtins as they should.
Even with that PR atomics with ordering other than relaxed might not be handled correctly because LLVM dos not handle those. I need to plug in the atomic mappings as PTX inline assembly that @gonzalobg has provided.
EDIT: Support for the needed atomic orderings (but only for the specific operations that we need) is in https://github.com/AdaptiveCpp/AdaptiveCpp/pull/1529
we can see that the force is parallelised but build tree and calc mass are not.
This is likely because you don't have https://github.com/AdaptiveCpp/AdaptiveCpp/pull/1518 which enables std::execution::par
offloading if the hardware provides the necessary forward progress guarantees (which basically means: Only recent NVIDIA GPUs). If you don't have that PR it will only offload std::execution::par_unseq
.
Current Situation of compiling Barnes-Hut with AdaptiveCpp
Latest commit
Compilation: AdaptiveCpp commit:
b15cdcfe355be6a5f79d70a0703e67fe0afaa363
(Wed Jun 19 17:53:10 2024 +0200) Barnes-Hut commit: 58fe163b7054cf22d600b507ea03ac946982f820 (Thu Jun 27 11:13:05 2024 +0100)Error:
Note that there is some duplication of errors due to
float
anddouble
template instantiation.Old commit
The code can work with a slight modification on the first commit. The code compiles but does not run. Barnes-Hut commit: 6ee611213ad148f3a1c5ae523ff377c698d65ce2
Changing the last atomic in
clear_tree
insrc/kernels.h
frommemory_order_release
tomemory_order_relaxed
fixes this issue. When running it, we can see that the force is parallelised but build tree and calc mass are not.Other things
Also during this process I came across this bug as well: https://github.com/AdaptiveCpp/AdaptiveCpp/issues/1087