Avoid using the dynamic_smem_size register if the PTX version does not
support it.
This patch should be included when the 'libgomp, nvptx: low-latency memory
allocator' patch is upstreamed.
2022-06-21 Kwok Cheung Yeung <kcy@codesourcery.com>
libgomp/
* config/nvptx/team.c (gomp_nvptx_main): Initialize shared_pool_size
to zero. Do not use dynamic_smem_size register if PTX version lower
than 4.1.
+2022-06-21 Kwok Cheung Yeung <kcy@codesourcery.com>
+
+ * config/nvptx/team.c (gomp_nvptx_main): Initialize shared_pool_size
+ to zero. Do not use dynamic_smem_size register if PTX version lower
+ than 4.1.
+
2021-12-22 Andrew Stubbs <ams@codesourcery.com>
* allocator.c (MEMSPACE_ALLOC): New macro.
/* Find the low-latency heap details .... */
uint32_t *shared_pool;
- uint32_t shared_pool_size;
+ uint32_t shared_pool_size = 0;
asm ("cvta.shared.u64\t%0, __nvptx_lowlat_pool;" : "=r"(shared_pool));
+#if __PTX_ISA_VERSION_MAJOR__ > 4 \
+ || (__PTX_ISA_VERSION_MAJOR__ == 4 && __PTX_ISA_VERSION_MINOR__ >= 1)
asm ("mov.u32\t%0, %%dynamic_smem_size;\n"
: "=r"(shared_pool_size));
+#endif
/* ... and initialize it with an empty free-chain. */
union {