Closed jakub-homola closed 1 year ago
Thank you for reporting this. Sadly, it is rather hard to eschew use of the macro without compiler support, as for your example some special handling is required (allocating storage of the correct type etc., see the macro's expansion). I believe it is doable strictly from user-space, but it's not something that is imminent, and thus for the time being usage of the macro will be required; I will correct the documentation to reflect it.
Trying to compile the HIP program
using the command
produces the following compiler error
This is probably cause by the extern and static specifiers being combined, as
__shared__
is defined as#define __shared__ thread_local static
. I understand, that using theHIP_DYNAMIC_SHARED
macro would solve the issue, but as written in the description of the HIP-CPU library, it "allows CPUs to execute unmodified HIP code", and theextern __shared__ int dyn_shmem[];
is now correct HIP code.